@@ -36,11 +36,15 @@ download_huggingface_model("superanimal_quadruped", model_dir)
3636```
3737
3838PyTorch models available for a given dataset (compatible with DeepLabCut>=3.0) can be
39- listed using the ` dlclibrary.get_available_detectors ` and
40- ` dlclibrary.get_available_models ` methods. Example use:
39+ listed using the ` dlclibrary.get_available_detectors ` and
40+ ` dlclibrary.get_available_models ` methods. The datasets for which models are available
41+ can be listed using ` dlclibrary.get_available_datasets ` . Example use:
4142
4243``` python
4344>> > import dlclibrary
45+ >> > dlclibrary.get_available_datasets()
46+ [' superanimal_bird' , ' superanimal_topviewmouse' , ' superanimal_quadruped' ]
47+
4448>> > dlclibrary.get_available_detectors(" superanimal_bird" )
4549[' fasterrcnn_mobilenet_v3_large_fpn' , ' ssdlite' ]
4650
@@ -51,6 +55,8 @@ listed using the `dlclibrary.get_available_detectors` and
5155
5256## How to add a new model?
5357
58+ ### TensorFlow models
59+
5460Pick a good model_name. Follow the (novel) naming convention (modeltype_species), e.g. ``` superanimal_topviewmouse ``` .
5561
56621 . Add the model_name with path and commit ID to: https://github.com/DeepLabCut/DLClibrary/blob/main/dlclibrary/dlcmodelzoo/modelzoo_urls.yaml
@@ -59,3 +65,31 @@ Pick a good model_name. Follow the (novel) naming convention (modeltype_species)
5965https://github.com/DeepLabCut/DLClibrary/blob/main/dlclibrary/dlcmodelzoo/modelzoo_download.py#L15
6066
61673 . For superanimal models also fill in the configs!
68+
69+ ### PyTorch models (for ` deeplabcut >= 3.0.0 ` )
70+
71+ PyTorch models are listed in [ ` dlclibrary/dlcmodelzoo/modelzoo_urls_pytorch.yaml ` ] (
72+ https://github.com/DeepLabCut/DLClibrary/blob/main/dlclibrary/dlcmodelzoo/modelzoo_urls_pytorch.yaml
73+ ). The file is organized as:
74+
75+ ``` yaml
76+ my_cool_dataset : # name of the dataset used to train the model
77+ detectors :
78+ detector_name : path/to/huggingface-detector.pt # add detectors under `detector`
79+ pose_models :
80+ pose_model_name : path/to/huggingface-pose-model.pt # add pose models under `pose_models`
81+ other_pose_model_name : path/to/huggingface-other-pose-model.pt
82+ ` ` `
83+
84+ This will allow users to download the models using the format ` datatsetName_modelName`,
85+ i.e. for this example 3 models would be available : ` my_cool_dataset_detector_name` ,
86+ ` my_cool_dataset_pose_model_name` and `my_cool_dataset_other_pose_model_name`.
87+
88+ To add a new model for `deeplabcut >= 3.0.0`, simply :
89+
90+ - add a new line under detectors or pose models if the dataset is already defined
91+ - add the structure if the model was trained on a new dataset
92+
93+ The models will then be listed when calling `dlclibrary.get_available_detectors` or
94+ ` dlclibrary.get_available_models` ! You can list the datasets for which models are
95+ available using `dlclibrary.get_available_datasets`.
0 commit comments