|
1 | | -# MegaDetector-Camera |
2 | | -An open-source, modular PyTorch framework for scalable wildlife detection and classification in images and videos. |
| 1 | + |
| 2 | + |
| 3 | +# PyTorch-Wildlife |
| 4 | + |
| 5 | +**Unified open-source AI framework for wildlife monitoring and conservation.** |
| 6 | +Microsoft AI for Good Lab — camera-trap detection, species classification, bioacoustic analysis, and more. |
| 7 | + |
| 8 | +<div align="center"> |
| 9 | +<br> |
| 10 | +<a href="https://github.com/microsoft/Pytorch-Wildlife/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue" /></a> |
| 11 | +<a href="https://pypi.org/project/PytorchWildlife"><img src="https://img.shields.io/pypi/v/PytorchWildlife?color=limegreen" /></a> |
| 12 | +<a href="https://pypi.org/project/PytorchWildlife"><img src="https://static.pepy.tech/badge/pytorchwildlife" /></a> |
| 13 | +<a href="https://pypi.org/project/PytorchWildlife"><img src="https://img.shields.io/pypi/pyversions/PytorchWildlife" /></a> |
| 14 | +<a href="https://huggingface.co/spaces/ai-for-good-lab/pytorch-wildlife"><img src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Demo-blue" /></a> |
| 15 | +<a href="https://discord.gg/TeEVxzaYtm"><img src="https://img.shields.io/badge/Discord-Join_us-5865F2?logo=discord&logoColor=white" /></a> |
| 16 | +<a href="https://microsoft.github.io/Pytorch-Wildlife/"><img src="https://img.shields.io/badge/Docs-526CFE?logo=MaterialForMkDocs&logoColor=white" /></a> |
| 17 | +<br><br> |
| 18 | +</div> |
| 19 | + |
| 20 | +PyTorch-Wildlife is the collaborative deep learning framework that powers the [Microsoft AI for Good Lab](https://www.microsoft.com/en-us/ai/ai-for-good)'s biodiversity work. It hosts detection models, species classifiers, and the tools needed to run them — from single-image inference to large-scale batch processing. |
| 21 | + |
| 22 | +**MegaDetector**, the most widely used camera-trap detection model in conservation, is invoked through PyTorch-Wildlife. So are the species classifiers for Amazon Rainforest, Snapshot Serengeti, and European ecosystems. |
| 23 | + |
| 24 | + |
| 25 | +## Quick Start |
| 26 | + |
| 27 | +```bash |
| 28 | +pip install PytorchWildlife |
| 29 | +``` |
| 30 | + |
| 31 | +```python |
| 32 | +import numpy as np |
| 33 | +from PytorchWildlife.models import detection as pw_detection |
| 34 | +from PytorchWildlife.models import classification as pw_classification |
| 35 | + |
| 36 | +# Detection — weights download automatically |
| 37 | +detection_model = pw_detection.MegaDetectorV6() |
| 38 | +detection_result = detection_model.single_image_detection("path/to/image.jpg") |
| 39 | + |
| 40 | +# Classification |
| 41 | +classification_model = pw_classification.AI4GAmazonRainforest() |
| 42 | +classification_result = classification_model.single_image_classification("path/to/image.jpg") |
| 43 | +``` |
| 44 | + |
| 45 | +**Try without installing anything:** |
| 46 | +- [Hugging Face demo](https://huggingface.co/spaces/ai-for-good-lab/pytorch-wildlife) — upload images in your browser |
| 47 | +- [Google Colab notebook](https://colab.research.google.com/drive/1rjqHrTMzEHkMualr4vB55dQWCsCKMNXi?usp=sharing) — free cloud GPU |
| 48 | + |
| 49 | + |
| 50 | +## Available Models |
| 51 | + |
| 52 | +### Detection |
| 53 | +| Model | Architecture | Description | |
| 54 | +|---|---|---| |
| 55 | +| `MegaDetectorV6` | YOLOv10 / YOLOv9 / RT-DETR | Animal detection in camera-trap images | |
| 56 | +| `MegaDetectorV5` | YOLOv5 | Previous generation, widely deployed | |
| 57 | +| `DeepfauneDetector` | YOLOv8 | European ecosystem detection | |
| 58 | +| `HerdNet` | CNN localization | Point-based detection for aerial imagery | |
| 59 | + |
| 60 | +### Classification |
| 61 | +| Model | Description | |
| 62 | +|---|---| |
| 63 | +| `AI4GAmazonRainforest` | Species classification for Amazon Rainforest | |
| 64 | +| `AI4GSnapshotSerengeti` | Species classification for African savanna | |
| 65 | +| `AI4GOpossum` | Opossum vs. non-opossum classifier | |
| 66 | +| `DeepfauneClassifier` | European ecosystem species classifier | |
| 67 | +| `DFNE` | Deepfaune fine-tuned for Northeastern North America | |
| 68 | + |
| 69 | +See the [Model Zoo](https://microsoft.github.io/Pytorch-Wildlife/model_zoo/) for full details, performance benchmarks, and version history. |
| 70 | + |
| 71 | + |
| 72 | +## Part of the Biodiversity Ecosystem |
| 73 | + |
| 74 | +PyTorch-Wildlife is part of the larger open-source ecosystem from the Microsoft AI for Good Lab: |
| 75 | + |
| 76 | +| Repo | Purpose | |
| 77 | +|---|---| |
| 78 | +| [microsoft/Biodiversity](https://github.com/microsoft/Biodiversity) | The umbrella repository — documentation hub for the AI for Good Lab's biodiversity work | |
| 79 | +| [microsoft/Pytorch-Wildlife](https://github.com/microsoft/Pytorch-Wildlife) | This repo — the unified deep learning framework | |
| 80 | +| [microsoft/MegaDetector](https://github.com/microsoft/MegaDetector) | Animal detection in camera-trap imagery | |
| 81 | +| [microsoft/SPARROW](https://github.com/microsoft/SPARROW) | Solar-Powered Acoustic and Remote Recording Observation Watch — AI-enabled edge device | |
| 82 | +| [microsoft/MegaDetector-Acoustic](https://github.com/microsoft/MegaDetector-Acoustic) | Bioacoustic models for audio-based wildlife monitoring | |
| 83 | +| [microsoft/MegaDetector-Overhead](https://github.com/microsoft/MegaDetector-Overhead) | Point-based detection for overhead and aerial imagery | |
| 84 | +| [SPARROW Studio](https://github.com/microsoft/Biodiversity/tree/main/SPARROW-Studio) | Desktop application for running all models with a graphical interface | |
| 85 | + |
| 86 | +> Questions? [Email us](mailto:zhongqimiao@microsoft.com) or join the [](https://discord.gg/TeEVxzaYtm) |
0 commit comments