--- 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.
## 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 ```