Skip to content

Pytorch-Wildlife v1.0

Compare
Choose a tag to compare
@zhmiao zhmiao released this 22 Nov 20:18
· 1997 commits to main since this release

Welcom to Pytorch-Wildlife v1.0

What is Pytorch-Wildife

The Pytorch-Wildlife library is a new AI Conservation platform that allows users to directly load the MegaDetector v5 model weights for animal detection. We've fully refactored our codebase, prioritizing ease of use in model deployment and expansion. In addition to MegaDetector v5, Pytorch-Wildlife also accommodates a range of classification weights, such as those derived from an Amazon Rainforest camera trap dataset and an Opossum classification dataset (more details of these datasets will be published soon).

Unlike previous implementations where the MegaDetector v5 model weights need to be manually downloaded, Pytorch-Wildlife automatically downloads all the model weights (including MegaDetector v5 and other classification model weights) the first time the models are loaded. This implementation uses an approach similar to the default Pytorch model loading method.

Please also explore the codebase and functionalities of Pytorch-Wildlife through our interactive Gradio interface and detailed Jupyter notebooks, designed to showcase the practical applications of our enhancements.

gradio_UI

Pytorch-Wildlife can be installed through:

pip install PytorchWildlife

More information can be found in our Installation guide and detailed library documentation.

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

import torch
from PytorchWildlife.models import detection as pw_detection
from PytorchWildlife.models import classification as pw_classification
img = torch.randn((3, 1280, 1280))
# Detection
detection_model = pw_detection.MegaDetectorV5()
detection_result = detection_model.single_image_detection(img)
#Classification
classification_model = pw_classification.AI4GAmazonRainforest()
classification_results = classification_model.single_image_classification(img)