BNNR — Train → Explain → Improve → Prove
Project description
BNNR (Bulletproof Neural Network Recipe)
BNNR is a PyTorch toolkit that makes vision models production-ready through a closed loop: train a model, explain its decisions with XAI, improve it with intelligent augmentation, and prove the result with structured reports and a live dashboard.
Supported tasks (v0.2.9):
- Single-label classification (
task: classification) - Multi-label classification (
task: multilabel) - Object detection (
task: detection) — COCO-mini / YOLO pipelines; seeexamples/detection/
Quickstart
1) Install
pip install bnnr
With optional extras:
pip install "bnnr[dashboard]" # live dashboard (React + FastAPI)
pip install "bnnr[gpu]" # GPU-accelerated augmentations (Kornia)
pip install "bnnr[albumentations]" # Albumentations integration
For development from source:
git clone https://github.com/bnnr-team/bnnr.git
cd bnnr
# Dashboard UI must exist before editable install (hatch force-include).
(cd dashboard_web && npm ci && npm run build)
pip install -e ".[dev,dashboard]"
Examples, notebooks, and markdown docs
The PyPI wheel ships the bnnr package only. Runnable scripts (examples/), notebooks, and the documentation tree (docs/) live in the GitHub repository. After cloning, follow docs/examples.md (for example PYTHONPATH=src python3 examples/... from the repo root).
2) Create a minimal config
cat > /tmp/bnnr_quickstart.yaml <<'YAML'
m_epochs: 1
max_iterations: 1
metrics: [accuracy, f1_macro, loss]
selection_metric: accuracy
selection_mode: max
checkpoint_dir: checkpoints_quickstart
report_dir: reports_quickstart
xai_enabled: false
device: auto
seed: 42
candidate_pruning_enabled: false
YAML
3) Run a short training with live dashboard
python3 -m bnnr train \
--config /tmp/bnnr_quickstart.yaml \
--dataset cifar10 \
--max-train-samples 128 \
--max-val-samples 64 \
--preset light \
--with-dashboard \
--dashboard-port 8080
Expected terminal markers:
BNNR PIPELINE SUMMARYBASELINE TRAININGTRAINING COMPLETEReport JSON : reports_quickstart/run_.../report.jsonDashboard : http://127.0.0.1:8080/
After training, keep the process running and open dashboard:
- desktop:
http://127.0.0.1:8080/ - mobile: scan QR code printed in terminal (same Wi-Fi)
Stop dashboard with Ctrl+C when done.
4) Inspect the report
RUN_DIR=$(ls -1dt reports_quickstart/run_* | head -n 1)
python3 -m bnnr report "$RUN_DIR/report.json" --format summary
If you prefer one-shot (no live dashboard), run the same command with --without-dashboard.
Main CLI commands
python3 -m bnnr --help
python3 -m bnnr train --help
python3 -m bnnr report --help
python3 -m bnnr list-datasets
python3 -m bnnr list-augmentations -v
python3 -m bnnr list-presets
python3 -m bnnr dashboard serve --run-dir reports --port 8080
python3 -m bnnr dashboard export --run-dir reports/run_YYYYMMDD_HHMMSS --out exported_dashboard
Python API entry points
For custom models and dataloaders:
BNNRConfigBNNRTrainerSimpleTorchAdapterquick_run()
See docs/api_reference.md and docs/golden_path.md.
Repository docs
docs/README.md(documentation index and source of truth)docs/getting_started.mddocs/dashboard.mddocs/configuration.mddocs/cli.mddocs/api_reference.mddocs/golden_path.mddocs/detection.mddocs/augmentations.mddocs/examples.mddocs/notebooks.mddocs/artifacts.mddocs/troubleshooting.md
Requirements
From pyproject.toml:
- Python
>=3.10 - Core dependencies include
torch,torchvision,numpy,typer,pydantic,pyyaml - Dashboard extra adds
fastapi,uvicorn,websockets,qrcode
License
MIT — free and open source, forever. BNNR is an academic and community-driven project built for learning, research, and fun. No paid tiers, no commercial offerings — just open-source tools for the CV community.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bnnr-0.2.9.tar.gz.
File metadata
- Download URL: bnnr-0.2.9.tar.gz
- Upload date:
- Size: 6.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6375cc355697965d850c5f3a67dec4f69fa11e496f390f244c0ded4c7e0dfbb
|
|
| MD5 |
90f96e3031e4d2ffa977226dda40c44a
|
|
| BLAKE2b-256 |
9cdac3a2f092c79ed26a74f20a3beeffecbebe99080b3b104c7a09989643a8ff
|
Provenance
The following attestation bundles were made for bnnr-0.2.9.tar.gz:
Publisher:
ci.yml on bnnr-team/bnnr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bnnr-0.2.9.tar.gz -
Subject digest:
d6375cc355697965d850c5f3a67dec4f69fa11e496f390f244c0ded4c7e0dfbb - Sigstore transparency entry: 1280843825
- Sigstore integration time:
-
Permalink:
bnnr-team/bnnr@9d0368a579d43da2f2b72814ff2dc81bbdef5e38 -
Branch / Tag:
refs/tags/v0.2.9 - Owner: https://github.com/bnnr-team
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@9d0368a579d43da2f2b72814ff2dc81bbdef5e38 -
Trigger Event:
push
-
Statement type:
File details
Details for the file bnnr-0.2.9-py3-none-any.whl.
File metadata
- Download URL: bnnr-0.2.9-py3-none-any.whl
- Upload date:
- Size: 1.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08f797757013ef8cefd84c96d98fea7a3e9c824f8d872d16b169f962368312e4
|
|
| MD5 |
b7e038b8b29c32cc47acd36eee17c718
|
|
| BLAKE2b-256 |
bf4ddb554aa2df73a77c928fdc8afbc335c0a3f1db60f0ade53bfec7680fec0b
|
Provenance
The following attestation bundles were made for bnnr-0.2.9-py3-none-any.whl:
Publisher:
ci.yml on bnnr-team/bnnr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bnnr-0.2.9-py3-none-any.whl -
Subject digest:
08f797757013ef8cefd84c96d98fea7a3e9c824f8d872d16b169f962368312e4 - Sigstore transparency entry: 1280843830
- Sigstore integration time:
-
Permalink:
bnnr-team/bnnr@9d0368a579d43da2f2b72814ff2dc81bbdef5e38 -
Branch / Tag:
refs/tags/v0.2.9 - Owner: https://github.com/bnnr-team
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@9d0368a579d43da2f2b72814ff2dc81bbdef5e38 -
Trigger Event:
push
-
Statement type: