SuperAnimal Model Updates by n-poulsen · Pull Request #29 · DeepLabCut/DLClibrary

SuperAnimal Model Updates

This pull requests adds the first SuperAnimal-Bird models to dlclibrary, and refactors the DeepLabCut 3.0 SuperAnimal models so that object detectors and pose models can be downloaded independently.

Things to do before the pull request is merged

  • Add the SuperAnimal-Bird models to HuggingFace
  • Update the SuperAnimal-Quadruped models
  • Update the SuperAnimal-TopViewMouse models

SuperBird Models

An SSDLite object detector and ResNet50 pose model are added for the SuperAnimal-bird dataset.

Model URL Refactor

PyTorch models are moved to a modelzoo_urls_pytorch.yaml file, where snapshots are organized by dataset and task (detectors/ pose_models). This makes it easier to track which models are available with which engine.

New API Methods

Two new API methods are added to make it easier for users to know which detectors and pose models are available for a SuperAnimal:

def get_available_detectors(dataset: str) -> list[str]:
    """ Only for PyTorch models.
    Returns:
        The detectors available for the dataset.
    """
    ...

def get_available_models(dataset: str) -> list[str]:
    """ Only for PyTorch models.
    Returns:
        The pose models available for the dataset.
    """
    ...

Example use:

>>> import dlclibrary
>>> dlclibrary.get_available_detectors("superanimal_bird")
['fasterrcnn_mobilenet_v3_large_fpn', 'ssdlite']

>>> dlclibrary.get_available_models("superanimal_bird")
['resnet_50']