Skip to main content

detect and classify insects on a raspberry pi

Project description

bugcam - Raspberry Pi Insect Detection

CLI for running insect detection on Raspberry Pi with Hailo AI HAT+.

Requirements

  • Raspberry Pi 5
  • Raspberry Pi AI HAT+ (Hailo8/Hailo8L)
  • Raspberry Pi Camera Module 3
  • 64-bit Raspberry Pi OS Bookworm
  • Active cooler recommended

Quick Start

# 1. Install system dependencies
sudo apt update && sudo apt install hailo-all

# 2. Install bugcam
pipx install bugcam

# 3. Download detection model
bugcam models download yolov8m

# 4. Run detection
bugcam preview

Commands

bugcam setup

Initialize bugcam by installing dependencies and downloading hailo-rpi5-examples.

bugcam setup

bugcam preview

Run live camera preview with detection overlay.

bugcam preview [--model yolov8m]

bugcam detect

Run continuous detection and save results.

bugcam detect start [--output detections.jsonl] [--duration 30] [--quiet]

Output format (JSONL):

{"timestamp": "2025-12-14T10:30:45", "class": "insect", "confidence": 0.92, "bbox": [100, 200, 150, 250]}

bugcam doctor

Run system diagnostics to check dependencies, hardware, and configuration.

bugcam doctor

bugcam check

Verify system is ready for inference (dependencies, camera, Hailo device).

bugcam check

bugcam models

Manage detection models.

# Download a model (yolov8s or yolov8m)
bugcam models download yolov8m

# List installed models
bugcam models list

# Show model details
bugcam models info yolov8m

bugcam autostart

Manage systemd service for automatic detection on boot.

bugcam autostart enable
bugcam autostart disable
bugcam autostart status
bugcam autostart logs [--follow]

Environment Variables

Optional configuration:

  • HAILO_EXAMPLES_PATH - Custom path for hailo-rpi5-examples (default: ~/hailo-rpi5-examples)
  • XDG_CACHE_HOME - Custom cache directory location (default: ~/.cache)

Monitoring

# Hailo hardware monitoring
hailortcli monitor

# System temperature
vcgencmd measure_temp

# Service logs
bugcam autostart logs --follow

Troubleshooting

# Run diagnostics
bugcam doctor

# Verify system readiness
bugcam check

# Command not found after install
pipx ensurepath  # then close and reopen terminal

# Camera not detected
rpicam-hello
sudo raspi-config  # Enable camera in Interface Options

# Hailo driver issues
sudo apt install --reinstall hailo-all
hailortcli scan

# Service logs
bugcam autostart logs

Development

git clone https://github.com/MIT-Senseable-City-Lab/sensing-garden.git
cd sensing-garden
poetry install
poetry run pytest tests/ -v
poetry run bugcam --help

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bugcam-0.1.17.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bugcam-0.1.17-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

Details for the file bugcam-0.1.17.tar.gz.

File metadata

  • Download URL: bugcam-0.1.17.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.7 Darwin/25.1.0

File hashes

Hashes for bugcam-0.1.17.tar.gz
Algorithm Hash digest
SHA256 673795e687ee0e7df3bfcb5a306f456222c131be230f78bb831cb485aff5b105
MD5 6d6dbec2848956ea2ca8cb9b53badeb7
BLAKE2b-256 0c939fc69a5cf6cd813ccb2d85885671384adac79de96f0c7b136612130cb9a4

See more details on using hashes here.

File details

Details for the file bugcam-0.1.17-py3-none-any.whl.

File metadata

  • Download URL: bugcam-0.1.17-py3-none-any.whl
  • Upload date:
  • Size: 23.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.7 Darwin/25.1.0

File hashes

Hashes for bugcam-0.1.17-py3-none-any.whl
Algorithm Hash digest
SHA256 83e967c130a901090831e4d83b6dd1873b851248fed4f3175be8e1ab91aed8a8
MD5 d78600842c2745eff7f5e89b983d6acd
BLAKE2b-256 31d8c7a2721e7d8c3e9f55d0d1e2cd00c42a1c1e89ccb3ee1f752c9996b4f4ff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page