File size: 1,950 Bytes
515116b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
---
license: mit
tags:
  - object-detection
  - image-classification
  - set-game
  - card-game
  - computer-vision
  - synthetic-data
size_categories:
  - 1K<n<10K
---

# Set Solver Dataset

Training data for the [Set card game](https://www.setgame.com/) solver.

**[Live demo](https://huggingface.co/spaces/wangtianthu/set-solver)** | **[Models](https://huggingface.co/wangtianthu/set-solver-models)** | **[Source code](https://github.com/wangtian24/set-solver)**

## Dataset Structure

### Classifier — Card Attribute Classification

`classifier/{number}/{color}/{shape}/{fill}/`

1943 cropped card images organized into 81 classes (3 numbers x 3 colors x 3 shapes x 3 fills).

| Attribute | Values |
|-----------|--------|
| Number | one, two, three |
| Color | red, green, blue (purple) |
| Shape | diamond, oval, squiggle |
| Fill | empty, full (solid), partial (striped) |

### Detector — Card Detection (YOLO format)

`detector/images/` and `detector/labels/`

5000 synthetic board images (1280x960) with YOLO-format bounding box annotations.

- **Train**: 4000 images (`detector/images/train/`)
- **Val**: 1000 images (`detector/images/val/`)
- **Labels**: YOLO `.txt` files + rich `.json` metadata per image
- **Class**: single class (`card`)

The synthetic boards feature:
- Grid, random, overlap, and pile card layouts
- Varied background textures (wood, marble, gradients)
- Perspective transforms simulating camera angles
- Noise objects (buttons, coins, paper clips)
- 9-12 cards per board

## Usage

### Detector training with Ultralytics

```python
from ultralytics import YOLO

model = YOLO("yolo11n.pt")
model.train(data="detector/dataset.yaml", epochs=10, imgsz=640)
```

### Classifier training

```python
from torchvision.datasets import ImageFolder
from torchvision import transforms

dataset = ImageFolder("classifier/", transform=transforms.Compose([
    transforms.Resize((224, 224)),
    transforms.ToTensor(),
]))
```