File size: 7,367 Bytes
0ac50f6 fb4bd28 0ac50f6 fb4bd28 3bba077 9510244 0ac50f6 | 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 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | ---
title: Synthetic poker-table screenshots for perception evals (60 labeled images)
license: cc0-1.0
tags:
- ml-intern
- poker
- computer-vision
- synthetic-data
- playing-cards
size_categories:
- n<1K
---
# Poker-Perception Eval · synthetic tables
Synthetic 1600×900 poker table screenshots rendered deterministically (seed 17),
each paired with exact ground-truth labels, built to benchmark how well small
on-device vision models can read a poker table without touching any real-money
client. All pixels are programmatically generated — no game footage, no ToS
surface, fully redistributable.
<div style="display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 2em"><a href="https://hf.co/chat?mode=ml-intern"><img src="https://hf.co/datasets/huggingface/badges/resolve/main/built-with-ml-intern-lg.svg" alt="Built with ML Intern" style="margin:0"></a><a href="https://hf.co/chat?mode=ml-intern&prompt=Fine-tune%20the%20YOLOv11%20card%20detector%20on%20the%20synthetic%20poker-table%20dataset" style="display:inline-flex;align-items:center;gap:5px;padding:4px 12px;border:1.5px solid #eee;border-radius:16px;background:#f9fbfc;color:#c2410c;font-weight:600;font-size:14px;text-decoration:none">Fine-tune YOLO on these tables<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M13.5 6H5a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-8.5m-10.5 6L21 3m0 0h-5m5 0v5"/></svg></a><a href="https://hf.co/chat?mode=ml-intern&prompt=Build%20the%20equity-based%20poker%20decision%20engine%20with%20tunable%20risk%20knobs" style="display:inline-flex;align-items:center;gap:5px;padding:4px 12px;border:1.5px solid #eee;border-radius:16px;background:#f9fbfc;color:#c2410c;font-weight:600;font-size:14px;text-decoration:none">Build the decision engine<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M13.5 6H5a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-8.5m-10.5 6L21 3m0 0h-5m5 0v5"/></svg></a></div>
## Contents
- `data/images/test_000.png … test_059.png` — 1600×900 renders: green felt,
2–6 seats (random), face-up hole + hero cards, flop/turn/river board subset,
pot text, per-seat stack/position plates, occasional bet circles, dealer button.
- `data/labels/test_NNN.json` — exact ground truth: cards (`"A♠"` style), pixel
bboxes per card, per-seat stacks/positions/optional bets, pot, dealer seat.
741 labeled card instances total (avg 12.3/image).
- `render_tables.py` — the generator (deterministic; regenerate with `--seed`).
- `eval_mirage.py`, `eval_yolo.py` — the two scorers used in the eval below.
- `eval/results_mirage_1x.json`, `eval/results_mirage_2x.json`, `results_yolo.json`
— raw per-image outputs of the phase-1 eval. `eval/results_stock_test.json`,
`eval/results_ft_test.json` — before/after eval of the phase-2 fine-tune on
this same seed-17 test set.
- `benchmark/` — the phase-2 training benchmark: 800 train (seed 101) + 80 val
(seed 202) varied-style images in YOLO format (`images/`, `labels/`, `data.yaml`)
with full ground-truth JSONs under `gt/`. The seed-17 set is never in training.
- `train_yolo.py` — the fine-tune script the GPU job ran.
## Eval results (CPU, 2 vCPU)
| Model | Card read / cls acc | Localization | Pot text | s/img |
|---|---|---|---|---|
| **Mirage** 51M (Cactus, CPU) | 0.0 | best-IoU ≈ 0.04 | **0.97** | 6.4 |
| **Mirage @ 2× upscale** | 0.0 | 0.005 | **1.00** | 6.7 |
| **YOLO11n** cards ([shrimantasatpati](https://huggingface.co/shrimantasatpati/yolov11_playing_cards_detection), MIT, conf 0.1, imgsz 1280) | 0.119 (glyph region) | 0.193 (glyph region IoU≥0.4); 0.0 vs full-card box | n/a | 0.37 |
Findings:
1. **Mirage OCR is a table-state reader, not a card reader.** It recovers pot,
stacks, names, positions reliably, but produces no card-glyph text at either
resolution — and 2× upscale doesn't fix it (localization gets worse).
2. **The YOLO card detector detects corner *glyph patches*, not whole cards** on
our renders; scoring against full-card boxes yields 0.0 even though ~28% of
cards have a centered detection. Against the corner-glyph region its
detection rate is 19.3% with 11.9% correct class — weak, because its real-photo
training set is off-distribution for flat synthetic renders.
3. **Implication for the stack:** read *state* (pot/stacks) with Mirage-class
OCR; read *card identity* with a detector fine-tuned on this synthetic data
(or your captured-game frames later). The two failures are complementary and
separable.
## Fine-tune results (phase 2)
YOLO11n fine-tuned 80 epochs (batch 16, imgsz 1280) on `benchmark/` →
[`ThreeSixNine/yolo11n-poker-table-cards`](https://huggingface.co/ThreeSixNine/yolo11n-poker-table-cards).
Scored on the untouched seed-17 test set (741 cards):
| Model | Detection (IoU≥0.4) | Class accuracy | s/img |
|---|---|---|---|
| Stock | 0.193 | 0.119 | 0.36 |
| **Fine-tuned** | **0.999** | **0.586** | 0.33 |
5× class accuracy, essentially perfect localization, no inference cost. Class
accuracy below 1.0 is 52-way rank/suit confusion on unseen domain detail;
per-image worst 6/17, best 12/12. Run cost ≈ $0.53 on a10g-small (31.6 min).
## Sim-to-real results (phase 3)
Real-photo eval at imgsz 224 (scale-matched to these sets):
| Real set | Stock det / cls | Fine-tuned det / cls |
|---|---|---|
| gpiosenka crops (520 imgs, CC0) | 0.000 / 0.000 | 0.571 / 0.329 |
| gunhcolab XML-box scenes (98 imgs) | 0.000 / 0.000 | **0.929** / 0.316 |
- Stock never emits full-card boxes on real photos at any scale (corner-pip
patches only) — 0.0 across the board.
- The fine-tuned model **transfers detection well** (0.93 on real full scenes at
matched scale) but **class accuracy drops 0.586 → ~0.32** — a ~26-point
sim-to-real gap concentrated in the classify head, with failures skewed
toward spades and queens/threes.
- Inference-scale lesson: at imgsz 1280 both models score 0.0 on these sets —
an artifact of letterboxing 224×224 crops to the synthetic-table scale. imgsz
is part of the model contract and must match the data scale.
- gunhcolab files are NOT redistributed (license © original authors); only
aggregate metrics above are published. gpiosenka-derived numbers are CC0-safe.
## v2 mixed fine-tune: head-to-head (phase 4)
`benchmark_2/` — 800+80 scenes, ~40% of card slots pasted with real gpiosenka
TRAIN-split crops at table scale (CC0; valid/test untouched). Fine-tuned from
the phase-2 checkpoint → `best_mixed.pt` in
[`ThreeSixNine/yolo11n-poker-table-cards`](https://huggingface.co/ThreeSixNine/yolo11n-poker-table-cards):
| Eval | FT-v1 | FT-mixed |
|---|---|---|
| Synthetic seed-17 (det / cls) | 0.999 / 0.586 | 0.996 / 0.594 |
| gpiosenka crops (det / cls) | 0.571 / 0.329 | 0.650 / 0.469 |
| gunhcolab scenes (det / cls) | 0.929 / 0.316 | 0.990 / **0.735** |
Cut-paste sim2real doubles scene-level real class accuracy with no synthetic
regression. Raw outputs: `eval/{syn_ft1,syn_ftm,real_gp_*,real_gu_*}.json`.
## Reproduce
```bash
python render_tables.py --n 60 --seed 17
python eval_yolo.py --limit 60 # conf 0.1, imgsz 1280 defaults
python eval_mirage.py --limit 60 # cactus-compute==4.0.1
```
|