From 8e4701b78443ece464a15fa7659f16298c25ed01 Mon Sep 17 00:00:00 2001 From: Mackenzie Mathis Date: Sat, 14 Jun 2025 16:10:21 +0200 Subject: [PATCH 1/4] Update README.md fix test instructions --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 311d22c..fc95f8d 100644 --- a/README.md +++ b/README.md @@ -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. DLC LIVE TEST From a55f922ba79b16c8a86ce15ba9e235890ee7bc41 Mon Sep 17 00:00:00 2001 From: Mackenzie Mathis Date: Sat, 14 Jun 2025 16:15:48 +0200 Subject: [PATCH 2/4] Update check_install.py --- dlclive/check_install/check_install.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlclive/check_install/check_install.py b/dlclive/check_install/check_install.py index 7601533..f9f8ad7 100755 --- a/dlclive/check_install/check_install.py +++ b/dlclive/check_install/check_install.py @@ -53,14 +53,14 @@ def main(): # 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" + 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) # 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 From 0ce7c78583351c81d424da2d6fe1ae696134dd02 Mon Sep 17 00:00:00 2001 From: Mackenzie Mathis Date: Sat, 14 Jun 2025 16:20:51 +0200 Subject: [PATCH 3/4] Update check_install.py --- dlclive/check_install/check_install.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dlclive/check_install/check_install.py b/dlclive/check_install/check_install.py index f9f8ad7..d65390b 100755 --- a/dlclive/check_install/check_install.py +++ b/dlclive/check_install/check_install.py @@ -5,7 +5,8 @@ Licensed under GNU Lesser General Public License v3.0 """ - +import os +import urllib.request import sys import shutil import warnings @@ -51,10 +52,12 @@ def main(): 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/main/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(): From 7a25eb9422a11cb49a096f544dda148d58649cc6 Mon Sep 17 00:00:00 2001 From: Mackenzie Mathis Date: Sat, 14 Jun 2025 16:26:35 +0200 Subject: [PATCH 4/4] Update check_install.py --- dlclive/check_install/check_install.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dlclive/check_install/check_install.py b/dlclive/check_install/check_install.py index d65390b..031d913 100755 --- a/dlclive/check_install/check_install.py +++ b/dlclive/check_install/check_install.py @@ -42,11 +42,10 @@ 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'