From 585e445b80072239ffb5d021a9d667c18a48cff5 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 81ad2cef..7ffeb7d0 100644 --- a/crabs/tracker/track_video.py +++ b/crabs/tracker/track_video.py @@ -232,6 +232,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: