@@ -49,15 +49,12 @@ def run_pytorch_test(video_file: str, display: bool = False):
4949 f"Failed to export { TORCH_CONFIG ['super_animal' ]} model"
5050 )
5151 if TORCH_CONFIG ["checkpoint" ].stat ().st_size == 0 :
52- raise ValueError (
53- f"Exported { TORCH_CONFIG ['super_animal' ]} model is empty"
54- )
52+ raise ValueError (f"Exported { TORCH_CONFIG ['super_animal' ]} model is empty" )
5553 benchmark_videos (
5654 model_path = str (TORCH_CONFIG ["checkpoint" ]),
5755 model_type = "pytorch" ,
5856 video_path = video_file ,
5957 display = display ,
60- # resize=0.5,
6158 pcutoff = 0.25 ,
6259 pixels = 1000 ,
6360 )
@@ -87,15 +84,14 @@ def run_tensorflow_test(video_file: str, display: bool = False):
8784 model_type = "base" ,
8885 video_path = video_file ,
8986 display = display ,
90- # resize=0.5,
9187 pcutoff = 0.25 ,
9288 pixels = 1000 ,
9389 )
9490
9591
9692def main ():
9793 backend_results = {}
98-
94+
9995 parser = argparse .ArgumentParser (
10096 description = "Test DLC-Live installation by downloading and evaluating a demo DLC project!"
10197 )
@@ -163,9 +159,11 @@ def main():
163159 )
164160 except Exception as e :
165161 backend_name = (
166- "pytorch" if backend == Engine .PYTORCH else
167- "tensorflow" if backend == Engine .TENSORFLOW else
168- str (backend )
162+ "pytorch"
163+ if backend == Engine .PYTORCH
164+ else "tensorflow"
165+ if backend == Engine .TENSORFLOW
166+ else str (backend )
169167 )
170168 backend_results [backend_name ] = ("ERROR" , str (e ))
171169 backend_failures [backend ] = e
@@ -190,7 +188,6 @@ def main():
190188 )
191189 raise RuntimeError (f"All backend tests failed. Details: { failure_messages } " )
192190
193-
194191 finally :
195192 # deleting temporary files
196193 print ("\n Deleting temporary files...\n " )
@@ -203,7 +200,6 @@ def main():
203200 )
204201
205202
206-
207203if __name__ == "__main__" :
208204 # Get available backends (emits a warning if neither TensorFlow nor PyTorch is installed)
209205 available_backends : list [Engine ] = get_available_backends ()
0 commit comments