Skip to content

iambhabha/RustAutoScoreEngine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

30 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฏ Rust Auto Score Engine โ€” High-Performance Dart Scorer

Rust Burn WGPU WASM License

A high-concurrency, real-time dart scoring and board analytics engine architected in Rust.

The professional Rust port of the original Dart-Vision project.

Dashboard Preview


โœจ What Does This Do?

The Rust Auto Score Engine uses a deep neural pipeline to:

  1. ๐Ÿ“ท Capture/Upload a dartboard image (800x800).
  2. ๐Ÿ” Detect dart positions and 4 calibration corners in under 50ms.
  3. ๐Ÿ“ Reconstruct board areas even if corners are obscured by players.
  4. ๐Ÿงฎ Calculate the exact score based on BDO professional standards.
  5. ๐Ÿ“Š Display a professional dashboard with SVG overlays and confidence metrics.

๐ŸŒ Live Demonstrations

Experience the engine directly in your browser or via cloud hosting:

Platform Link Technology
WASM Site ๐Ÿ”— Open Demo Rust + WebAssembly (Local Inference)
HF Space ๐Ÿ”— Open Space Docker + Axum (Cloud Inference)

๐Ÿ› ๏ธ Performance & CLI

The engine is optimized for sub-millisecond latency on modern GPUs.

Command Category Key Features
cargo run --release -- gui Dashboard Full Web UI (8080), Live SVG, Real-time Analysis
cargo run --release -- train Training Adam Optimizer, DIOU Loss, Auto-Checkpointing
cargo run --release -- test <path> Diagnostics Raw Coordinate Reporting, Confidence Metrics

Note: For maximum performance, always use the --release flag during execution.


๐Ÿš€ Installation & Setup

1. Prerequisites

  • Rust Toolchain: Stable channel (1.75+).
  • GPU Drivers: Support for Vulkan, Metal, or DX12 (via WGPU).

2. Quick Deployment

# Clone Repo
git clone https://github.com/iambhabha/RustAutoScoreEngine.git
cd RustAutoScoreEngine

# Ensure weights are present
# Place 'model_weights.bin' in the root directory

# Launch Dashboard
cargo run --release -- gui

๐Ÿ‹๏ธ Neural Training Ecosystem

Follow these steps to train the model on your own hardware using the Burn framework.

1. Dataset Preparation

Download the Official IEEE DeepDarts Collection (16K+ images) and extract them:

# Extract into dataset/800 folder
unzip images.zip -d dataset/800/

2. Config & Labels

Ensure dataset/labels.json exists with mappings for:

  • Class 0: Dart Tip
  • Class 1-4: Calibration Corners

3. Execution

cargo run --release -- train

๐Ÿ’ก VRAM Optimization: The engine is optimized for as little as 3.3GB VRAM, making it training-ready for consumer laptops and GPUs.

โš™๏ธ GPU Tuning: All performance and accuracy settings are now in src/config.rs. See SETTINGS.md for detailed instructions on how to optimize for 100GB vs RTX 5080 VRAM.


๐Ÿค– Auto-Labeling Ecosystem (AI-Powered Generation)

Need to generate a large labeled dataset quickly? Use our built-in auto-labelers to detect corners and darts automatically from raw images.

๐Ÿ Python Auto-Labeler (YOLOv8 Based)

This uses a pre-trained model.pt to generate labels_auto.json and high-quality visuals.

python tools/labeler_v8.py
  • Clean Visuals: Draws sharp 12x12 boxes with color-coded labels (C1-C4, D).
  • Customizable: Adjust box size or colors in the generate() function using OpenCV.

๐Ÿฆ€ Rust Auto-Labeler (ONNX Based)

A pure Rust implementation for ultra-fast, dependency-free dataset labeling using model.onnx.

cargo run --bin autolabel
  • Pixel-Art Labels: Custom "D" and "C1-C4" renderer for clear verification without font dependencies.
  • Fixed Boxes: Uses synchronized 12x12 boxes to match the Python output exactly.
  • Legend: Prints a color guide (Red=C1, Green=C2, etc.) directly in your terminal.

๐Ÿ“ Project Structure

RustAutoScoreEngine/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ main.rs            โ† Entry point (CLI Handler)
โ”‚   โ”œโ”€โ”€ bin/
โ”‚   โ”‚   โ””โ”€โ”€ autolabel.rs   โ† Rust Auto-Labeler (ONNX)
โ”‚   โ”œโ”€โ”€ model.rs           โ† YOLOv4-tiny (Burn Implementation)
โ”‚   โ”œโ”€โ”€ server.rs          โ† Axum Web Server & API
โ”‚   โ”œโ”€โ”€ train.rs           โ† Training Loop & Optimizers
โ”‚   โ”œโ”€โ”€ scoring.rs         โ† BDO Standard Mathematics
โ”‚   โ””โ”€โ”€ wasm_bridge.rs     โ† Browser Bindings
โ”œโ”€โ”€ tools/
โ”‚   โ””โ”€โ”€ labeler_v8.py      โ† Python Auto-Labeler (YOLOv8)
โ”œโ”€โ”€ static/
โ”‚   โ””โ”€โ”€ index.html         โ† Professional Dashboard UI
โ”œโ”€โ”€ dataset/
โ”‚   โ”œโ”€โ”€ 800/               โ† Training Images
โ”‚   โ””โ”€โ”€ labels.json        โ† Ground Truth Metadata
โ”œโ”€โ”€ model_weights.bin      โ† Trained Neural Weights
โ”œโ”€โ”€ Dockerfile             โ† Hugging Face Space Config
โ”œโ”€โ”€ Cargo.toml             โ† Dependencies & Build Config
โ”œโ”€โ”€ SETTINGS.md            โ† GPU & Training Optimization Guide
โ””โ”€โ”€ README.md              โ† Project Documentation

๐Ÿ“ Board Geometry (BDO Standard)

Region Radius (mm)
Full Board 225.5
Double Ring 170.0
Treble Ring 107.4
Outer Bull 15.9
Bullseye 6.35

๐Ÿ“„ Research & Citation

If you use this work in your research, please cite:

@inproceedings{mcnally2021deepdarts,
  title     = {DeepDarts: Modeling Keypoints as Objects for Automatic Scorekeeping in Darts using a Single Camera},
  author    = {McNally, William and Narasimhan, Kanav and Guttikonda, Srinivasu and Yampolsky, Alexander and McPhee, John and Wong, Alexander},
  booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVSports)},
  year      = {2021}
}

Made with โค๏ธ by bhabha-kapil โ€” RustAutoScoreEngine

About

A high-performance dart scoring engine architected in Rust using the Burn Deep Learning framework. Features real-time coordinate recovery and BDO standard point calculation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors