Downloads · 30 days
22
9% of all-time downloads
richardpenner/sportsball-game-recognition
sportsball-game-recognition is a object detection model from richardpenner. Use it when you need objects located in an image. It is set up for ultralytics. The card lists the license as agpl-3.0.
Sportsball uses a phone camera to identify a baseball or basketball broadcast on a television. This repository contains the five model roles used by the camera pipeline.
Downloads · 30 days
22
9% of all-time downloads
All-time downloads
258
Public
Repo size
845 MB
Likes
0
Public
Click a slice to open those files.
.onnx619 MB · 73%
From the Hugging Face model README
Sportsball uses a phone camera to identify a baseball or basketball broadcast on a television. This repository contains the five model roles used by the camera pipeline.
A scorebug is the on-screen graphic that shows the score and teams.
sport-router selects baseball, basketball, or neither from the complete
camera frame.mlb-scorebug-locator finds a Major League Baseball scorebug.nba-scorebug-locator finds a National Basketball Association scorebug.mlb-team-detector identifies Major League Baseball team marks in the
high-resolution scorebug crop.nba-team-detector identifies National Basketball Association team marks
in the high-resolution scorebug crop.The team pair is selected before schedule data is checked. A schedule can add an official game identifier, but it does not change the recognized teams.
The application, training tools, evaluation tools, and deployment examples are available in the public Sportsball source repository.
Each model folder includes these files when the format applies:
model.pt: PyTorch weights for Ultralytics YOLO.model.onnx: a portable Open Neural Network Exchange model.hailo-source.onnx: the exact output form used for Hailo compilation.model.hef: a Hailo Execution Format model for Hailo-10H devices.labels.json: class order, input size, and output details.SHA256SUMS contains a SHA-256 checksum for every release file. A checksum is
a file fingerprint that detects an incomplete or changed download.
Install the Hugging Face and Ultralytics command-line tools, then download the complete model set:
python -m pip install huggingface_hub ultralytics
hf download richardpenner/sportsball-game-recognition \
--local-dir sportsball-game-recognition
This short Python example runs the sport router on one camera frame:
from ultralytics import YOLO
router = YOLO("sportsball-game-recognition/sport-router/model.pt")
result = router.predict("camera-frame.jpg", imgsz=384)[0]
print(result.names[result.probs.top1], float(result.probs.top1conf))
The scorebug locators accept a complete camera frame at 768 input pixels. The team detectors accept the native-resolution scorebug crop at 960 input pixels. The full application must use the router, the selected locator, and the matching team detector in that order.
Measurements below use fixed test sets that were not used for training.
This result uses the sport router, both sport-specific locators, and the fallback that tries the other locator after a miss.
The training validation set produced 0.937 precision, 0.936 recall, 0.961 mean average precision at the 50% overlap check, and 0.754 mean average precision averaged across the 50% through 95% overlap checks. Precision is the share of reported marks that are correct. Recall is the share of expected marks that are found. These training validation values do not replace the saved-phone tests used for product decisions.
At the 0.50 confidence cutoff:
The training data includes reviewed broadcast frames and generated phone-to-television scenes. The data is not included in this repository. Users must obtain their own lawful training and test data.
The models and release files use the GNU Affero General Public License version 3.0. The models were trained with Ultralytics YOLO, which applies that license to trained models by default.
Major League Baseball, National Basketball Association, team names, and team marks belong to their respective owners. This project is not endorsed by the leagues or teams.