{"id":18611736,"url":"https://github.com/deeplabcut/dlclibrary","last_synced_at":"2025-04-10T23:31:00.200Z","repository":{"id":64804483,"uuid":"467577150","full_name":"DeepLabCut/DLClibrary","owner":"DeepLabCut","description":"DLClibrary is a lightweight library supporting universal functions for the DeepLabCut ecosystem.","archived":false,"fork":false,"pushed_at":"2024-10-18T14:44:47.000Z","size":88,"stargazers_count":5,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T06:09:02.044Z","etag":null,"topics":["deeplabcut"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DeepLabCut.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-08T15:50:30.000Z","updated_at":"2024-10-18T14:44:52.000Z","dependencies_parsed_at":"2024-10-16T18:11:20.790Z","dependency_job_id":"2c6a53ec-7274-48e2-b4ed-cc1e403f6418","html_url":"https://github.com/DeepLabCut/DLClibrary","commit_stats":null,"previous_names":["deeplabcut/dlclib"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepLabCut%2FDLClibrary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepLabCut%2FDLClibrary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepLabCut%2FDLClibrary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepLabCut%2FDLClibrary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DeepLabCut","download_url":"https://codeload.github.com/DeepLabCut/DLClibrary/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248315952,"owners_count":21083351,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deeplabcut"],"created_at":"2024-11-07T03:14:41.492Z","updated_at":"2025-04-10T23:30:59.880Z","avatar_url":"https://github.com/DeepLabCut.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Generic badge](https://img.shields.io/badge/Contributions-Welcome-brightgreen.svg)](README.md)\n\u003ca href=\"https://github.com/psf/black\"\u003e\u003cimg alt=\"Code style: black\" src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"\u003e\u003c/a\u003e[![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0)\n\n# DLClibrary\n\nDLClibrary is a lightweight library supporting universal functions for the [DeepLabCut](https://github.com/DeepLabCut/DeepLabCut) ecosystem.\n\nSupported functions (at this point):\n\n- API for downloading model weights from [the model zoo](http://www.mackenziemathislab.org/dlc-modelzoo)\n\n# Quick start\n\n## Install\n\nThe package can be installed using `pip`:\n\n```bash\npip install dlclibrary\n```\n\n:warning: warning, the closely named package `dlclib` is not an official DeepLabCut product. :warning:\n\n## Example Usage\n\nDownloading a pretrained model from the model zoo:\n\n```python\nfrom pathlib import Path\nfrom dlclibrary import download_huggingface_model\n\n# Creates a folder and downloads the model to it\nmodel_dir = Path(\"./superanimal_quadruped_model\")\nmodel_dir.mkdir()\ndownload_huggingface_model(\"superanimal_quadruped\", model_dir)\n```\n\nPyTorch models available for a given dataset (compatible with DeepLabCut\u003e=3.0) can be \nlisted using the `dlclibrary.get_available_detectors` and \n`dlclibrary.get_available_models` methods. The datasets for which models are available\ncan be listed using `dlclibrary.get_available_datasets`. Example use:\n\n```python\n\u003e\u003e\u003e import dlclibrary\n\u003e\u003e\u003e dlclibrary.get_available_datasets()\n['superanimal_bird', 'superanimal_topviewmouse', 'superanimal_quadruped']\n\n\u003e\u003e\u003e dlclibrary.get_available_detectors(\"superanimal_bird\")\n['fasterrcnn_mobilenet_v3_large_fpn', 'ssdlite']\n\n\u003e\u003e\u003e dlclibrary.get_available_models(\"superanimal_bird\")\n['resnet_50']\n```\n\n\n## How to add a new model?\n\n### TensorFlow models\n\nPick a good model_name. Follow the (novel) naming convention (modeltype_species), e.g. ```superanimal_topviewmouse```.  \n\n1. Add the model_name with path and commit ID to: https://github.com/DeepLabCut/DLClibrary/blob/main/dlclibrary/dlcmodelzoo/modelzoo_urls.yaml\n\n2. Add the model name to the constant: MODELOPTIONS\nhttps://github.com/DeepLabCut/DLClibrary/blob/main/dlclibrary/dlcmodelzoo/modelzoo_download.py#L15\n\n3. For superanimal models also fill in the configs!\n\n### PyTorch models (for `deeplabcut \u003e= 3.0.0`)\n\nPyTorch models are listed in [`dlclibrary/dlcmodelzoo/modelzoo_urls_pytorch.yaml`](\nhttps://github.com/DeepLabCut/DLClibrary/blob/main/dlclibrary/dlcmodelzoo/modelzoo_urls_pytorch.yaml\n). The file is organized as:\n\n```yaml\nmy_cool_dataset:  # name of the dataset used to train the model\n  detectors:\n    detector_name: path/to/huggingface-detector.pt  # add detectors under `detector`\n  pose_models:\n    pose_model_name: path/to/huggingface-pose-model.pt  # add pose models under `pose_models`\n    other_pose_model_name: path/to/huggingface-other-pose-model.pt\n```\n\nThis will allow users to download the models using the format `datatsetName_modelName`,\ni.e. for this example 3 models would be available: `my_cool_dataset_detector_name`,\n`my_cool_dataset_pose_model_name` and `my_cool_dataset_other_pose_model_name`.\n\nTo add a new model for `deeplabcut \u003e= 3.0.0`, simply:\n\n- add a new line under detectors or pose models if the dataset is already defined\n- add the structure if the model was trained on a new dataset \n\nThe models will then be listed when calling `dlclibrary.get_available_detectors` or\n`dlclibrary.get_available_models`! You can list the datasets for which models are \navailable using `dlclibrary.get_available_datasets`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeeplabcut%2Fdlclibrary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeeplabcut%2Fdlclibrary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeeplabcut%2Fdlclibrary/lists"}