Skip to content

Commit 2a4f4af

Browse files
committed
Merge branch 'main' into maxim/dlclive3
2 parents f8fb374 + a74101f commit 2a4f4af

File tree

6 files changed

+3043
-18
lines changed

6 files changed

+3043
-18
lines changed

.github/workflows/python-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ name: Python package
44

55
on:
66
push:
7-
branches: [ master ]
7+
branches: [ main ]
88
pull_request:
9-
branches: [ master ]
9+
branches: [ main ]
1010

1111

1212
jobs:

.github/workflows/testing.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Run Tests
22

33
on:
44
push:
5-
branches: [master]
5+
branches: [main]
66
pull_request:
7-
branches: [master]
7+
branches: [main]
88

99
jobs:
1010
build:
@@ -14,7 +14,7 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
os: [ubuntu-latest, macos-latest, windows-latest]
17-
python-version: ["3.10"]
17+
python-version: ["3.9", "3.10"]
1818
include:
1919
- os: ubuntu-latest
2020
path: ~/.cache/pip
@@ -31,6 +31,14 @@ jobs:
3131
uses: actions/setup-python@v4
3232
with:
3333
python-version: ${{ matrix.python-version }}
34+
35+
- name: Set up Python
36+
uses: conda-incubator/setup-miniconda@v3
37+
with:
38+
channels: conda-forge,defaults
39+
channel-priority: strict
40+
python-version: ${{ matrix.python-version }}
41+
3442
- name: Install ffmpeg
3543
run: |
3644
if [ "$RUNNER_OS" == "Linux" ]; then
@@ -42,7 +50,9 @@ jobs:
4250
choco install ffmpeg
4351
fi
4452
shell: bash
45-
- name: Install and test
53+
54+
- name: Install PyTables through Conda
55+
shell: bash -el {0} # Important: activates the conda environment
4656
run: |
4757
python -m pip install --upgrade pip wheel poetry
4858
python -m poetry install --extras "tf"

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,13 @@ same version (i.e., export a PyTorch model, then install PyTorch, export with TF
7373
then use TF1.13 with DlC-Live; export with TF2.3, then use TF2.3 with DLC-live).
7474

7575
- available on pypi as: `pip install deeplabcut-live`
76+
7677

77-
Note, you can then test your installation by running:
78+
Note, you can then test your installation by installing poetry (`pip install poetry`), then running:
7879

79-
`dlc-live-test`
80+
```python
81+
poetry run dlc-live-test
82+
```
8083

8184
If installed properly, this script will i) create a temporary folder ii) download the
8285
full_dog model from the [DeepLabCut Model Zoo](

dlclive/check_install/check_install.py

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

8+
import os
9+
import urllib.request
810
import argparse
911
import shutil
1012
import sys
@@ -43,8 +45,7 @@ def main():
4345
if not display:
4446
print("Running without displaying video")
4547

46-
# make temporary directory in $HOME
47-
# TODO: why create this temp directory in $HOME?
48+
# make temporary directory in $current
4849
print("\nCreating temporary directory...\n")
4950
tmp_dir = Path().home() / "dlc-live-tmp"
5051
tmp_dir.mkdir(mode=0o775, exist_ok=True)
@@ -53,16 +54,18 @@ def main():
5354
model_dir = tmp_dir / "DLC_Dog_resnet_50_iteration-0_shuffle-0"
5455

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

6164
# download model from the DeepLabCut Model Zoo
6265
if Path(model_dir / SNAPSHOT_NAME).exists():
6366
print("Model already downloaded, using cached version")
6467
else:
65-
print("Downloading full_dog model from the DeepLabCut Model Zoo...")
68+
print("Downloading a test model from the DeepLabCut Model Zoo...")
6669
download_huggingface_model(MODEL_NAME, model_dir)
6770

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

0 commit comments

Comments
 (0)