How agentmorris/megadetector works
MegaDetector is a camera-trap image analysis toolkit: users run animal/person/vehicle detection over images, receive standardized detections, then validate, postprocess, and inspect results. The repository also provides video and tiled inference, classification workflows, dataset/annotation format conversion, taxonomy tools, and image metadata utilities. The graph emphasizes batch inference and result handling; other documented or clearly distinct product capabilities are included as separate branches. Some subsystem links are omitted because their implementations were not sampled, so folder proximity is not treated as evidence of calls.
Main entry points: run_detector_batch.py Batch inference · run_detector.py Single-image inference · visualization_utils.py Detection visualization · run_tiled_inference.py Tiled inference
Components 23
Detection inference
- Batch inference
megadetector/detection/run_detector_batch.py - Single-image inference
megadetector/detection/run_detector.py - PyTorch detector
megadetector/detection/pytorch_detector.py - TensorFlow detector
megadetector/detection/tf_detector.py - RF-DETR detector
megadetector/detection/rfdetr_detector.py - Tiled inference
megadetector/detection/run_tiled_inference.py
Results and review
- Detection results
megadetector/data_management/cct_json_utils.py - Batch postprocessing
megadetector/postprocessing/postprocess_batch_results.py - Result validation
megadetector/postprocessing/validate_batch_results.py - Repeat detection removal
megadetector/postprocessing/repeat_detection_elimination/repeat_detections_core.py - Detection visualization
megadetector/visualization/visualization_utils.py - Dataset visualization
megadetector/visualization/visualize_db.py
Classification
- Detection crop workflow
megadetector/classification/detect_and_crop.py - Classifier training
megadetector/classification/train_classifier.py - EfficientNet model
megadetector/classification/efficientnet/model.py - Classification analysis
megadetector/postprocessing/analyze_classification_results.py
Data and taxonomy
- Annotation conversion
megadetector/data_management/yolo_output_to_md_output.py - Image metadata
megadetector/data_management/read_exif.py - Taxonomy mapping
megadetector/taxonomy_mapping/map_lila_taxonomy_to_wi_taxonomy.py
Media processing
- Video processing
megadetector/detection/process_video.py - Video utilities
megadetector/detection/video_utils.py
Other components
- Camera-trap images
- SpeciesNet
Connections 20
- Camera-trap images → Batch inference: processes images
megadetector/detection/run_detector_batch.py - Batch inference → Single-image inference: invokes
megadetector/detection/run_detector_batch.py - Single-image inference → PyTorch detector: loads backend
megadetector/detection/run_detector.py - Single-image inference → TensorFlow detector: loads backend
megadetector/detection/run_detector.py - Single-image inference → RF-DETR detector: loads backend
megadetector/detection/run_detector.py - Single-image inference → Detection results: produces detections
megadetector/detection/run_detector.py - Batch inference → Image metadata: reads metadata
megadetector/detection/run_detector_batch.py - Batch inference → Annotation conversion: converts results
megadetector/detection/run_detector_batch.py - Batch inference → Detection visualization: renders detections
megadetector/detection/run_detector_batch.py - Tiled inference → Batch inference: runs batch inference
megadetector/detection/run_tiled_inference.py - Tiled inference → Single-image inference: runs inference
megadetector/detection/run_tiled_inference.py - Video processing → Video utilities: uses utilities
- Batch postprocessing → Result validation: validates results
- Repeat detection removal → Batch postprocessing: uses batch processing
megadetector/postprocessing/repeat_detection_elimination/repeat_detections_core.py - Repeat detection removal → Detection visualization: renders results
megadetector/postprocessing/repeat_detection_elimination/repeat_detections_core.py - Dataset visualization → Detection visualization: renders images
megadetector/visualization/visualize_db.py - Detection crop workflow → SpeciesNet: supports species workflows
README.md - Classifier training → EfficientNet model: uses model
megadetector/classification/train_classifier.py - Classification analysis → Taxonomy mapping: uses taxonomy
megadetector/postprocessing/analyze_classification_results.py - Annotation conversion → Detection results: writes MD format