@@ -50,15 +50,12 @@ def run_pytorch_test(video_file: str, display: bool = False):
5050 f"Failed to export { TORCH_CONFIG ['super_animal' ]} model"
5151 )
5252 if TORCH_CONFIG ["checkpoint" ].stat ().st_size == 0 :
53- raise ValueError (
54- f"Exported { TORCH_CONFIG ['super_animal' ]} model is empty"
55- )
53+ raise ValueError (f"Exported { TORCH_CONFIG ['super_animal' ]} model is empty" )
5654 benchmark_videos (
5755 model_path = str (TORCH_CONFIG ["checkpoint" ]),
5856 model_type = "pytorch" ,
5957 video_path = video_file ,
6058 display = display ,
61- # resize=0.5,
6259 pcutoff = 0.25 ,
6360 pixels = 1000 ,
6461 )
@@ -88,15 +85,14 @@ def run_tensorflow_test(video_file: str, display: bool = False):
8885 model_type = "base" ,
8986 video_path = video_file ,
9087 display = display ,
91- # resize=0.5,
9288 pcutoff = 0.25 ,
9389 pixels = 1000 ,
9490 )
9591
9692
9793def main ():
9894 backend_results = {}
99-
95+
10096 parser = argparse .ArgumentParser (
10197 description = "Test DLC-Live installation by downloading and evaluating a demo DLC project!"
10298 )
@@ -164,9 +160,11 @@ def main():
164160 )
165161 except Exception as e :
166162 backend_name = (
167- "pytorch" if backend == Engine .PYTORCH else
168- "tensorflow" if backend == Engine .TENSORFLOW else
169- str (backend )
163+ "pytorch"
164+ if backend == Engine .PYTORCH
165+ else "tensorflow"
166+ if backend == Engine .TENSORFLOW
167+ else str (backend )
170168 )
171169 backend_results [backend_name ] = ("ERROR" , str (e ))
172170 backend_failures [backend ] = e
@@ -191,7 +189,6 @@ def main():
191189 )
192190 raise RuntimeError (f"All backend tests failed. Details: { failure_messages } " )
193191
194-
195192 finally :
196193 # deleting temporary files
197194 print ("\n Deleting temporary files...\n " )
@@ -204,7 +201,6 @@ def main():
204201 )
205202
206203
207-
208204if __name__ == "__main__" :
209205 # Get available backends (emits a warning if neither TensorFlow nor PyTorch is installed)
210206 available_backends : list [Engine ] = get_available_backends ()
0 commit comments