Skip to content

Commit

Permalink
ignore detections that don't overlap with motion
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeblackshear committed Feb 20, 2021
1 parent 9550ac7 commit e299e73
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frigate/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,12 @@ def process_frames(camera_name: str, frame_queue: mp.Queue, frame_shape, model_s
if refining:
refine_count += 1

# Limit to the detections overlapping with motion areas
# to avoid picking up stationary background objects
detections_with_motion = [d for d in detections if intersects_any(d[2], motion_boxes)]

# now that we have refined our detections, we need to track objects
object_tracker.match_and_update(frame_time, detections)
object_tracker.match_and_update(frame_time, detections_with_motion)

# add to the queue if not full
if(detected_objects_queue.full()):
Expand Down

0 comments on commit e299e73

Please sign in to comment.