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 diff --git a/dlclive/check_install/check_install.py b/dlclive/check_install/check_install.py index 7601533..031d913 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 @@ -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