Skip to content

Commit 3660dcf

Browse files
committed
Benchmark pytorch: remove try-except block
This script will be used for both benchmarking and integration testing, therefore it needs to crash if inference isnt successful
1 parent a29415d commit 3660dcf

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

dlclive/benchmark_pytorch.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -220,16 +220,11 @@ def benchmark(
220220
if not ret:
221221
break
222222

223-
try:
224-
start_time = time.perf_counter()
225-
if frame_index == 0:
226-
pose = dlc_live.init_inference(frame) # Loads model
227-
else:
228-
pose = dlc_live.get_pose(frame)
229-
except Exception as e:
230-
print(f"Error analyzing frame {frame_index}: {e}")
231-
frame_index += 1
232-
continue
223+
start_time = time.perf_counter()
224+
if frame_index == 0:
225+
pose = dlc_live.init_inference(frame) # Loads model
226+
else:
227+
pose = dlc_live.get_pose(frame)
233228

234229
inf_time = time.perf_counter() - start_time
235230
poses.append({"frame": frame_index, "pose": pose})

0 commit comments

Comments
 (0)