Thank you for your interest in contributing! This guide will help you get started.
# Clone
git clone https://github.com/machinefi/trio-core.git
cd trio-core
# Create virtual environment (requires Python 3.12+)
python -m venv .venv
source .venv/bin/activate
# Install in development mode with uv (recommended)
pip install uv
uv pip install -e '.[dev]'
# Apple Silicon: also install MLX backend
uv pip install -e '.[mlx,dev]'
# NVIDIA GPU: install Transformers backend
uv pip install -e '.[transformers,dev]'# Run all tests
python -m pytest tests/ -v
# Run specific test file
python -m pytest tests/test_counter.py -v
# Run with coverage
python -m pytest tests/ --cov=trio_core# Start API server
trio serve
# Start with demo data (no camera or VLM needed)
python -m trio_core.api.demo_server- Python 3.12+ with type hints everywhere
- Use
from __future__ import annotationsfor forward references - Linting:
ruff check .andruff format . - Keep functions focused and short
- No unnecessary abstractions -- three similar lines > premature helper
- Comments only where logic isn't self-evident
Critical: Do NOT add any AGPL-licensed dependencies. In particular:
- NO
ultralyticspackage -- we use YOLOv10 ONNX +supervision(MIT) - Check the license of any new dependency before adding it
- When in doubt, open an issue to discuss first
- Fork the repository and create a feature branch from
main - Write tests for any new functionality
- Run the test suite -- all tests must pass
- Run linting:
ruff check . && ruff format --check . - Run regression tests if changing inference code:
python examples/run_regression.py
- Keep PRs focused -- one feature or fix per PR
- Write a clear description using the PR template
Look for issues labeled good first issue -- these are scoped, actionable tasks designed for new contributors.
- Bug fixes in detection/counting pipeline
- New model support (ONNX profiles + backend testing)
- Performance optimizations with benchmarks
- Counting accuracy improvements (measured against Mall dataset)
- Documentation improvements
- New examples and usage patterns
- CI/CD improvements
- Test coverage for edge cases
- API endpoint additions
- Architecture changes (open an issue)
- New dependencies (license check required)
- API breaking changes
trio-core/
src/trio_core/
api/ # FastAPI server, endpoints
analytics/ # Temporal aggregation, anomaly detection
insights.py # InsightExtractor (K3)
counter.py # YOLO + ByteTrack counting pipeline
vlm/ # VLM inference (MLX, Transformers)
models/ # ONNX model files
tests/ # Test suite
experiments/ # Benchmark scripts and results
Use the issue templates to report bugs, request features, or ask questions. Include:
- Python version, OS, hardware (Apple Silicon model, GPU)
- Model being used
- Minimal reproduction steps
- Expected vs actual behavior
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.