Small package to run MegaDetector on camera-trap images and send non-empty images to Label Studio.
- Use your UF Dropbox account.
- Get access to the year's portal_cameras folder.
- Add files from each location at a time. Put files in the corresponding Plot and location (Stake or Gate) folder.
- Filenames will be:
Year/Plot#/Stake#/YYYY-MM-DD HH-MM-SS M frame#_totalframes.JPGfor pictures taken inside the plot, andYear/Plot#/Gate#/YYYY-MM-DD HH-MM-SS M frame#_totalframes.JPGfor pictures taken outside the plot.
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
- Mount your T drive and note the path (e.g.
/mnt/Tdrive/data/camera_traps). - Create a Python venv and install deps:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt- Create a
.envfile based on.env.exampleand add secrets (Label Studio URL/API key, optional MEGADETECTOR_CMD).
Processing images with MegaDetector
- This project expects
MEGADETECTOR_CMDto be set and will fail early if it is not. - We recommend cloning the MegaDetector repo into
vendor/MegaDetectorand settingMEGADETECTOR_CMDto: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.jsonUploading 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.yamlandconfig/label_studio.yamlfor 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_CMDin your.env.