Skip to content

Commit 0ce7c78

Browse files
authored
Update check_install.py
1 parent a55f922 commit 0ce7c78

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

dlclive/check_install/check_install.py

Lines changed: 8 additions & 5 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
@@ -51,10 +52,12 @@ def main():
5152
model_dir = tmp_dir / 'DLC_Dog_resnet_50_iteration-0_shuffle-0'
5253

5354
# 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/main/check_install/dog_clip.avi?raw=True"
57-
urllib.request.urlretrieve(url_link, video_file, reporthook=urllib_pbar)
55+
if not os.path.exists(video_file):
56+
print(f"Downloading Video to {video_file}")
57+
url_link = "https://github.com/DeepLabCut/DeepLabCut-live/blob/main/check_install/dog_clip.avi?raw=True"
58+
urllib.request.urlretrieve(url_link, video_file, reporthook=urllib_pbar)
59+
else:
60+
print(f"Video already exists at {video_file}")
5861

5962
# download model from the DeepLabCut Model Zoo
6063
if Path(model_dir / SNAPSHOT_NAME).exists():

0 commit comments

Comments
 (0)