Skip to content

Commit be7e576

Browse files
authored
Merge branch 'main' into type-hints
2 parents 58a4611 + a74101f commit be7e576

File tree

5 files changed

+886
-2454
lines changed

5 files changed

+886
-2454
lines changed

.github/workflows/testing.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
os: [ubuntu-latest, macos-latest, windows-latest]
17-
python-version: ["3.12", "3.13"]
16+
os: [ubuntu-latest, macos-latest] #windows-latest
17+
python-version: ["3.9", "3.10"] #3.11+ issues with TF
18+
exclude:
19+
- os: macos-latest
20+
python-version: "3.9"
1821
include:
1922
- os: ubuntu-latest
2023
path: ~/.cache/pip
2124
- os: macos-latest
2225
path: ~/Library/Caches/pip
23-
- os: windows-latest
24-
path: ~\AppData\Local\pip\Cache
2526

2627
steps:
2728
- name: Checkout code
@@ -55,8 +56,19 @@ jobs:
5556
shell: bash -el {0} # Important: activates the conda environment
5657
run: |
5758
conda install pytables==3.8.0 "numpy<2"
58-
- name: Install and test
59-
run: |
60-
python -m pip install --upgrade pip wheel poetry
61-
python -m poetry install
62-
python -m poetry run dlc-live-test --nodisplay
59+
60+
- name: Install dependencies via Conda
61+
shell: bash -el {0}
62+
run: conda install -y "numpy>=1.26,<2.0"
63+
64+
- name: Install Poetry
65+
run: pip install --upgrade pip wheel poetry
66+
67+
- name: Regenerate Poetry lock
68+
run: poetry lock --no-cache
69+
70+
- name: Install project dependencies
71+
run: poetry install --no-root
72+
73+
- name: Run DLC Live Tests
74+
run: poetry run dlc-live-test --nodisplay

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,17 @@ For more details and examples, see documentation [here](dlclive/processor/README
4141
Please see our instruction manual to install on a [Windows or Linux machine](docs/install_desktop.md) or on a [NVIDIA Jetson Development Board](docs/install_jetson.md). Note, this code works with tensorflow (TF) 1 or TF 2 models, but TF requires that whatever version you exported your model with, you must import with the same version (i.e., export with TF1.13, then use TF1.13 with DlC-Live; export with TF2.3, then use TF2.3 with DLC-live).
4242

4343
- available on pypi as: `pip install deeplabcut-live`
44+
4445

45-
Note, you can then test your installation by running:
46+
Note, you can then test your installation by installing poetry (`pip install poetry`), then running:
4647

47-
`dlc-live-test`
4848

49-
If installed properly, this script will i) create a temporary folder ii) download the full_dog model from the [DeepLabCut Model Zoo](http://www.mousemotorlab.org/dlc-modelzoo), iii) download a short video clip of a dog, and iv) run inference while displaying keypoints. v) remove the temporary folder.
49+
50+
```python
51+
poetry run dlc-live-test
52+
```
53+
54+
If installed properly, this script will i) create a temporary folder ii) download the SuperAnimal-Quadruped model from the [DeepLabCut Model Zoo](http://www.mousemotorlab.org/dlc-modelzoo), iii) download a short video clip of a dog, and iv) run inference while displaying keypoints. v) remove the temporary folder.
5055

5156
<img src="https://images.squarespace-cdn.com/content/v1/57f6d51c9f74566f55ecf271/1606081086014-TG9GWH63ZGGOO7K779G3/ke17ZwdGBToddI8pDm48kHiSoSToKfKUI9t99vKErWoUqsxRUqqbr1mOJYKfIPR7LoDQ9mXPOjoJoqy81S2I8N_N4V1vUb5AoIIIbLZhVYxCRW4BPu10St3TBAUQYVKcOoIGycwr1shdgJWzLuxyzjLbSRGBFFxjYMBr42yCvRK5HHsLZWtMlAHzDU294nCd/dlclivetest.png?format=1000w" width="650" title="DLC-live-test" alt="DLC LIVE TEST" align="center" vspace = "50">
5257

dlclive/check_install/check_install.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
Licensed under GNU Lesser General Public License v3.0
66
"""
77

8-
8+
import os
9+
import urllib.request
910
import sys
1011
import shutil
1112
import warnings
@@ -41,26 +42,27 @@ def main():
4142
if not display:
4243
print('Running without displaying video')
4344

44-
# make temporary directory in $HOME
45-
# TODO: why create this temp directory in $HOME?
45+
# make temporary directory in $current
4646
print("\nCreating temporary directory...\n")
47-
tmp_dir = Path().home() / 'dlc-live-tmp'
48-
tmp_dir.mkdir(mode=0o775,exist_ok=True)
47+
tmp_dir = Path.cwd() / 'dlc-live-tmp'
48+
tmp_dir.mkdir(mode=0o775, exist_ok=True)
4949

5050
video_file = str(tmp_dir / 'dog_clip.avi')
5151
model_dir = tmp_dir / 'DLC_Dog_resnet_50_iteration-0_shuffle-0'
5252

5353
# download dog test video from github:
54-
# TODO: Should check if the video's already there before downloading it (should have been cloned with the files)
55-
print(f"Downloading Video to {video_file}")
56-
url_link = "https://github.com/DeepLabCut/DeepLabCut-live/blob/master/check_install/dog_clip.avi?raw=True"
57-
urllib.request.urlretrieve(url_link, video_file, reporthook=urllib_pbar)
54+
if not os.path.exists(video_file):
55+
print(f"Downloading Video to {video_file}")
56+
url_link = "https://github.com/DeepLabCut/DeepLabCut-live/blob/main/check_install/dog_clip.avi?raw=True"
57+
urllib.request.urlretrieve(url_link, video_file, reporthook=urllib_pbar)
58+
else:
59+
print(f"Video already exists at {video_file}")
5860

5961
# download model from the DeepLabCut Model Zoo
6062
if Path(model_dir / SNAPSHOT_NAME).exists():
6163
print('Model already downloaded, using cached version')
6264
else:
63-
print("Downloading full_dog model from the DeepLabCut Model Zoo...")
65+
print("Downloading a test model from the DeepLabCut Model Zoo...")
6466
download_huggingface_model(MODEL_NAME, model_dir)
6567

6668
# assert these things exist so we can give informative error messages

0 commit comments

Comments
 (0)