Update model weights (CC-BY-4.0)
Browse files
LICENSE
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
CC-BY-4.0
|
README.md
CHANGED
|
@@ -1,3 +1,51 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: cc-by-4.0
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-4.0
|
| 3 |
+
library_name: ultralytics
|
| 4 |
+
pipeline_tag: object-detection
|
| 5 |
+
tags:
|
| 6 |
+
- yolo
|
| 7 |
+
- object-detection
|
| 8 |
+
- tic-tac-toe
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# Tic-tac-toe Cell Detector (YOLOv8n)
|
| 12 |
+
|
| 13 |
+
## Overview
|
| 14 |
+
- YOLOv8n model that detects occupancy per 3x3 cell (empty / white_circle / black_cross).
|
| 15 |
+
- Output: bounding boxes and classes for 9 cells. The included script can overlay cell indices and labels on the image.
|
| 16 |
+
- Intended input: top-down tic-tac-toe board images (matching this repo's synthetic/real data distribution).
|
| 17 |
+
|
| 18 |
+
## License
|
| 19 |
+
- Model weights: CC-BY-4.0
|
| 20 |
+
- Code: AGPL-3.0 (per Ultralytics dependency)
|
| 21 |
+
- Source code for data generation/training/inference: https://github.com/guren-kaina/AMD_Robotics_Hackathon_2025_ProjectTemplate/tree/main/mission2/code/tic_tac_toe_overlay
|
| 22 |
+
|
| 23 |
+
## Usage
|
| 24 |
+
```bash
|
| 25 |
+
pip install ultralytics
|
| 26 |
+
python - <<'PY'
|
| 27 |
+
from ultralytics import YOLO
|
| 28 |
+
model = YOLO("models/train/weights/best.pt") # weights from this repo
|
| 29 |
+
res = model("your_input.jpg", imgsz=640, conf=0.25)
|
| 30 |
+
print(res[0].boxes.cls, res[0].boxes.xyxy)
|
| 31 |
+
res[0].save(filename="overlay.jpg") # visualization
|
| 32 |
+
PY
|
| 33 |
+
```
|
| 34 |
+
- Class IDs: 0=empty_cell, 1=white_circle_cell, 2=black_cross_cell
|
| 35 |
+
- The included `main.py` runs preprocessing, cell index drawing, and JSON export.
|
| 36 |
+
|
| 37 |
+
## Training data
|
| 38 |
+
- Synthetic: gray background + white grid, includes low contrast/blur/noise and O/X distractors. Default generation train 1000 / val 200.
|
| 39 |
+
- Real: `real/images` and YOLO-format labels `real/labels` (no PII).
|
| 40 |
+
|
| 41 |
+
## Training setup
|
| 42 |
+
- Base: Ultralytics YOLOv8n
|
| 43 |
+
- Image size: default 640
|
| 44 |
+
- Epochs: default 20
|
| 45 |
+
- Options: `--preprocess-train` for contrast augmentation, `--real-data` to mix real data into training
|
| 46 |
+
- Weights saved to `models/train/weights/best.pt`
|
| 47 |
+
|
| 48 |
+
## Limitations and notes
|
| 49 |
+
- Accuracy may drop with oblique views or extreme lighting.
|
| 50 |
+
- Only 3 classes; out-of-board objects or different token shapes are unsupported.
|
| 51 |
+
- For new domains, re-label and retrain.
|
best.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:aea3e8f3231a363dc5e70d35899a9980599d25780ccac685769e6d083b2a22fa
|
| 3 |
+
size 6232810
|