Automated fairness testing for physical dice — roll them by the hundreds, read every face with computer vision, and quantify the bias.
Project Site · Devlog · Issues
Dice Tester is a hardware + software system that rolls dice mechanically, photographs each roll, reads the face value using a YOLO object-detection model, and logs results to a SQLite database. The collected data is then analyzed with a chi-square test to determine whether the dice are statistically fair.
The long-term goal is to support any die type — not just six-sided pip dice.
Screenshot / GIF coming soon.
| Component | Notes |
|---|---|
| NVIDIA Jetson Orin NX | Inference and control |
| Stepper motor + driver | Mechanically rolls the dice |
| USB camera | Captures each roll |
| Analog Discovery 2 | Motor waveform generation (WaveForms SDK) |
| Custom enclosure | Houses the dice rolling mechanism |
See Hardware/ for full BOM, wiring diagrams, and optical calculations. The folder is organized into design/, optics/, and procurement/.
- Python 3.10
- A virtual environment manager
- (Optional) NVIDIA Jetson for hardware control — the vision pipeline can run standalone on any machine
git clone https://github.com/G-IV/Dice_Tester.git
cd Dice_Tester
python3.10 -m venv venv
source venv/bin/activate
pip install -e .python main.pyDice_Tester/
├── dice_tester/ # Main Python package
│ ├── analysis/ # Reporting and chi-square analysis
│ ├── data/ # Data helpers
│ ├── database/ # SQLite database manager
│ ├── dice/ # Dice models and face definitions
│ ├── feed/ # Camera feed handling
│ ├── motor/ # Motor control (WaveForms SDK)
│ ├── storage/ # Capture storage and migration
│ ├── stream/ # Video streaming
│ └── workflow/ # Roll orchestration
├── docs/ # GitHub Pages site
├── Hardware/ # BOM, wiring, and optical design docs
├── Modeling/ # YOLO training data and configs
├── tests/ # pytest test suite
├── main.py # Application entry point
└── pyproject.toml
- Roll — Motor drops a die into the capture zone
- Capture — Camera photographs the settled die
- Detect — YOLO model reads the face value
- Log — Result written to SQLite database
- Analyse — Chi-square test applied to the full dataset
See docs/development.md for environment setup details, common commands, and dev notes.