mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-08 20:25:26 +03:00
Only include true positives
This commit is contained in:
parent
a812ef8cf8
commit
b6b8c470be
@ -147,14 +147,7 @@ class ReviewSegmentMaintainer(threading.Thread):
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Validate if existing review segment should continue."""
|
"""Validate if existing review segment should continue."""
|
||||||
camera_config = self.config.cameras[segment.camera]
|
camera_config = self.config.cameras[segment.camera]
|
||||||
|
active_objects = get_active_objects(frame_time, camera_config, objects)
|
||||||
# get objects that are not stationary and detected in this frame
|
|
||||||
active_objects = [
|
|
||||||
o
|
|
||||||
for o in objects
|
|
||||||
if o["motionless_count"] < camera_config.detect.stationary.threshold
|
|
||||||
and o["frame_time"] == frame_time
|
|
||||||
]
|
|
||||||
|
|
||||||
if len(active_objects) > 0:
|
if len(active_objects) > 0:
|
||||||
segment.last_update = frame_time
|
segment.last_update = frame_time
|
||||||
@ -208,12 +201,7 @@ class ReviewSegmentMaintainer(threading.Thread):
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Check if a new review segment should be created."""
|
"""Check if a new review segment should be created."""
|
||||||
camera_config = self.config.cameras[camera]
|
camera_config = self.config.cameras[camera]
|
||||||
active_objects = [
|
active_objects = get_active_objects(frame_time, camera_config, objects)
|
||||||
o
|
|
||||||
for o in objects
|
|
||||||
if o["motionless_count"] < camera_config.detect.stationary.threshold
|
|
||||||
and o["frame_time"] == frame_time
|
|
||||||
]
|
|
||||||
|
|
||||||
if len(active_objects) > 0:
|
if len(active_objects) > 0:
|
||||||
has_sig_object = False
|
has_sig_object = False
|
||||||
@ -313,3 +301,16 @@ class ReviewSegmentMaintainer(threading.Thread):
|
|||||||
SeverityEnum.detection,
|
SeverityEnum.detection,
|
||||||
audio=set(audio_detections),
|
audio=set(audio_detections),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def get_active_objects(
|
||||||
|
frame_time: float, camera_config: CameraConfig, all_objects: list[TrackedObject]
|
||||||
|
) -> list[TrackedObject]:
|
||||||
|
"""get active objects for detection."""
|
||||||
|
return [
|
||||||
|
o
|
||||||
|
for o in all_objects
|
||||||
|
if o["motionless_count"] < camera_config.detect.stationary.threshold
|
||||||
|
and o["frame_time"] == frame_time
|
||||||
|
and not o["false_positive"]
|
||||||
|
]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user