mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-02 01:05:20 +03:00
Merge branch 'release-0.10.0' of github.com:blakeblackshear/frigate into always-show-recording-link
This commit is contained in:
commit
a0b7fd3fc4
@ -162,8 +162,8 @@ detect:
|
|||||||
# Optional: Frequency for running detection on stationary objects (default: shown below)
|
# 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.
|
# 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
|
stationary_interval: 0
|
||||||
# Optional: Number of frames without a position change for an object to be considered stationary (default: shown below)
|
# Optional: Number of frames without a position change for an object to be considered stationary (default: 10x the frame rate or 10s)
|
||||||
stationary_threshold: 10
|
stationary_threshold: 50
|
||||||
|
|
||||||
# Optional: Object configuration
|
# Optional: Object configuration
|
||||||
# NOTE: Can be overridden at the camera level
|
# NOTE: Can be overridden at the camera level
|
||||||
|
|||||||
@ -178,7 +178,6 @@ class DetectConfig(FrigateBaseModel):
|
|||||||
ge=0,
|
ge=0,
|
||||||
)
|
)
|
||||||
stationary_threshold: Optional[int] = Field(
|
stationary_threshold: Optional[int] = Field(
|
||||||
default=10,
|
|
||||||
title="Number of frames without a position change for an object to be considered stationary",
|
title="Number of frames without a position change for an object to be considered stationary",
|
||||||
ge=1,
|
ge=1,
|
||||||
)
|
)
|
||||||
@ -771,6 +770,11 @@ class FrigateConfig(FrigateBaseModel):
|
|||||||
if camera_config.detect.max_disappeared is None:
|
if camera_config.detect.max_disappeared is None:
|
||||||
camera_config.detect.max_disappeared = max_disappeared
|
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
|
# FFMPEG input substitution
|
||||||
for input in camera_config.ffmpeg.inputs:
|
for input in camera_config.ffmpeg.inputs:
|
||||||
input.path = input.path.format(**FRIGATE_ENV_VARS)
|
input.path = input.path.format(**FRIGATE_ENV_VARS)
|
||||||
|
|||||||
@ -78,9 +78,9 @@ class ObjectTracker:
|
|||||||
}
|
}
|
||||||
return False
|
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
|
# and recompute the position box
|
||||||
if len(position["xmins"]) < self.detect_config.stationary_threshold:
|
if len(position["xmins"]) < 10:
|
||||||
position["xmins"].append(xmin)
|
position["xmins"].append(xmin)
|
||||||
position["ymins"].append(ymin)
|
position["ymins"].append(ymin)
|
||||||
position["xmaxs"].append(xmax)
|
position["xmaxs"].append(xmax)
|
||||||
|
|||||||
@ -507,8 +507,8 @@ def process_frames(
|
|||||||
stationary_object_ids = [
|
stationary_object_ids = [
|
||||||
obj["id"]
|
obj["id"]
|
||||||
for obj in object_tracker.tracked_objects.values()
|
for obj in object_tracker.tracked_objects.values()
|
||||||
# if there hasn't been motion for N frames
|
# if there hasn't been motion for 10 frames
|
||||||
if obj["motionless_count"] >= detect_config.stationary_threshold
|
if obj["motionless_count"] >= 10
|
||||||
# and it isn't due for a periodic check
|
# and it isn't due for a periodic check
|
||||||
and (
|
and (
|
||||||
detect_config.stationary_interval == 0
|
detect_config.stationary_interval == 0
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user