Skip to content

Commit 0d6b2d5

Browse files
committed
WIP refactor benchmarking: warning
1 parent e86db2d commit 0d6b2d5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

dlclive/benchmark_pytorch.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import subprocess
44
import sys
55
import time
6+
import warnings
67

78
import colorcet as cc
89
import cv2
@@ -218,6 +219,12 @@ def benchmark(
218219
for i in iterator:
219220
ret, frame = cap.read()
220221
if not ret:
222+
warnings.warn(
223+
(
224+
"Did not complete {:d} frames. "
225+
"There probably were not enough frames in the video {}."
226+
).format(n_frames, video_path)
227+
)
221228
break
222229

223230
start_time = time.perf_counter()

0 commit comments

Comments
 (0)