From 0dd11ff0e0a917de63766e0a415064382ac4793e Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Tue, 12 Nov 2024 17:05:35 +0000 Subject: [PATCH] Recover max frames to run inference (WIP) --- crabs/tracker/track_video.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crabs/tracker/track_video.py b/crabs/tracker/track_video.py index 623f1435..b6e9bb1c 100644 --- a/crabs/tracker/track_video.py +++ b/crabs/tracker/track_video.py @@ -236,6 +236,13 @@ def core_detection_and_tracking(self): # Loop over frames frame_idx = 0 while input_video_object.isOpened(): + # Break if beyond end frame (mostly for debugging) + if ( + self.args.max_frames_to_read + and frame_idx + 1 > self.args.max_frames_to_read + ): + break + # Read frame ret, frame = input_video_object.read() if not ret: