MegaDetector

Deep learning tools that accelerate the review of motion-triggered wildlife camera images.
https://github.com/microsoft/CameraTraps

Category: Biosphere
Sub Category: Terrestrial Wildlife

Keywords

camera-traps computer-vision conservation machine-learning megadetector pytorch pytorch-wildlife wildlife

Keywords from Contributors

ecology cameratraps aiforearth transforms measur observation distributed web-mapping convolutional-neural-networks deep-neural-networks

Last synced: about 20 hours ago
JSON representation

Repository metadata

PyTorch Wildlife: a Collaborative Deep Learning Framework for Conservation.

README.md

image

📣 Announcements

🚀 We’re Open for Contributions!

We’re excited to announce that Pytorch-Wildlife is now open to community contributions!
If you’d like to get involved and help improve the project, we’d love to have you on board.

👉 Check out our Contribution Guidelines:

📚 How to Participate

You’ll find everything you need there — from how to pick an issue, to submitting your first pull request.
Let’s build this together! 🐾🌱

V 1.2.4

The inference code for the MIT YOLO and Apache RT‑DETR models is now available! To use either one, just load it like any other PyTorch‑Wildlife model:

from pw_detection import MegaDetectorV6MIT, MegaDetectorV6Apache

# MIT YOLO
detector = MegaDetectorV6MIT(
    device=DEVICE,
    pretrained=True,
    version="MDV6-mit-yolov9-e"
)

# Apache RT‑DETR
detector = MegaDetectorV6Apache(
    device=DEVICE,
    pretrained=True,
    version="MDV6-apa-rtdetr-e"
)

Valid versions:

  • MDV6-mit-yolov9-c
  • MDV6-mit-yolov9-e
  • MDV6-apa-rtdetr-c
  • MDV6-apa-rtdetr-e

You can also try out the full pipeline using the detection_classification_pipeline_demo.py script in the demo folder.

Previous versions:

👋 Welcome to Pytorch-Wildlife

PyTorch-Wildlife is an AI platform designed for the AI for Conservation community to create, modify, and share powerful AI conservation models. It allows users to directly load a variety of models including MegaDetector, DeepFaune, and HerdNet from our ever expanding model zoo for both animal detection and classification. In the future, we will also include models that can be used for applications, including underwater images and bioacoustics. We want to provide a unified and straightforward experience for both practicioners and developers in the AI for conservation field. Your engagement with our work is greatly appreciated, and we eagerly await any feedback you may have.

Explore the codebase, functionalities and user interfaces of Pytorch-Wildlife through our documentation, interactive HuggingFace web app or local demos and notebooks.

🚀 Quick Start

👇 Here is a quick example on how to perform detection and classification on a single image using PyTorch-wildlife

import numpy as np
from PytorchWildlife.models import detection as pw_detection
from PytorchWildlife.models import classification as pw_classification

img = np.random.randn(3, 1280, 1280)

# Detection
detection_model = pw_detection.MegaDetectorV6() # Model weights are automatically downloaded.
detection_result = detection_model.single_image_detection(img)

#Classification
classification_model = pw_classification.AI4GAmazonRainforest() # Model weights are automatically downloaded.
classification_results = classification_model.single_image_classification(img)

More models can be found in our model zoo

⚙️ Install Pytorch-Wildlife

pip install PytorchWildlife

Please refer to our installation guide for more installation information.

📃 Documentation

Please also go to our newly made dofumentation page for more information:

🖼️ Examples

Image detection using MegaDetector


Credits to Universidad de los Andes, Colombia.

Image classification with MegaDetector and AI4GAmazonRainforest


Credits to Universidad de los Andes, Colombia.

Opossum ID with MegaDetector and AI4GOpossum


Credits to the Agency for Regulation and Control of Biosecurity and Quarantine for Galápagos (ABG), Ecuador.

🖋️ Cite us!

We have recently published a summary paper on Pytorch-Wildlife. The paper has been accepted as an oral presentation at the CV4Animals workshop at this CVPR 2024. Please feel free to cite us!

@misc{hernandez2024pytorchwildlife,
      title={Pytorch-Wildlife: A Collaborative Deep Learning Framework for Conservation}, 
      author={Andres Hernandez and Zhongqi Miao and Luisa Vargas and Sara Beery and Rahul Dodhia and Juan Lavista},
      year={2024},
      eprint={2405.12930},
      archivePrefix={arXiv},
}

Also, don't forget to cite our original paper for MegaDetector:

@misc{beery2019efficient,
      title={Efficient Pipeline for Camera Trap Image Review},
      author={Sara Beery and Dan Morris and Siyu Yang},
      year={2019}
      eprint={1907.06772},
      archivePrefix={arXiv},
}

🤝 Existing Collaborators and Contributors

The extensive collaborative efforts of Megadetector have genuinely inspired us, and we deeply value its significant contributions to the community. As we continue to advance with Pytorch-Wildlife, our commitment to delivering technical support to our existing partners on MegaDetector remains the same.

Here we list a few of the organizations that have used MegaDetector. We're only listing organizations who have given us permission to refer to them here or have posted publicly about their use of MegaDetector.

We are also building a list of contributors and will release in future updates! Thank you for your efforts!

[!IMPORTANT]
If you would like to be added to this list or have any questions regarding MegaDetector and Pytorch-Wildlife, please email us or join us in our Discord channel:

Citation (https://github.com/microsoft/CameraTraps/blob/main/)

cff-version: 1.2.0
title: Efficient Pipeline for Camera Trap Image Review
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Sara
    family-names: Beery
  - given-names: Dan
    family-names: Morris
    email: cameratraps@lila.science
  - given-names: Siyu
    family-names: Yang
identifiers:
  - type: url
    value: 'https://arxiv.org/abs/1907.06772'
    description: 'arXiv preprint, 1907.06772, 2019'
repository-code: 'http://github.com/ecologize/CameraTraps'
keywords:
  - Camera traps
  - Conservation
  - Computer vision
license: MIT

Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 6 days ago

Total Commits: 3,101
Total Committers: 67
Avg Commits per committer: 46.284
Development Distribution Score (DDS): 0.559

Commits in past year: 128
Committers in past year: 12
Avg Commits per committer in past year: 10.667
Development Distribution Score (DDS) in past year: 0.484

Name Email Commits
Dan Morris d****s@c****u 1368
Marcel Simon a****n@m****m 340
Siyu Yang y****u@m****m 282
amritagupta g****0@g****m 268
Christopher Yeh c****6 169
zhmiao z****o@m****m 162
aa-hernandez 6****z 77
annie.enchakattu a****u@g****m 63
Vardhan Duvvuri G****r@G****g 62
Isai Daniel 8****8 38
Daniela Ruiz d****1@u****o 37
v-andreshern v****n@m****m 18
Annie Enchakattu 3****u 15
Vardhan Duvvuri v****i@o****m 12
Vardhan duvvuri v****i@g****g 12
Ubuntu l****x@l****t 12
arashno a****h@g****m 10
Patrick Flickinger p****n@m****m 10
Ubuntu f****s@n****t 10
Daniela v****z@m****m 10
Sundar Sripada V. S. s****6@g****m 9
Default User u****r@u****t 7
Ubuntu m****t@m****t 6
Ubuntu c****e@c****t 6
Daniela Ruiz d****1@d****1@u****o 6
Sara Beery s****y@g****m 6
SuhailSaify s****8@g****m 6
dependabot[bot] 4****] 6
Siyu Yang y****7@i****m 5
Darío Hereñú m****a@g****m 4
and 37 more...

Committer domains:


Issue and Pull Request metadata

Last synced: 19 days ago

Total issues: 122
Total pull requests: 335
Average time to close issues: about 2 months
Average time to close pull requests: 13 days
Total issue authors: 80
Total pull request authors: 32
Average comments per issue: 2.43
Average comments per pull request: 0.29
Merged pull request: 223
Bot issues: 5
Bot pull requests: 77

Past year issues: 36
Past year pull requests: 63
Past year average time to close issues: 15 days
Past year average time to close pull requests: 9 days
Past year issue authors: 23
Past year pull request authors: 12
Past year average comments per issue: 0.61
Past year average comments per pull request: 0.17
Past year merged pull request: 50
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/microsoft/CameraTraps

Top Issue Authors

  • aa-hernandez (9)
  • aweaver1fandm (5)
  • microsoft-github-policy-service[bot] (4)
  • JaimyvS (4)
  • VLucet (4)
  • nathanielrindlaub (3)
  • yodaka0 (3)
  • VYRION-Ai (3)
  • barlavi1 (3)
  • ra9hur (2)
  • MattB-SF (2)
  • ehallein (2)
  • davidwhealey (2)
  • dvelasco3 (2)
  • NetZissou (2)

Top Pull Request Authors

  • zhmiao (133)
  • dependabot[bot] (74)
  • aa-hernandez (52)
  • agentmorris (12)
  • JoejynWan (7)
  • yangsiyu007 (4)
  • ss26 (4)
  • luvargas2 (4)
  • lucas-a-meyer (4)
  • BenCretois (3)
  • VLucet (3)
  • chrisyeh96 (3)
  • microsoft-github-policy-service[bot] (3)
  • omahs (2)
  • YoussefBayouli (2)

Top Issue Labels

  • bug (26)
  • enhancement (19)
  • question (11)
  • good first issue (4)
  • help wanted (1)
  • Waiting for more info (1)
  • discussion (1)
  • dependencies (1)
  • python (1)

Top Pull Request Labels

  • dependencies (74)
  • python (68)
  • .NET (2)

Package metadata

pypi.org: pytorchwildlife

a PyTorch Collaborative Deep Learning Framework for Conservation.

  • Homepage: https://github.com/microsoft/CameraTraps/
  • Documentation: https://pytorchwildlife.readthedocs.io/
  • Licenses: MIT
  • Latest release: 1.2.4 (published 3 months ago)
  • Last Synced: 2025-10-29T17:35:58.142Z (5 days ago)
  • Versions: 33
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 1,380 Last month
  • Rankings:
    • Dependent packages count: 9.379%
    • Average: 38.75%
    • Dependent repos count: 68.121%
  • Maintainers (2)

Dependencies

Dockerfile docker
  • python 3.8-slim build
PW_FT_classification/requirements.txt pypi
  • absl-py ==2.1.0
  • aiofiles ==23.2.1
  • aiohttp ==3.9.3
  • aiosignal ==1.3.1
  • altair ==5.2.0
  • annotated-types ==0.6.0
  • anyio ==4.2.0
  • asttokens ==2.4.1
  • async-timeout ==4.0.3
  • attrs ==23.2.0
  • backcall ==0.2.0
  • cachetools ==5.3.2
  • certifi ==2023.11.17
  • charset-normalizer ==3.3.2
  • click ==8.1.7
  • colorama ==0.4.6
  • contourpy ==1.1.1
  • cycler ==0.12.1
  • decorator ==5.1.1
  • exceptiongroup ==1.2.0
  • executing ==2.0.1
  • fastapi ==0.109.0
  • ffmpy ==0.3.1
  • filelock ==3.13.1
  • fire ==0.5.0
  • fonttools ==4.47.2
  • frozenlist ==1.4.1
  • fsspec ==2023.12.2
  • google-auth ==2.27.0
  • google-auth-oauthlib ==1.0.0
  • gradio ==4.8.0
  • gradio-client ==0.7.1
  • grpcio ==1.60.0
  • h11 ==0.14.0
  • httpcore ==1.0.2
  • httpx ==0.26.0
  • huggingface-hub ==0.20.3
  • idna ==3.6
  • importlib-metadata ==7.0.1
  • importlib-resources ==6.1.1
  • ipython ==8.12.3
  • jedi ==0.19.1
  • jinja2 ==3.1.3
  • joblib ==1.3.2
  • jsonschema ==4.21.1
  • jsonschema-specifications ==2023.12.1
  • kiwisolver ==1.4.5
  • lightning-utilities ==0.10.1
  • markdown ==3.5.2
  • markdown-it-py ==3.0.0
  • markupsafe ==2.1.4
  • matplotlib ==3.7.4
  • matplotlib-inline ==0.1.6
  • mdurl ==0.1.2
  • multidict ==6.0.4
  • munch ==2.5.0
  • numpy ==1.24.4
  • oauthlib ==3.2.2
  • opencv-python ==4.9.0.80
  • opencv-python-headless ==4.9.0.80
  • orjson ==3.9.12
  • packaging ==23.2
  • pandas ==2.0.3
  • parso ==0.8.3
  • pexpect ==4.9.0
  • pickleshare ==0.7.5
  • pillow ==10.1.0
  • pkgutil-resolve-name ==1.3.10
  • prompt-toolkit ==3.0.43
  • protobuf ==3.20.1
  • psutil ==5.9.8
  • ptyprocess ==0.7.0
  • pure-eval ==0.2.2
  • pyasn1 ==0.5.1
  • pyasn1-modules ==0.3.0
  • pydantic ==2.6.0
  • pydantic-core ==2.16.1
  • pydub ==0.25.1
  • pygments ==2.17.2
  • pyparsing ==3.1.1
  • python-dateutil ==2.8.2
  • python-multipart ==0.0.6
  • pytorch-lightning ==1.9.0
  • pytorchwildlife *
  • pytz ==2023.4
  • pyyaml ==6.0.1
  • referencing ==0.33.0
  • requests ==2.31.0
  • requests-oauthlib ==1.3.1
  • rich ==13.7.0
  • rpds-py ==0.17.1
  • rsa ==4.9
  • scikit-learn ==1.2.0
  • scipy ==1.10.1
  • seaborn ==0.13.2
  • semantic-version ==2.10.0
  • shellingham ==1.5.4
  • six ==1.16.0
  • sniffio ==1.3.0
  • stack-data ==0.6.3
  • starlette ==0.35.1
  • supervision ==0.16.0
  • tensorboard ==2.14.0
  • tensorboard-data-server ==0.7.2
  • termcolor ==2.4.0
  • thop ==0.1.1
  • threadpoolctl ==3.2.0
  • tomlkit ==0.12.0
  • toolz ==0.12.1
  • torch ==1.10.1
  • torchaudio ==0.10.1
  • torchmetrics ==1.3.0.post0
  • torchvision ==0.11.2
  • tqdm ==4.66.1
  • traitlets ==5.14.1
  • typer ==0.9.0
  • typing-extensions ==4.9.0
  • tzdata ==2023.4
  • ultralytics-yolov5 ==0.1.1
  • urllib3 ==2.2.0
  • uvicorn ==0.27.0.post1
  • wcwidth ==0.2.13
  • websockets ==11.0.3
  • werkzeug ==3.0.1
  • yarl ==1.9.4
  • zipp ==3.17.0
