Local, privacy-first AI for wildlife camera trap analysis and conservation monitoring
Project description
BioDex
Local AI for wildlife camera traps. Detect animals, filter blanks, identify species, export results — on your machine, not in the cloud.
Built for conservation research, field review, and defensive wildlife monitoring (Fratres / EcoSentinel integration hooks).
Install from PyPI (recommended)
Step 1 — base package + UI (fast, stable):
pip install biodex
pip install "biodex[ui,video,analytics]" --prefer-binary
Step 2 — inference models (heavy; install after step 1):
pip install protobuf==3.20.1
pip install "biodex[heavy]" --prefer-binary
Then run the UI: biodex-ui → http://127.0.0.1:7860
Windows: always pass
--prefer-binaryon the heavy step to avoid slow or failed source builds (cmake,onnxcompile errors).
Do not use pip install "biodex[all]" as your first install. [all] is a conservative bundle (UI + video + analytics + dev tools) and does not include MegaDetector/SpeciesNet. For the full stack: [ui,video,analytics] + [heavy].
Run locally (do this)
Mac / Linux
git clone https://github.com/FratresMedAI/BioDex.git
cd BioDex
./run_biodex.sh
Windows
git clone https://github.com/FratresMedAI/BioDex.git
cd BioDex
run_biodex.bat
Your browser opens http://127.0.0.1:7860. Use the Batch tab to process a folder, or Quick demo for a fast preview.
First analysis downloads models once (~500 MB). After that, everything stays offline on your computer.
v1.0 highlights
- Pluggable models — registry architecture (
core/models/) with MegaDetector + SpeciesNet adapters - Batch performance — chunking, cancel, ETA progress, optional
torch.compile - Video foundations — frame sampling + timeline export (
biodex video, requires[video]extra) - Advanced exports — Wildlife Insights, iNaturalist drafts, timelapse JSON, SQLite, EcoSentinel hook
- Tabbed UI — Dashboard, Batch, Video, Analytics, Settings
- Optional AI review (BYOK) — per-frame LLM notes after batch runs (see below)
- Docker — CPU and GPU images for deployment
- Release maturity — stable API surface, strict typing/linting, and CI-gated quality
Optional AI review (BYOK)
Core detection runs fully offline on your machine. AI review is an optional power feature:
- Open Use via API in the footer.
- Choose a provider, paste your API key, pick a model (or type a custom model ID), then Save.
- After a batch run, select a frame and click AI review (LLM) for a field note: scene summary, species second opinion, and data-quality flags.
Privacy: API keys are stored locally in ~/.cache/biodex/settings.json and sent only to the provider you choose — never to BioDex servers. See SECURITY.md.
Scope in v1.0.1: batch frame review only. Single-image spot check, video key frames, and batch-level summaries are planned for v1.1. Not every model slug in the dropdown is guaranteed to work with every provider — use a custom model ID if needed.
Extras install matrix
| Extra | What it installs | When to use |
|---|---|---|
ui |
Gradio web UI | Default — always |
heavy / models |
MegaDetector, SpeciesNet, PyTorch, protobuf pin | After ui; required for detection |
video |
OpenCV (headless, wheel-pinned) | Video tab / biodex video |
analytics |
matplotlib, seaborn | Analytics tab heatmaps |
edge |
onnxruntime stubs | Experimental edge deploy |
dev |
pytest, ruff, mypy | Contributors |
all |
ui + video + analytics + dev + desktop + edge | No inference stack — not a one-shot full install |
From source (git clone): use run_biodex.bat / run_biodex.sh — they run scripts/install_biodex.*, which installs the heavy stack in a protobuf-safe order.
pip install -e ".[ui,heavy]" --prefer-binary # after scripts/install_biodex.sh, or manual protobuf pin
pip install -e ".[video,analytics]" --prefer-binary
Installation troubleshooting
Clean install (upgrading from 0.5.0 or fixing a broken env)
pip uninstall biodex megadetector speciesnet onnx onnx2torch -y
pip cache purge
pip install biodex
pip install "biodex[ui,video,analytics]" --prefer-binary
pip install protobuf==3.20.1
pip install "biodex[heavy]" --prefer-binary
On Windows, use a fresh virtual environment when possible:
python -m venv .venv
.venv\Scripts\activate
cmake / onnx build errors on Windows
SpeciesNet pulls onnx transitively. If pip tries to build from source:
- Use
--prefer-binaryon every BioDex extra install. - Pin protobuf first:
pip install protobuf==3.20.1 - Install
[heavy]in a separate command after[ui]. - If it still fails, clone the repo and use
run_biodex.bat(uses the ordered install script).
Slow dependency resolution
Avoid biodex[all,heavy] in one command on Windows. Install in the two-step order above.
Batch CLI
For large folders (100+ images), no browser:
biodex batch /path/to/images -o ./results --classify-species --recursive
biodex batch /path/to/images -o ./results --chunk-size 500 --torch-compile
biodex video /path/to/clip.mp4 -o ./video-results --fps 1 --max-frames 120
Environment variables: BIODEX_DETECTOR_MODEL, BIODEX_TORCH_COMPILE, BIODEX_GEOFENCE_REGION, BIODEX_AUDIT_LOG=1
Docker quick start
docker build -t biodex:cpu -f Dockerfile .
docker run --rm -p 7860:7860 biodex:cpu
GPU:
docker build -t biodex:gpu -f Dockerfile.gpu .
Developers
pip install -e ".[ui,models,dev]"
pytest tests/ -v -m "not slow"
ruff check core app.py ui
mypy core app.py ui
pre-commit install # optional
See CHANGELOG.md, docs/roadmap.md, CONTRIBUTING.md, and SECURITY.md.
MIT License. Uses MegaDetector and SpeciesNet.
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 biodex-1.0.3.tar.gz.
File metadata
- Download URL: biodex-1.0.3.tar.gz
- Upload date:
- Size: 4.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca4363eee287c56077423b2a9209c66286f2bd3323246730660f45891f213967
|
|
| MD5 |
2f5a70ee030dad2ce23128b3e2753eb0
|
|
| BLAKE2b-256 |
cac0e322e55e938e7ebe4163641feb1816e8edb9f1f8e45bd28c765c9956e29a
|
Provenance
The following attestation bundles were made for biodex-1.0.3.tar.gz:
Publisher:
release.yml on FratresMedAI/BioDex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
biodex-1.0.3.tar.gz -
Subject digest:
ca4363eee287c56077423b2a9209c66286f2bd3323246730660f45891f213967 - Sigstore transparency entry: 1767653602
- Sigstore integration time:
-
Permalink:
FratresMedAI/BioDex@f8bbdfe92bccee21ff6f4cdc3b82b997a61f9b5e -
Branch / Tag:
refs/tags/v1.0.3 - Owner: https://github.com/FratresMedAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f8bbdfe92bccee21ff6f4cdc3b82b997a61f9b5e -
Trigger Event:
push
-
Statement type:
File details
Details for the file biodex-1.0.3-py3-none-any.whl.
File metadata
- Download URL: biodex-1.0.3-py3-none-any.whl
- Upload date:
- Size: 980.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4e5e91c989080a08317e1a8943c69c9a4489ff330d091c0dda2b1eb14e1f816
|
|
| MD5 |
7eaeb9d70a125655ccfa6d070967eb67
|
|
| BLAKE2b-256 |
5bcdcaa560c175e4bb0b01b52ee0aefc75583cc7e63ec23dc8bf47accfaccbcd
|
Provenance
The following attestation bundles were made for biodex-1.0.3-py3-none-any.whl:
Publisher:
release.yml on FratresMedAI/BioDex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
biodex-1.0.3-py3-none-any.whl -
Subject digest:
e4e5e91c989080a08317e1a8943c69c9a4489ff330d091c0dda2b1eb14e1f816 - Sigstore transparency entry: 1767654804
- Sigstore integration time:
-
Permalink:
FratresMedAI/BioDex@f8bbdfe92bccee21ff6f4cdc3b82b997a61f9b5e -
Branch / Tag:
refs/tags/v1.0.3 - Owner: https://github.com/FratresMedAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f8bbdfe92bccee21ff6f4cdc3b82b997a61f9b5e -
Trigger Event:
push
-
Statement type: