Instructions to use sroot/lgd-cards-gen1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use sroot/lgd-cards-gen1 with ultralytics:
# Couldn't find a valid YOLO version tag. # Replace XX with the correct version. from ultralytics import YOLOvXX model = YOLOvXX.from_pretrained("sroot/lgd-cards-gen1") source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
LGD Cards — Gen 1 (dataset-trained) · YOLO11s playing-card detector, 52 classes
A YOLO11s object detector that locates playing cards in an image and names each by rank + suit
(52 classes, e.g. 10H, KS, JC). Part of the Live Game Defender (LGD) card-detector family —
an on-prem AI integrity monitor for live casino table games. An empty frame yields no detection,
which doubles as an "is there a card?" gate.
Gen 1 is the first, dataset-trained generation. It is superseded — for real casino/table footage use
lgd-cards-gen3(current). Gen 1 scores near-perfect on its own dataset's validation split but has a real-world synthetic→real gap (see Metrics). It is published for provenance and reproducibility.
Generations
| Gen | Repo | Trained on | Frozen real-video holdout recall | Status |
|---|---|---|---|---|
| 1 | lgd-cards-gen1 (this) | Roboflow ow27d v4 dataset |
— (dataset-val only) | superseded |
| 2 | lgd-cards-gen2 | + day-1 PoC table video | 0.68 | superseded |
| 3 | lgd-cards-gen3 | + day-2 PoC table video | 0.85 | ✅ current |
Chip detectors: lgd-chips-gen1 · lgd-chips-gen2.
Classes (52, in data.yaml order)
10C 10D 10H 10S 2C 2D 2H 2S 3C 3D 3H 3S 4C 4D 4H 4S 5C 5D 5H 5S
6C 6D 6H 6S 7C 7D 7H 7S 8C 8D 8H 8S 9C 9D 9H 9S
AC AD AH AS JC JD JH JS KC KD KH KS QC QD QH QS
Suit codes: C=Clubs, D=Diamonds, H=Hearts, S=Spades.
Files
best.pt— Ultralytics PyTorch weights.best.onnx— ONNX export (run withonnxruntime, no training framework needed).data.yaml— class list / dataset config.
Training
- Base: Ultralytics
yolo11s.pt(COCO-pretrained), fine-tuned 25 epochs,imgsz=640. - Data: Roboflow
augmented-startups/playing-cards-ow27dv4 — Public Domain; 21,203 train / 2,020 val / 1,010 test. - Hardware: NVIDIA RTX 3060 (12 GB).
Metrics — on the dataset's own validation split
| mAP50 | mAP50-95 | precision | recall |
|---|---|---|---|
| 0.995 | ~0.80 | 0.999 | ~1.00 |
⚠️ These are dataset-distribution numbers, NOT real-world casino accuracy. On real webcam photos this generation generalizes to many cards but has a known synthetic→real gap on some black court cards (e.g. King of Spades) — where it tends to return no detection rather than a wrong guess. This is exactly why gens 2–3 were fine-tuned on real table video. Do not treat the table above as real-table accuracy.
Usage
from ultralytics import YOLO
model = YOLO("best.pt")
r = model.predict("frame.jpg", conf=0.25)[0]
for b in r.boxes:
print(r.names[int(b.cls)], float(b.conf))
# ONNX / onnxruntime (MIT) — no AGPL code on the inference path
import onnxruntime as ort
sess = ort.InferenceSession("best.onnx", providers=["CPUExecutionProvider"])
# 640x640 letterboxed input; class order == data.yaml above
License & provenance
AGPL-3.0. Every model in this family is a fine-tune of Ultralytics YOLO11 (yolo11s.pt),
which is AGPL-3.0 — so these weights inherit AGPL-3.0 and are not an original work of ours. If
you deploy them in a networked service, AGPL §13 applies: you must offer users the Corresponding
Source. Running the ONNX export via onnxruntime keeps the inference code AGPL-free, but the
AGPL still attaches to the weights themselves.
Built for Live Game Defender (LGD) — an on-prem AI integrity monitor for live casino table games. © 2026 TechTools s.r.o.
- Downloads last month
- 205
Model tree for sroot/lgd-cards-gen1
Base model
Ultralytics/YOLO11Evaluation results
- mAP@50 (dataset validation split — NOT real-world) on Roboflow augmented-startups/playing-cards-ow27d v4 (validation split)self-reported0.995