
PyTorch-Wildlife¶
[!TIP] PyTorch-Wildlife is part of the microsoft/Biodiversity umbrella — the hub for all AI for Good Lab wildlife tools. MegaDetector lives at microsoft/MegaDetector.
PyTorch-Wildlife is the unified open-source AI framework from the Microsoft AI for Good Lab for wildlife monitoring. It hosts detection models, species classifiers, and the tools needed to run them — from single-image inference to large-scale batch processing across camera-trap datasets.
Our mission is to create a global community where conservation scientists can collaborate — sharing datasets and deep learning architectures for wildlife conservation. PyTorch-Wildlife provides the shared foundation that every project in our ecosystem builds on.
Quick Start¶
import numpy as np
from PytorchWildlife.models import detection as pw_detection
from PytorchWildlife.models import classification as pw_classification
# Detection — MegaDetector V6, weights download automatically
detection_model = pw_detection.MegaDetectorV6()
detection_result = detection_model.single_image_detection("path/to/image.jpg")
# Classification
classification_model = pw_classification.AI4GAmazonRainforest()
classification_result = classification_model.single_image_classification("path/to/image.jpg")
Try without installing: - Hugging Face demo — upload images in your browser - Google Colab notebook — free cloud GPU
What's Inside¶
PyTorch-Wildlife provides a modular set of building blocks:
- Detection models — MegaDetector V5/V6 (multiple architectures), Deepfaune detector, HerdNet for aerial imagery
- Classification models — Amazon Rainforest, Snapshot Serengeti, Opossum, Deepfaune, DFNE (New England)
- Bioacoustic models — audio-based wildlife identification
- Data utilities — transforms, datasets, batch processing, video support
- Demo notebooks — Jupyter notebooks and Gradio web UI for hands-on exploration
See the Model Zoo for the full list with performance benchmarks.
Part of the Biodiversity Ecosystem¶
PyTorch-Wildlife is one project in a larger open-source ecosystem from the AI for Good Lab:
| Repo | Purpose |
|---|---|
| microsoft/Biodiversity | The umbrella repository — documentation hub for the AI for Good Lab's biodiversity work |
| microsoft/Pytorch-Wildlife | This repo — the unified deep learning framework |
| microsoft/MegaDetector | Animal detection in camera-trap imagery |
| microsoft/SPARROW | Solar-Powered Acoustic and Remote Recording Observation Watch — AI-enabled edge device |
| microsoft/MegaDetector-Acoustic | Bioacoustic models for audio-based wildlife monitoring |
| microsoft/MegaDetector-Classifier | Camera-trap species classification fine-tuning — adapt classifiers to your own datasets and geographic regions |
| microsoft/MegaDetector-Overhead | Point-based detection for overhead and aerial imagery |
| SPARROW Studio | Desktop application for running all models with a graphical interface |
[!TIP] If you have any questions, please email us or join us on Discord: