Skip to content

microsoft/CameraTraps

Repository files navigation

image

A Collaborative Deep Learning Framework for Conservation



📣 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

animal_det_1
Credits to Universidad de los Andes, Colombia.

Image classification with MegaDetector and AI4GAmazonRainforest

animal_clas_1
Credits to Universidad de los Andes, Colombia.

Opossum ID with MegaDetector and AI4GOpossum

opossum_det
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!

👉 Full list of organizations

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: