Instructions to use sroot/yolo11s-playing-cards-detector with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use sroot/yolo11s-playing-cards-detector 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/yolo11s-playing-cards-detector") source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
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). Built for Live Game Defender — an on-prem AI integrity
monitor for live casino table games. An empty frame yields no detection, giving a built-in
"is there a card?" gate.
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.
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 the detector generalizes well to many cards but has a known synthetic→real domain gap on some black court cards (e.g. King of Spades) — where it tends to return no detection rather than a wrong guess. Real-frame fine-tuning is in progress. 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))
A license-clean ONNX export (best.onnx) is also included — run it with onnxruntime (MIT) so
inference touches no AGPL code.
License
AGPL-3.0, inherited from Ultralytics YOLO11 (code + base weights). The training dataset is Public
Domain (CC0-equivalent); credit to Roboflow augmented-startups/playing-cards-ow27d. Serving this
model over a network obliges you to offer the corresponding source (AGPL network-copyleft).
- Downloads last month
- -