Merge branch 'release-0.10.0' of github.com:blakeblackshear/frigate into always-show-recording-link

This commit is contained in:
Nick Mowen 2022-02-11 15:49:26 -07:00
commit a0b7fd3fc4
4 changed files with 11 additions and 7 deletions

View File

@ -162,8 +162,8 @@ detect:
# Optional: Frequency for running detection on stationary objects (default: shown below)
# When set to 0, object detection will never be run on stationary objects. If set to 10, it will be run on every 10th frame.
stationary_interval: 0
# Optional: Number of frames without a position change for an object to be considered stationary (default: shown below)
stationary_threshold: 10
# Optional: Number of frames without a position change for an object to be considered stationary (default: 10x the frame rate or 10s)
stationary_threshold: 50
# Optional: Object configuration
# NOTE: Can be overridden at the camera level

View File

@ -178,7 +178,6 @@ class DetectConfig(FrigateBaseModel):
ge=0,
)
stationary_threshold: Optional[int] = Field(
default=10,
title="Number of frames without a position change for an object to be considered stationary",
ge=1,
)
@ -771,6 +770,11 @@ class FrigateConfig(FrigateBaseModel):
if camera_config.detect.max_disappeared is None:
camera_config.detect.max_disappeared = max_disappeared
# Default stationary_threshold configuration
stationary_threshold = camera_config.detect.fps * 10
if camera_config.detect.stationary_threshold is None:
camera_config.detect.stationary_threshold = stationary_threshold
# FFMPEG input substitution
for input in camera_config.ffmpeg.inputs:
input.path = input.path.format(**FRIGATE_ENV_VARS)

View File

@ -78,9 +78,9 @@ class ObjectTracker:
}
return False
# if there are less than stationary_threshold entries for the position, add the bounding box
# if there are less than 10 entries for the position, add the bounding box
# and recompute the position box
if len(position["xmins"]) < self.detect_config.stationary_threshold:
if len(position["xmins"]) < 10:
position["xmins"].append(xmin)
position["ymins"].append(ymin)
position["xmaxs"].append(xmax)

View File

@ -507,8 +507,8 @@ def process_frames(
stationary_object_ids = [
obj["id"]
for obj in object_tracker.tracked_objects.values()
# if there hasn't been motion for N frames
if obj["motionless_count"] >= detect_config.stationary_threshold
# if there hasn't been motion for 10 frames
if obj["motionless_count"] >= 10
# and it isn't due for a periodic check
and (
detect_config.stationary_interval == 0