Skip to content

Update README & benchmarking script #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,17 @@ For more details and examples, see documentation [here](dlclive/processor/README
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).

- available on pypi as: `pip install deeplabcut-live`


Note, you can then test your installation by running:
Note, you can then test your installation by installing poetry (`pip install poetry`), then running:

`dlc-live-test`

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.

```python
poetry run dlc-live-test
```

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.

<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">

Expand Down
22 changes: 12 additions & 10 deletions dlclive/check_install/check_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
Licensed under GNU Lesser General Public License v3.0
"""


import os
import urllib.request
import sys
import shutil
import warnings
Expand Down Expand Up @@ -41,26 +42,27 @@ def main():
if not display:
print('Running without displaying video')

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

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

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

# download model from the DeepLabCut Model Zoo
if Path(model_dir / SNAPSHOT_NAME).exists():
print('Model already downloaded, using cached version')
else:
print("Downloading full_dog model from the DeepLabCut Model Zoo...")
print("Downloading a test model from the DeepLabCut Model Zoo...")
download_huggingface_model(MODEL_NAME, model_dir)

# assert these things exist so we can give informative error messages
Expand Down
Loading