Automated Ant Colony Monitoring & Content Generation

via Freelancer ·

Budget / Salary$30–250
TypeFreelance project
LocationRemote
Posted2 hours ago
Python / Computer Vision Developer for Multi-Camera Raspberry Pi 5 & Windows Dashboard System

Project Overview

We are looking for an experienced Python and Computer Vision developer to build an automated, scalable ant colony monitoring and content generation system.
The architecture consists of multiple independent Raspberry Pi 5 stations (each monitoring one colony) capturing continuous multi-camera video, running local YOLOv8 AI object tracking, and syncing highlight clips to a central Windows PC hosting a local web dashboard.
The edge architecture must be completely modular: you will build one master Raspberry Pi application that can be cloned onto multiple independent Raspberry Pi 5 units. Each Pi will run the exact same codebase, with its specific behavior (bitrates, camera indices, padding, schedule) dictated entirely by a local JSON configuration file.
Hardware Environment
Edge Compute (Per Station)
Compute: Raspberry Pi 5 (8GB) running Raspberry Pi OS (Bookworm 64-bit).
AI Hardware: Raspberry Pi AI HAT+ (Hailo-8 / 8L) or CPU-fallback TFLite.
Storage: External USB SSD mounted at /media/ssd/footage/.
Cameras (3 Simultaneous Streams per Pi):
cam0 (CSI): Arducam IMX219 NoIR (24/7 IR night vision)
cam1 (CSI): Arducam IMX519 (Outworld feed)
cam2 (USB): Standard UVC Camera (/dev/videoX)
Central Server
Server: Windows PC on the local network with SMB/CIFS file sharing enabled and dual 8TB storage drives.
Detailed Software Deliverables
1. Modular Edge Application (Raspberry Pi 5)
A. Dynamic Configuration (colony_config.json)
The code must never contain hardcoded paths, IPs, or camera ports. All variables must be pulled from this local file, allowing cloning of the Pi SD card for new colonies by simply updating this file:
colony_id, species name, and central PC backup IP address.
Camera port mappings, locked FPS, bitrates (e.g., 4M or 6M), and locked auto-exposure/white balance.
Upload modes (highlights_only vs full_footage), clip padding in seconds, and local retention hours.
Staggered network sync start times and network bandwidth limits (kbps).
B. Parallel Stream Recorder Daemon (record.py)
A Python daemon managed by systemd (antcam.service).
Asynchronously captures 2x CSI + 1x USB camera streams using Python multiprocessing without dropping frames.
Features a non-blocking shared memory or temporary snapshot hook (/tmp/live_frame_camX.jpg) updated continuously so the AI script can sample frames without triggering a "Device Busy" camera lock.
C. AI Detection & Event Tracking Engine (ai_tracker.py)
Inspects shared frame buffers using YOLOv8-nano (exported to HailoRT or TFLite for hardware acceleration).
Detects classes: worker, queen, brood, and major.
Logs timestamped counts, spatial coordinates, and activity spikes (e.g., foraging departures) into a local SQLite database (antcam.db).
Thumbnail Harvester: Automatically saves high-confidence detection frames (e.g., Queen + 10 workers in clear focus) to a /media/ssd/thumbnails/ folder for YouTube use.
Database Maintenance: Runs an automated weekly VACUUM and index optimization routine to keep antcam.db fast and lightweight.
D. Highlight Clipper & Timeline Marker Export (extract_highlights.py)
Scans antcam.db for activity spikes above a baseline threshold.
Uses FFmpeg to extract lossless, trimmed MP4 highlight clips based on the padding variables in colony_config.json.
Generates a daily .csv or .edl timeline marker file formatted for DaVinci Resolve, containing precise timecodes of peak activity.
E. Fail-Safe Network Sync (nightly_backup.sh)
Bandwidth-Capped Sync: Executes via cron. Uses rsync --bwlimit to push footage, highlight clips, and databases to the Windows PC without saturating the local network.
Verified Purge: Verifies file integrity (checksum/size) on the Windows share before purging local Pi footage older than the configured retention window (e.g., 48 hours).
Disk Space Emergency Loop: If the Pi's local SSD free space drops below 10%, the script must halt raw continuous recording, switch to capturing low-resolution time-lapse snapshots (1 frame / 5s), and output an emergency system log to prevent a fatal OS crash.
2. Central Web Dashboard (Windows PC)
Build a lightweight, local web dashboard (using Flask or Streamlit) hosted on the Windows PC and accessible via local browser (http://localhost:8500).
A. Central Colony Grid & Live Status
Auto-refreshing snapshot tiles for all cameras across all registered Raspberry Pi stations on the network.
Visual system status indicators (Green/Red dots) showing real-time ping connectivity, Pi CPU temperature, and available Pi SSD storage space.
B. Interactive Analytics & Reporting
Reads the synced SQLite databases from each colony.
Renders interactive line charts plotting 24-hour activity trends, population counts, and foraging spikes per colony.
Generates a downloadable daily text summary report and a 4-quadrant summary image grid (daily_summary.jpg) combining morning, noon, evening, and night snapshots.
C. Highlight Reviewer & Editor Integration
A media panel listing the automatically extracted AI highlight clips for the day.
Features an inline video player to preview clips and a direct export button that pushes the clips and DaVinci Resolve marker files directly into an active video editing directory.
D. New Colony Onboarding Tool
A UI form to onboard a new Raspberry Pi.
Inputs the new Pi's IP address and target colony_id, then auto-generates the correct colony_config.json file to deploy to the new Pi.
Candidate Qualification Screening
To ensure you have thoroughly reviewed our technical specifications, please include short answers to these 3 technical questions in your proposal:
How will you structure frame sampling for the AI pipeline during active recording without triggering a "Device Busy" camera lock on the Pi 5?
How will you prevent network saturation when multiple Raspberry Pis sync data to the central Windows PC?
How will settings like bitrate, upload mode, and clip padding be dynamically managed across different Pis without modifying Python source code?
Required Skills
Languages & Core: Python 3 (multiprocessing, SQLite)
Computer Vision & AI: OpenCV, YOLOv8, HailoRT / TFLite
Raspberry Pi OS: Bookworm 64-bit, systemd, rpicam-apps / Picamera2
Web Frameworks: Streamlit or Flask
Networking & Tools: FFmpeg, rsync, SMB/CIFS, DaVinci Resolve .edl/.csv export workflow
python raspberry pi object detection yolo
Apply on Freelancer →

Project sourced from Freelancer.com. Applications happen directly on the original platform — we never collect your data.