PW_FT_detection/requirements.txt pypi
  • PytorchWildlife *
  • munch *
  • ultralytics *
  • wget *
PW_FT_classification/environment.yaml conda
  • _libgcc_mutex 0.1
  • _openmp_mutex 4.5
  • bzip2 1.0.8
  • ca-certificates 2023.11.17
  • ld_impl_linux-64 2.40
  • libffi 3.4.2
  • libgcc-ng 13.2.0
  • libgomp 13.2.0
  • libnsl 2.0.1
  • libsqlite 3.44.2
  • libuuid 2.38.1
  • libxcrypt 4.4.36
  • libzlib 1.2.13
  • ncurses 6.4
  • openssl 3.2.0
  • pip 23.3.2
  • python 3.8.18
  • readline 8.2
  • setuptools 69.0.3
  • tk 8.6.13
  • wheel 0.42.0
  • xz 5.2.6
PW_FT_detection/environment.yaml pypi
  • absl-py ==2.1.0
  • aiofiles ==23.2.1
  • annotated-types ==0.7.0
  • antlr4-python3-runtime ==4.9.3
  • anyio ==4.6.0
  • appdirs ==1.4.4
  • asttokens ==2.4.1
  • attrs ==24.2.0
  • certifi ==2024.8.30
  • cffi ==1.17.1
  • chardet ==5.2.0
  • charset-normalizer ==3.3.2
  • click ==8.1.7
  • contourpy ==1.3.0
  • crowsetta ==5.1.0
  • cycler ==0.12.1
  • decorator ==5.1.1
  • defusedxml ==0.7.1
  • exceptiongroup ==1.2.2
  • executing ==2.1.0
  • fastapi ==0.115.0
  • ffmpy ==0.4.0
  • filelock ==3.16.1
  • fire ==0.6.0
  • fonttools ==4.54.0
  • fsspec ==2024.9.0
  • gradio ==4.44.0
  • gradio-client ==1.3.0
  • grpcio ==1.66.1
  • h11 ==0.14.0
  • httpcore ==1.0.5
  • httpx ==0.27.2
  • huggingface-hub ==0.25.1
  • idna ==3.10
  • importlib-resources ==6.4.5
  • ipython ==8.27.0
  • jedi ==0.19.1
  • jinja2 ==3.1.4
  • joblib ==1.4.2
  • kiwisolver ==1.4.7
  • markdown ==3.7
  • markdown-it-py ==3.0.0
  • markupsafe ==2.1.5
  • matplotlib ==3.9.2
  • matplotlib-inline ==0.1.7
  • mdurl ==0.1.2
  • mpmath ==1.3.0
  • multimethod ==1.12
  • munch ==4.0.0
  • mypy-extensions ==1.0.0
  • networkx ==3.3
  • numpy ==1.26.4
  • nvidia-cublas-cu12 ==12.1.3.1
  • nvidia-cuda-cupti-cu12 ==12.1.105
  • nvidia-cuda-nvrtc-cu12 ==12.1.105
  • nvidia-cuda-runtime-cu12 ==12.1.105
  • nvidia-cudnn-cu12 ==9.1.0.70
  • nvidia-cufft-cu12 ==11.0.2.54
  • nvidia-curand-cu12 ==10.3.2.106
  • nvidia-cusolver-cu12 ==11.4.5.107
  • nvidia-cusparse-cu12 ==12.1.0.106
  • nvidia-nccl-cu12 ==2.20.5
  • nvidia-nvjitlink-cu12 ==12.6.68
  • nvidia-nvtx-cu12 ==12.1.105
  • omegaconf ==2.3.0
  • opencv-python ==4.10.0.84
  • opencv-python-headless ==4.10.0.84
  • orjson ==3.10.7
  • packaging ==24.1
  • pandas ==2.2.3
  • pandera ==0.21.0
  • parso ==0.8.4
  • pexpect ==4.9.0
  • pillow ==10.4.0
  • prompt-toolkit ==3.0.47
  • protobuf ==3.20.1
  • psutil ==6.0.0
  • ptyprocess ==0.7.0
  • pure-eval ==0.2.3
  • py-cpuinfo ==9.0.0
  • pycparser ==2.22
  • pydantic ==2.9.2
  • pydantic-core ==2.23.4
  • pydub ==0.25.1
  • pygments ==2.18.0
  • pyparsing ==3.1.4
  • python-dateutil ==2.9.0.post0
  • python-multipart ==0.0.10
  • pytorchwildlife *
  • pytz ==2024.2
  • pyyaml ==6.0.2
  • requests ==2.32.3
  • rich ==13.8.1
  • ruff ==0.6.7
  • scikit-learn ==1.6.0
  • scipy ==1.14.1
  • seaborn ==0.13.2
  • semantic-version ==2.10.0
  • setuptools ==75.6.0
  • shellingham ==1.5.4
  • six ==1.16.0
  • sniffio ==1.3.1
  • soundfile ==0.12.1
  • stack-data ==0.6.3
  • starlette ==0.38.6
  • supervision ==0.23.0
  • sympy ==1.13.3
  • tensorboard ==2.17.1
  • tensorboard-data-server ==0.7.2
  • termcolor ==2.4.0
  • thop ==0.1.1
  • threadpoolctl ==3.5.0
  • tomlkit ==0.12.0
  • torch ==2.4.1
  • torchaudio ==2.4.1
  • torchvision ==0.19.1
  • tqdm ==4.66.5
  • traitlets ==5.14.3
  • triton ==3.0.0
  • typeguard ==4.4.1
  • typer ==0.12.5
  • typing-extensions ==4.12.2
  • typing-inspect ==0.9.0
  • tzdata ==2024.2
  • ultralytics ==8.2.100
  • ultralytics-thop ==2.0.8
  • ultralytics-yolov5 ==0.1.1
  • urllib3 ==2.2.3
  • uvicorn ==0.30.6
  • wcwidth ==0.2.13
  • websockets ==12.0
  • werkzeug ==3.0.4
  • wget ==3.2
  • wrapt ==1.17.0
requirements.txt pypi
  • Pillow *
  • chardet *
  • gradio *
  • mkdocs *
  • mkdocs-get-deps *
  • mkdocs-material *
  • mkdocs-material-extensions *
  • mkdocstrings *
  • mkdocstrings-python *
  • pymdown-extensions *
  • scikit-learn *
  • setuptools *
  • supervision ==0.23.0
  • timm *
  • torch *
  • torchaudio *
  • torchvision *
  • tqdm *
  • ultralytics *
  • wget *
  • yolov5 *
setup.py pypi
  • Pillow *
  • chardet *
  • gradio *
  • scikit-learn *
  • setuptools *
  • supervision ==0.23.0
  • timm *
  • torch *
  • torchaudio *
  • torchvision *
  • tqdm *
  • ultralytics *
  • wget *
  • yolov5 *

Score: 18.307070918329128