Skip to content

Commit 88038ac

Browse files
authored
Update README & benchmarking script (#126)
* Update README.md fix test instructions * Update check_install.py * Update check_install.py * Update check_install.py
1 parent 4004ef9 commit 88038ac

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

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)