File tree Expand file tree Collapse file tree 6 files changed +50
-6
lines changed
Expand file tree Collapse file tree 6 files changed +50
-6
lines changed Original file line number Diff line number Diff line change 1+ name : Test suite
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+
7+ jobs :
8+ build :
9+ runs-on : ${{ matrix.os }}
10+
11+ strategy :
12+ fail-fast : true
13+ matrix :
14+ os : [ubuntu-latest, macos-11, windows-latest]
15+ python-version : [3.9]
16+
17+ steps :
18+ - name : Checkout code
19+ uses : actions/checkout@v3
20+ - name : Set up Python ${{ matrix.python-version }}
21+ uses : actions/setup-python@v4
22+ with :
23+ python-version : ${{ matrix.python-version }}
24+
25+ - name : Install dependencies
26+ run : |
27+ python -m pip install --upgrade pip
28+ pip install pytest
29+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
30+
31+ - name : Run pytest tests
32+ run : |
33+ pytest
Original file line number Diff line number Diff line change @@ -130,3 +130,4 @@ dmypy.json
130130.pyre /
131131
132132* DS_STORE
133+ .vscode /*
Original file line number Diff line number Diff line change 1212
1313
1414# Model Zoo from HuggingFace
15- full_human : mwmathis/DeepLabCutModelZoo-DLC_human_fullbody_resnet_101/DLC_human_fullbody_resnet_101 .tar.gz
16- full_human_commit : 7438131c2ee7754a9732bef6fbf46b8189a16c48
15+ full_human : mwmathis/DeepLabCutModelZoo-DLC_human_fullbody_resnet_101/DLC_human_dancing_resnet_101_iteration-0_shuffle-1 .tar.gz
16+ full_human_commit : 01acf989bfec7a25110b94677449d9e861b5ea81
1717full_cat : AlexEMG/DeepLabCutModelZoo-cat/DLC_Cat_resnet_50_iteration-0_shuffle-0.tar.gz
1818full_cat_commit : 972f82dc575c820ce556e140465495a32d18ee9b
1919full_dog : AlexEMG/DeepLabCutModelZoo-dog/DLC_Dog_resnet_50_iteration-0_shuffle-0.tar.gz
Original file line number Diff line number Diff line change 1+ huggingface_hub == 0.11.1
2+ ruamel.yaml == 0.17.21
Original file line number Diff line number Diff line change 2424 url = "https://github.com/DeepLabCut/DLClib" ,
2525 install_requires = [
2626 "huggingface_hub" ,
27+ "ruamel.yaml>=0.15.0" ,
2728 ],
2829 packages = setuptools .find_packages (),
2930 data_files = [
Original file line number Diff line number Diff line change 1111import dlclibrary
1212import os
1313import pytest
14+ from dlclibrary .dlcmodelzoo .modelzoo_download import MODELOPTIONS
1415
1516
16- def test_download_huggingface_model (tmp_path_factory ):
17- folder = tmp_path_factory .mktemp ("cat " )
18- dlclibrary .download_huggingface_model ("full_cat" , str (folder ))
17+ def test_download_huggingface_model (tmp_path_factory , model = "full_cat" ):
18+ folder = tmp_path_factory .mktemp ("temp " )
19+ dlclibrary .download_huggingface_model (model , str (folder ))
1920
2021 assert os .path .exists (folder / "pose_cfg.yaml" )
21- assert os . path . exists ( folder / "snapshot-75000.meta" )
22+ assert any ( f . startswith ( "snapshot-" ) for f in os . listdir ( folder ) )
2223 # Verify that the Hugging Face folder was removed
2324 assert not any (f .startswith ("models--" ) for f in os .listdir (folder ))
2425
2526
2627def test_download_huggingface_wrong_model ():
2728 with pytest .raises (ValueError ):
2829 dlclibrary .download_huggingface_model ("wrong_model_name" )
30+
31+
32+ @pytest .mark .skip
33+ @pytest .mark .parametrize ("model" , MODELOPTIONS )
34+ def test_download_all_models (tmp_path_factory , model ):
35+ test_download_huggingface_model (tmp_path_factory , model )
You can’t perform that action at this time.
0 commit comments