An end-to-end AI system for detecting and recording wildlife. Supports training custom models, running inference on edge devices (Python) or directly in the browser (Web), and managing clips via a modern dashboard.
.
├── infra/
│ ├── supabase_schema.sql # Database schema (clips table + indexes + RLS)
│ └── .env.example # Supabase keys template
├── notebook/ # Model Training
│ ├── wildlife_yolov8_pipeline.ipynb # End-to-end YOLOv8 training & export pipeline
│ └── megadetector_hybrid_detection_pipeline.ipynb # Hybrid MegaDetector training
├── speciesnet/ # SpeciesNet Conversion Tools
│ ├── convert_speciesnet_keras.py # Download & convert SpeciesNet to ONNX
│ ├── generate_labels.py # Extract species labels from model metadata
│ ├── inspect_onnx_labels.py # General ONNX label inspection tool
│ └── quantize_model.py # INT8 quantization for reduced model size
├── edge/ # Python Capture App (Dedicated Hardware)
│ ├── config.yaml # Capture settings (camera, model, thresholds)
│ ├── main.py # Orchestrates capture loop
│ ├── detection.py # YOLOv8 (PyTorch) wrapper
│ ├── recorder.py # Video recording & file management
│ ├── supabase_client.py # Uploads metadata & thumbnails
└── web/ # Next.js Web App (Dashboard + Browser Capture)
├── public/
│ ├── models/ # ONNX models & labels
│ ├── classifier.worker.js # SpeciesNet inference worker
│ ├── yolo.worker.js # YOLO detection worker
├── src/app/
│ ├── page.tsx # Dashboard (Clip List)
│ └── capture/page.tsx # In-Browser Capture Page
├── src/components/
│ └── CameraCapture.tsx # Main capture component
├── src/hooks/
│ ├── useYolo.ts # YOLO detection hook (hybrid worker/main-thread)
│ └── useClassifier.ts # SpeciesNet classification hook
└── src/lib/
├── modelConfig.ts # Model configuration (detector + classifier)
├── processRecordedClip.ts # Post-recording classification logic
└── uploadClip.ts # Supabase upload utilities
Located in notebook/wildlife_yolov8_pipeline.ipynb.
- Purpose: Train YOLOv8 models on wildlife datasets (e.g., ENA24, LILA BC).
- Features:
- Dataset download and formatting.
- Model training (YOLOv8n/s/m).
- Evaluation and visualization.
- Export to ONNX: Converts trained models to
.onnxformat for use in the Web App.
Located in notebook/megadetector_hybrid_detection_pipeline.ipynb.
- Purpose: Fine-tune MegaDetector (YOLOv10) to detect specific backyard animals while preserving generic classes.
- Features:
- Hybrid training (MegaDetector weights + Custom dataset).
- Preserves generic classes:
animal,person,vehicle. - Adds specific classes:
bird,squirrel,dog,cat. - Export to ONNX.
A Next.js application with advanced AI-powered wildlife detection and classification.
- Dashboard: Browse, filter, and watch recorded clips stored in Supabase.
- In-Browser Capture (
/capture):- Turns any laptop or phone into a camera trap.
- Two-Stage AI Pipeline:
- Stage 1 (Detection): Runs via ONNX Runtime Web to detect animals in real-time.
- Stage 2 (Classification): Classifier identifies specific species from detected animals (optional, configurable via UI).
- Hybrid Architecture:
- Main-thread YOLO inference for low-latency live view (smooth bounding boxes).
- Web Worker-based YOLO and SpeciesNet for background post-recording processing (no UI freezing).
- Efficient Keyframe Capture: Captures high-quality frames during live detection, eliminating video seeking during post-processing.
- CDN Powered: ONNX Runtime loaded via local files with CDN fallback for reliability.
- Auto-records clips when animals are detected and uploads to Supabase.
- Configurable models in
public/models(custom ENA24).
- Live Detection: Runs on every Nth frame (configurable) to detect animals.
- Auto-Recording: When an animal is detected, recording automatically starts and captures keyframes.
- Post-Processing Classification (Optional):
- Extracts captured keyframes with animal detections.
- Crops each detected animal bounding box.
- Runs SpeciesNet classifier on each crop to identify species.
- Combines results into species counts for the entire clip.
- Upload: Metadata, thumbnails, and species counts uploaded to Supabase.
cd webcp .env.example .env.localand fill in Supabase credentials.npm installnpm run dev→ Openhttp://localhost:3000
A lightweight Python application designed for dedicated edge devices (Raspberry Pi, Jetson, Laptop).
- Runs YOLOv8 (PyTorch) for high-performance inference.
- Connects to USB webcams or RTSP streams.
- Records
.mp4clips locally and syncs metadata/thumbnails to Supabase. - Supports offline operation (uploads when internet is available).
- Notifications via Telegram or Discord.
cd edgecp config.example.yaml config.yaml(Edit settings: camera source, model path, etc.)cp .env.example .env(Add Supabase & Notification keys)pip install -r requirements.txtpython main.py --config config.yaml
- Create a Supabase project.
- Run
infra/supabase_schema.sqlin the SQL Editor to create theclipstable and policies. - Create a public storage bucket named
thumbnails. - Get your URL and Keys (Anon Key for Web, Service Role Key for Edge/Admin).
To run the Web Dashboard & Browser Capture:
cd web
npm install
npm run dev
# Visit http://localhost:3000/capture to try the cameraTo run the Python Edge Capture:
cd edge
pip install -r requirements.txt
python main.py --config config.yaml