Tian Wang commited on
Commit ·
9843ba6
1
Parent(s): dadb116
Add detector and classifier models with training artifacts
Browse filesFiles changed (16)
- .gitattributes+2
- README.mdAdded+78
- classifier/classifier_best.ptAdded+3
- classifier/training_results.jsonAdded+13
- detector/args.yamlAdded+109
- detector/plots/BoxF1_curve.pngAdded
- detector/plots/BoxPR_curve.pngAdded
- detector/plots/BoxP_curve.pngAdded
- detector/plots/BoxR_curve.pngAdded
- detector/plots/confusion_matrix.pngAdded
- detector/plots/confusion_matrix_normalized.pngAdded
- detector/plots/results.pngAdded
- detector/results.csvAdded+11
- detector/weights/best.onnxAdded+3
- detector/weights/best.ptAdded+3
- example-detection.pngAdded
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines333435363732 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text*.png filter=lfs diff=lfs merge=lfs -text*.jpg filter=lfs diff=lfs merge=lfs -text
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778---license: mittags: - object-detection - image-classification - yolo - set-game - card-game - computer-vision---
# Set Solver Models
Trained models for the [Set card game](https://www.setgame.com/) solver.

**Live demo**: [huggingface.co/spaces/wangtianthu/set-solver](https://huggingface.co/spaces/wangtianthu/set-solver)
## Models
### Detector — YOLOv11n
Detects individual Set cards on a board image.
| Metric | Value ||--------|-------|| mAP50 | 99.5% || mAP50-95 | 97.4% || Architecture | YOLOv11n || Input size | 640x640 || Epochs | 10 || Training data | 4000 synthetic board images |
**Files**: `detector/weights/best.pt` (PyTorch), `detector/weights/best.onnx` (ONNX)
### Classifier — MobileNetV3
Classifies each card's 4 attributes: shape, color, number, and fill.
| Metric | Value ||--------|-------|| Overall accuracy | 99.9% || Number accuracy | 100% || Color accuracy | 100% || Shape accuracy | 99.9% || Fill accuracy | 99.8% || Architecture | MobileNetV3-Small || Input size | 224x224 || Training data | ~9500 cropped card images (81 classes) |
**File**: `classifier/classifier_best.pt`
## Usage
```pythonfrom ultralytics import YOLOfrom PIL import Image
# Load detectordetector = YOLO("detector/weights/best.pt")results = detector("board_photo.jpg", conf=0.25)
# Load classifierimport torchfrom src.train.classifier import SetCardClassifier
classifier = SetCardClassifier(pretrained=False)checkpoint = torch.load("classifier/classifier_best.pt", map_location="cpu")classifier.load_state_dict(checkpoint["model_state_dict"])classifier.eval()```
## Training
Both models were trained on synthetic data generated by a custom board generator that produces realistic Set game layouts with varied backgrounds, perspective transforms, and noise objects.
Source code: [github.com/wangtian24/set-solver](https://github.com/wangtian24/set-solver)123version https://git-lfs.github.com/spec/v1oid sha256:a0c464367eccfcfd6599377c9af35f72cd23c524b01eda7e9a11ccb1e3ba3f6dsize 1146579512345678910111213{ "test_loss": 0.009692762911799945, "test_accuracy": { "number": 1.0, "color": 1.0, "shape": 0.9992082343626286, "fill": 0.997624703087886 }, "avg_test_accuracy": 0.9992082343626286, "train_size": 9479, "val_size": 1895, "test_size": 1263}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109task: detectmode: trainmodel: yolo11n.ptdata: /Users/wangtian/workspace/set-solver/data/synthetic/dataset.yamlepochs: 10time: nullpatience: 20batch: 16imgsz: 640save: truesave_period: -1cache: falsedevice: mpsworkers: 8project: /Users/wangtian/workspace/set-solver/weightsname: detectorexist_ok: truepretrained: trueoptimizer: autoverbose: trueseed: 0deterministic: truesingle_cls: falserect: falsecos_lr: falseclose_mosaic: 10resume: falseamp: truefraction: 1.0profile: falsefreeze: nullmulti_scale: 0.0compile: falseoverlap_mask: truemask_ratio: 4dropout: 0.0val: truesplit: valsave_json: falseconf: nulliou: 0.7max_det: 300half: falsednn: falseplots: trueend2end: nullsource: nullvid_stride: 1stream_buffer: falsevisualize: falseaugment: falseagnostic_nms: falseclasses: nullretina_masks: falseembed: nullshow: falsesave_frames: falsesave_txt: falsesave_conf: falsesave_crop: falseshow_labels: trueshow_conf: trueshow_boxes: trueline_width: nullformat: torchscriptkeras: falseoptimize: falseint8: falsedynamic: falsesimplify: trueopset: nullworkspace: nullnms: falselr0: 0.01lrf: 0.01momentum: 0.937weight_decay: 0.0005warmup_epochs: 3.0warmup_momentum: 0.8warmup_bias_lr: 0.1box: 7.5cls: 0.5dfl: 1.5pose: 12.0kobj: 1.0rle: 1.0angle: 1.0nbs: 64hsv_h: 0.015hsv_s: 0.7hsv_v: 0.4degrees: 0.0translate: 0.1scale: 0.5shear: 0.0perspective: 0.0flipud: 0.0fliplr: 0.5bgr: 0.0mosaic: 1.0mixup: 0.0cutmix: 0.0copy_paste: 0.0copy_paste_mode: flipauto_augment: randaugmenterasing: 0.4cfg: nulltracker: botsort.yamlsave_dir: /Users/wangtian/workspace/set-solver/weights/detector1234567891011epoch,time,train/box_loss,train/cls_loss,train/dfl_loss,metrics/precision(B),metrics/recall(B),metrics/mAP50(B),metrics/mAP50-95(B),val/box_loss,val/cls_loss,val/dfl_loss,lr/pg0,lr/pg1,lr/pg21,111.468,0.40144,1.19864,0.84562,0.99981,0.99984,0.995,0.9085,0.40196,1.20815,0.82106,0.000656085,0.000656085,0.0006560852,206.25,0.34115,0.4089,0.82012,1,1,0.995,0.95523,0.29123,0.4463,0.79571,0.0011918,0.0011918,0.00119183,304.901,0.32374,0.34916,0.8127,0.99999,1,0.995,0.93135,0.35031,0.37025,0.79607,0.00159551,0.00159551,0.001595514,395.233,0.31295,0.32333,0.81186,0.99997,1,0.995,0.96262,0.26761,0.2805,0.79735,0.001406,0.001406,0.0014065,492.083,0.26809,0.29046,0.80266,0.99989,1,0.995,0.97475,0.24272,0.25697,0.7803,0.001208,0.001208,0.0012086,606.75,0.23878,0.24702,0.79441,0.99999,1,0.995,0.98544,0.21188,0.22382,0.77178,0.00101,0.00101,0.001017,741.542,0.22471,0.22465,0.79115,0.99999,0.99513,0.995,0.97671,0.21286,0.2033,0.77386,0.000812,0.000812,0.0008128,873.213,0.2143,0.21188,0.78911,0.99999,0.98882,0.98531,0.97465,0.17893,0.19046,0.76739,0.000614,0.000614,0.0006149,1041.5,0.19247,0.19322,0.78823,0.99999,0.97096,0.97537,0.9692,0.14963,0.16733,0.76335,0.000416,0.000416,0.00041610,1205.28,0.17649,0.17659,0.78384,0.99999,0.99914,0.995,0.99123,0.13999,0.14978,0.76308,0.000218,0.000218,0.000218123version https://git-lfs.github.com/spec/v1oid sha256:ccd020c044339d0cd2e671a837f209a8adcdcef17982cbae90da2b962e160081size 10477995123version https://git-lfs.github.com/spec/v1oid sha256:d65deae13124271df8739b700d2f893bca1eb7a7bc8ac870702e714b787ceee7size 5453594.gitattributes+2
README.mdAdded+78
classifier/classifier_best.ptAdded+3
classifier/training_results.jsonAdded+13
detector/args.yamlAdded+109
detector/plots/BoxF1_curve.pngAdded

Large File Pointer Details
- SHA256: 22ac76b663bfbc5c70c62254d0838e9551680613f046c10d9a3905712caa78a3
- Pointer size: 130 Bytes
- Size of remote file: 86.4 kB
detector/plots/BoxPR_curve.pngAdded

Large File Pointer Details
- SHA256: df0dc0b651b5b88c715752280eaead0c02aad42774f657354029dd78d305161e
- Pointer size: 130 Bytes
- Size of remote file: 68.3 kB
detector/plots/BoxP_curve.pngAdded

Large File Pointer Details
- SHA256: 7f3592367666105d034a2ce12f0ea69a7d1d3e8294fd4b322a2f58eabc30fef8
- Pointer size: 130 Bytes
- Size of remote file: 76.3 kB
detector/plots/BoxR_curve.pngAdded

Large File Pointer Details
- SHA256: 4f631fabe01c94ae37e1f06bce7c88ce9b36f640e9d62a5123cd0bc56abee686
- Pointer size: 130 Bytes
- Size of remote file: 80.1 kB
detector/plots/confusion_matrix.pngAdded

Large File Pointer Details
- SHA256: 8b72dfb16b3589e5f98b21b849bbe6eb7afda4d01aa4ef7dde0f2e661cee2a22
- Pointer size: 130 Bytes
- Size of remote file: 90.9 kB
detector/plots/confusion_matrix_normalized.pngAdded

Large File Pointer Details
- SHA256: fb754284bd2eb4bbbaa38f906767e6f5c5bf17d40f4bb796162b9c0b982cb5b0
- Pointer size: 130 Bytes
- Size of remote file: 85 kB
detector/plots/results.pngAdded

Large File Pointer Details
- SHA256: 5eaba2b057aa7791c33b23a93e9d82630c4dfee06eff0ee8e81154e482e6b058
- Pointer size: 131 Bytes
- Size of remote file: 273 kB
detector/results.csvAdded+11
detector/weights/best.onnxAdded+3
detector/weights/best.ptAdded+3
example-detection.pngAdded

Large File Pointer Details
- SHA256: c6bd78d069daceb3c9d0990163d75bdd0942a08c841196aa3bf8cf605652cdcd
- Pointer size: 132 Bytes
- Size of remote file: 2.8 MB