Installation¶
MegaDetector is installed as part of the PyTorch-Wildlife framework. A single pip install PytorchWildlife pulls in the latest MegaDetector V6, and the model weights download automatically the first time you run a detection.
Requirements:
- Python 3.8+ (3.10+ recommended)
- Optional: NVIDIA GPU with CUDA for 10–50x speedup
Conda¶
GPU Setup¶
If PyTorch installed without CUDA support, install the GPU-enabled build manually:
Then reinstall PyTorch-Wildlife:
Install from Source (CLI and Fine-Tuning)¶
To use the local megadetector command-line tool, or to fine-tune V6 weights on your own dataset, install this repository in editable mode:
This installs the megadetector_core package and registers the megadetector command (detect, train, validate, inference). The pyproject.toml declares the full dependency set, so there is no separate requirements.txt.
Prefer conda for a source install? The repository ships an environment.yaml you can build from directly:
Confirm the CLI is on your path:
See the CLI reference for the full command surface, and the Repository Architecture for how the megadetector_core package is organized.
Verify Installation¶
from PytorchWildlife.models import detection as pw_detection
model = pw_detection.MegaDetectorV6()
print("MegaDetector loaded successfully.")
Weights are downloaded automatically on first use.
Try Without Installing¶
- Hugging Face demo: upload images in your browser
- Google Colab notebook: free cloud GPU
Next Steps¶
- CLI Reference: run detection from the command line
- Model Zoo: choose the right MDV6 variant for your hardware
- Training Guide: fine-tune MegaDetector on your own data