55Licensed under GNU Lesser General Public License v3.0
66"""
77
8+ import os
9+ import urllib .request
810import argparse
911import shutil
1012import sys
@@ -43,8 +45,7 @@ def main():
4345 if not display :
4446 print ("Running without displaying video" )
4547
46- # make temporary directory in $HOME
47- # TODO: why create this temp directory in $HOME?
48+ # make temporary directory in $current
4849 print ("\n Creating temporary directory...\n " )
4950 tmp_dir = Path ().home () / "dlc-live-tmp"
5051 tmp_dir .mkdir (mode = 0o775 , exist_ok = True )
@@ -53,16 +54,18 @@ def main():
5354 model_dir = tmp_dir / "DLC_Dog_resnet_50_iteration-0_shuffle-0"
5455
5556 # download dog test video from github:
56- # TODO: Should check if the video's already there before downloading it (should have been cloned with the files)
57- print (f"Downloading Video to { video_file } " )
58- url_link = "https://github.com/DeepLabCut/DeepLabCut-live/blob/master/check_install/dog_clip.avi?raw=True"
59- urllib .request .urlretrieve (url_link , video_file , reporthook = urllib_pbar )
57+ if not os .path .exists (video_file ):
58+ print (f"Downloading Video to { video_file } " )
59+ url_link = "https://github.com/DeepLabCut/DeepLabCut-live/blob/main/check_install/dog_clip.avi?raw=True"
60+ urllib .request .urlretrieve (url_link , video_file , reporthook = urllib_pbar )
61+ else :
62+ print (f"Video already exists at { video_file } " )
6063
6164 # download model from the DeepLabCut Model Zoo
6265 if Path (model_dir / SNAPSHOT_NAME ).exists ():
6366 print ("Model already downloaded, using cached version" )
6467 else :
65- print ("Downloading full_dog model from the DeepLabCut Model Zoo..." )
68+ print ("Downloading a test model from the DeepLabCut Model Zoo..." )
6669 download_huggingface_model (MODEL_NAME , model_dir )
6770
6871 # assert these things exist so we can give informative error messages
0 commit comments