Skip to content

iambhabha/RustAutoScoreEngine

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

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors