Skip to content

weecology/portal_camera_traps

Repository files navigation

portal_camera_traps

Small package to run MegaDetector on camera-trap images and send non-empty images to Label Studio.

Data Structure

  1. Use your UF Dropbox account.
  2. Get access to the year's portal_cameras folder.
  3. Add files from each location at a time. Put files in the corresponding Plot and location (Stake or Gate) folder.
  4. Filenames will be: Year/Plot#/Stake#/YYYY-MM-DD HH-MM-SS M frame#_totalframes.JPG for pictures taken inside the plot, and Year/Plot#/Gate#/YYYY-MM-DD HH-MM-SS M frame#_totalframes.JPG for pictures taken outside the plot.
Screenshot 2026-04-30 at 1 51 32 PM

Setup

Overview

  • Run MegaDetector (or a lightweight fallback) over a directory of images to produce a list of images with detections.
  • Upload those non-empty images to Label Studio for annotation.

Quick setup

  1. Mount your T drive and note the path (e.g. /mnt/Tdrive/data/camera_traps).
  2. Create a Python venv and install deps:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
  1. Create a .env file based on .env.example and add secrets (Label Studio URL/API key, optional MEGADETECTOR_CMD).

Processing images with MegaDetector

  • This project expects MEGADETECTOR_CMD to be set and will fail early if it is not.
  • We recommend cloning the MegaDetector repo into vendor/MegaDetector and setting MEGADETECTOR_CMD to: python vendor/MegaDetector/detect.py --input-dir {input_dir} --output {output_json}

Run the detector and produce non_empty.json:

python -m src.portal_camera_traps.scripts.process_megadetector --input-dir /path/to/images --output non_empty.json

Uploading to Label Studio Set LABEL_STUDIO_URL and LABEL_STUDIO_API_KEY in .env, then run:

python -m scripts.post_to_label_studio --images-json non_empty.json --project-name "Camera Trap Project"

Hydra config snippets

  • See config/megadetector.yaml and config/label_studio.yaml for example Hydra configs you can adapt and use with --config-path config --config-name <name>.

Notes

  • The scripts include safe fallbacks so you can start annotating even before MegaDetector is available.
  • If you want the scripts to call MegaDetector directly, set MEGADETECTOR_CMD in your .env.

About

A repo for processing camera trap data from the Portal Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages