Skip to content

Commit

Permalink
Recover max frames to run inference (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfmig committed Nov 12, 2024
1 parent e371bf9 commit 585e445
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crabs/tracker/track_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 585e445

Please sign in to comment.