Skip to content

Commit 5b9cbeb

Browse files
committed
fix: process video bug on unused else
The loop never uses break, so the else clause always executes. However, since it iterates over a generator, the generator is already exhausted after the first pass... so the else block would iterate over nothing. So, i believe the 'else' is redundant.
1 parent 171687f commit 5b9cbeb

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

supervision/utils/video.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,6 @@ def callback(scene: np.ndarray, index: int) -> np.ndarray:
249249
):
250250
result_frame = callback(frame, index)
251251
sink.write_frame(frame=result_frame)
252-
else:
253-
for index, frame in enumerate(video_frames_generator):
254-
result_frame = callback(frame, index)
255-
sink.write_frame(frame=result_frame)
256252

257253

258254
class FPSMonitor:

0 commit comments

Comments
 (0)