mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-08-02 09:02:15 +03:00
Full UI configuration (#22151)
* use react-jsonschema-form for UI config * don't use properties wrapper when generating config i18n json * configure for full i18n support * section fields * add descriptions to all fields for i18n * motion i18n * fix nullable fields * sanitize internal fields * add switches widgets and use friendly names * fix nullable schema entries * ensure update_topic is added to api calls this needs further backend implementation to work correctly * add global sections, camera config overrides, and reset button * i18n * add reset logic to global config view * tweaks * fix sections and live validation * fix validation for schema objects that can be null * generic and custom per-field validation * improve generic error validation messages * remove show advanced fields switch * tweaks * use shadcn theme * fix array field template * i18n tweaks * remove collapsible around root section * deep merge schema for advanced fields * add array field item template and fix ffmpeg section * add missing i18n keys * tweaks * comment out api call for testing * add config groups as a separate i18n namespace * add descriptions to all pydantic fields * make titles more concise * new titles as i18n * update i18n config generation script to use json schema * tweaks * tweaks * rebase * clean up * form tweaks * add wildcards and fix object filter fields * add field template for additionalproperties schema objects * improve typing * add section description from schema and clarify global vs camera level descriptions * separate and consolidate global and camera i18n namespaces * clean up now obsolete namespaces * tweaks * refactor sections and overrides * add ability to render components before and after fields * fix titles * chore(sections): remove legacy single-section components replaced by template * refactor configs to use individual files with a template * fix review description * apply hidden fields after ui schema * move util * remove unused i18n * clean up error messages * fix fast refresh * add custom validation and use it for ffmpeg input roles * update nav tree * remove unused * re-add override and modified indicators * mark pending changes and add confirmation dialog for resets * fix red unsaved dot * tweaks * add docs links, readonly keys, and restart required per field * add special case and comments for global motion section * add section form special cases * combine review sections * tweaks * add audio labels endpoint * add audio label switches and input to filter list * fix type * remove key from config when resetting to default/global * don't show description for new key/val fields * tweaks * spacing tweaks * add activity indicator and scrollbar tweaks * add docs to filter fields * wording changes * fix global ffmpeg section * add review classification zones to review form * add backend endpoint and frontend widget for ffmpeg presets and manual args * improve wording * hide descriptions for additional properties arrays * add warning log about incorrectly nested model config * spacing and language tweaks * fix i18n keys * networking section docs and description * small wording tweaks * add layout grid field * refactor with shared utilities * field order * add individual detectors to schema add detector titles and descriptions (docstrings in pydantic are used for descriptions) and add i18n keys to globals * clean up detectors section and i18n * don't save model config back to yaml when saving detectors * add full detectors config to api model dump works around the way we use detector plugins so we can have the full detector config for the frontend * add restart button to toast when restart is required * add ui option to remove inner cards * fix buttons * section tweaks * don't zoom into text on mobile * make buttons sticky at bottom of sections * small tweaks * highlight label of changed fields * add null to enum list when unwrapping * refactor to shared utils and add save all button * add undo all button * add RJSF to dictionary * consolidate utils * preserve form data when changing cameras * add mono fonts * add popover to show what fields will be saved * fix mobile menu not re-rendering with unsaved dots * tweaks * fix logger and env vars config section saving use escaped periods in keys to retain them in the config file (eg "frigate.embeddings") * add timezone widget * role map field with validation * fix validation for model section * add another hidden field * add footer message for required restart * use rjsf for notifications view * fix config saving * add replace rules field * default column layout and add field sizing * clean up field template * refactor profile settings to match rjsf forms * tweaks * refactor frigate+ view and make tweaks to sections * show frigate+ model info in detection model settings when using a frigate+ model * update restartRequired for all fields * fix restart fields * tweaks and add ability enable disabled cameras more backend changes required * require restart when enabling camera that is disabled in config * disable save when form is invalid * refactor ffmpeg section for readability * change label * clean up camera inputs fields * misc tweaks to ffmpeg section - add raw paths endpoint to ensure credentials get saved - restart required tooltip * maintenance settings tweaks * don't mutate with lodash * fix description re-rendering for nullable object fields * hide reindex field * update rjsf * add frigate+ description to settings pane * disable save all when any section is invalid * show translated field name in validation error pane * clean up * remove unused * fix genai merge * fix genai
This commit is contained in:
@@ -17,25 +17,45 @@ class AudioFilterConfig(FrigateBaseModel):
|
||||
default=0.8,
|
||||
ge=AUDIO_MIN_CONFIDENCE,
|
||||
lt=1.0,
|
||||
title="Minimum detection confidence threshold for audio to be counted.",
|
||||
title="Minimum audio confidence",
|
||||
description="Minimum confidence threshold for the audio event to be counted.",
|
||||
)
|
||||
|
||||
|
||||
class AudioConfig(FrigateBaseModel):
|
||||
enabled: bool = Field(default=False, title="Enable audio events.")
|
||||
enabled: bool = Field(
|
||||
default=False,
|
||||
title="Enable audio detection",
|
||||
description="Enable or disable audio event detection for all cameras; can be overridden per-camera.",
|
||||
)
|
||||
max_not_heard: int = Field(
|
||||
default=30, title="Seconds of not hearing the type of audio to end the event."
|
||||
default=30,
|
||||
title="End timeout",
|
||||
description="Amount of seconds without the configured audio type before the audio event is ended.",
|
||||
)
|
||||
min_volume: int = Field(
|
||||
default=500, title="Min volume required to run audio detection."
|
||||
default=500,
|
||||
title="Minimum volume",
|
||||
description="Minimum RMS volume threshold required to run audio detection; lower values increase sensitivity (e.g., 200 high, 500 medium, 1000 low).",
|
||||
)
|
||||
listen: list[str] = Field(
|
||||
default=DEFAULT_LISTEN_AUDIO, title="Audio to listen for."
|
||||
default=DEFAULT_LISTEN_AUDIO,
|
||||
title="Listen types",
|
||||
description="List of audio event types to detect (for example: bark, fire_alarm, scream, speech, yell).",
|
||||
)
|
||||
filters: Optional[dict[str, AudioFilterConfig]] = Field(
|
||||
None, title="Audio filters."
|
||||
None,
|
||||
title="Audio filters",
|
||||
description="Per-audio-type filter settings such as confidence thresholds used to reduce false positives.",
|
||||
)
|
||||
enabled_in_config: Optional[bool] = Field(
|
||||
None, title="Keep track of original state of audio detection."
|
||||
None,
|
||||
title="Original audio state",
|
||||
description="Indicates whether audio detection was originally enabled in the static config file.",
|
||||
)
|
||||
num_threads: int = Field(
|
||||
default=2,
|
||||
title="Detection threads",
|
||||
description="Number of threads to use for audio detection processing.",
|
||||
ge=1,
|
||||
)
|
||||
num_threads: int = Field(default=2, title="Number of detection threads", ge=1)
|
||||
|
||||
@@ -29,45 +29,88 @@ class BirdseyeModeEnum(str, Enum):
|
||||
|
||||
class BirdseyeLayoutConfig(FrigateBaseModel):
|
||||
scaling_factor: float = Field(
|
||||
default=2.0, title="Birdseye Scaling Factor", ge=1.0, le=5.0
|
||||
default=2.0,
|
||||
title="Scaling factor",
|
||||
description="Scaling factor used by the layout calculator (range 1.0 to 5.0).",
|
||||
ge=1.0,
|
||||
le=5.0,
|
||||
)
|
||||
max_cameras: Optional[int] = Field(
|
||||
default=None,
|
||||
title="Max cameras",
|
||||
description="Maximum number of cameras to display at once in Birdseye; shows the most recent cameras.",
|
||||
)
|
||||
max_cameras: Optional[int] = Field(default=None, title="Max cameras")
|
||||
|
||||
|
||||
class BirdseyeConfig(FrigateBaseModel):
|
||||
enabled: bool = Field(default=True, title="Enable birdseye view.")
|
||||
enabled: bool = Field(
|
||||
default=True,
|
||||
title="Enable Birdseye",
|
||||
description="Enable or disable the Birdseye view feature.",
|
||||
)
|
||||
mode: BirdseyeModeEnum = Field(
|
||||
default=BirdseyeModeEnum.objects, title="Tracking mode."
|
||||
default=BirdseyeModeEnum.objects,
|
||||
title="Tracking mode",
|
||||
description="Mode for including cameras in Birdseye: 'objects', 'motion', or 'continuous'.",
|
||||
)
|
||||
|
||||
restream: bool = Field(default=False, title="Restream birdseye via RTSP.")
|
||||
width: int = Field(default=1280, title="Birdseye width.")
|
||||
height: int = Field(default=720, title="Birdseye height.")
|
||||
restream: bool = Field(
|
||||
default=False,
|
||||
title="Restream RTSP",
|
||||
description="Re-stream the Birdseye output as an RTSP feed; enabling this will keep Birdseye running continuously.",
|
||||
)
|
||||
width: int = Field(
|
||||
default=1280,
|
||||
title="Width",
|
||||
description="Output width (pixels) of the composed Birdseye frame.",
|
||||
)
|
||||
height: int = Field(
|
||||
default=720,
|
||||
title="Height",
|
||||
description="Output height (pixels) of the composed Birdseye frame.",
|
||||
)
|
||||
quality: int = Field(
|
||||
default=8,
|
||||
title="Encoding quality.",
|
||||
title="Encoding quality",
|
||||
description="Encoding quality for the Birdseye mpeg1 feed (1 highest quality, 31 lowest).",
|
||||
ge=1,
|
||||
le=31,
|
||||
)
|
||||
inactivity_threshold: int = Field(
|
||||
default=30, title="Birdseye Inactivity Threshold", gt=0
|
||||
default=30,
|
||||
title="Inactivity threshold",
|
||||
description="Seconds of inactivity after which a camera will stop being shown in Birdseye.",
|
||||
gt=0,
|
||||
)
|
||||
layout: BirdseyeLayoutConfig = Field(
|
||||
default_factory=BirdseyeLayoutConfig, title="Birdseye Layout Config"
|
||||
default_factory=BirdseyeLayoutConfig,
|
||||
title="Layout",
|
||||
description="Layout options for the Birdseye composition.",
|
||||
)
|
||||
idle_heartbeat_fps: float = Field(
|
||||
default=0.0,
|
||||
ge=0.0,
|
||||
le=10.0,
|
||||
title="Idle heartbeat FPS (0 disables, max 10)",
|
||||
title="Idle heartbeat FPS",
|
||||
description="Frames-per-second to resend the last composed Birdseye frame when idle; set to 0 to disable.",
|
||||
)
|
||||
|
||||
|
||||
# uses BaseModel because some global attributes are not available at the camera level
|
||||
class BirdseyeCameraConfig(BaseModel):
|
||||
enabled: bool = Field(default=True, title="Enable birdseye view for camera.")
|
||||
enabled: bool = Field(
|
||||
default=True,
|
||||
title="Enable Birdseye",
|
||||
description="Enable or disable the Birdseye view feature.",
|
||||
)
|
||||
mode: BirdseyeModeEnum = Field(
|
||||
default=BirdseyeModeEnum.objects, title="Tracking mode for camera."
|
||||
default=BirdseyeModeEnum.objects,
|
||||
title="Tracking mode",
|
||||
description="Mode for including cameras in Birdseye: 'objects', 'motion', or 'continuous'.",
|
||||
)
|
||||
|
||||
order: int = Field(default=0, title="Position of the camera in the birdseye view.")
|
||||
order: int = Field(
|
||||
default=0,
|
||||
title="Position",
|
||||
description="Numeric position controlling the camera's ordering in the Birdseye layout.",
|
||||
)
|
||||
|
||||
@@ -50,10 +50,17 @@ class CameraTypeEnum(str, Enum):
|
||||
|
||||
|
||||
class CameraConfig(FrigateBaseModel):
|
||||
name: Optional[str] = Field(None, title="Camera name.", pattern=REGEX_CAMERA_NAME)
|
||||
name: Optional[str] = Field(
|
||||
None,
|
||||
title="Camera name",
|
||||
description="Camera name is required",
|
||||
pattern=REGEX_CAMERA_NAME,
|
||||
)
|
||||
|
||||
friendly_name: Optional[str] = Field(
|
||||
None, title="Camera friendly name used in the Frigate UI."
|
||||
None,
|
||||
title="Friendly name",
|
||||
description="Camera friendly name used in the Frigate UI",
|
||||
)
|
||||
|
||||
@model_validator(mode="before")
|
||||
@@ -63,80 +70,129 @@ class CameraConfig(FrigateBaseModel):
|
||||
pass
|
||||
return values
|
||||
|
||||
enabled: bool = Field(default=True, title="Enable camera.")
|
||||
enabled: bool = Field(default=True, title="Enabled", description="Enabled")
|
||||
|
||||
# Options with global fallback
|
||||
audio: AudioConfig = Field(
|
||||
default_factory=AudioConfig, title="Audio events configuration."
|
||||
default_factory=AudioConfig,
|
||||
title="Audio events",
|
||||
description="Settings for audio-based event detection for this camera.",
|
||||
)
|
||||
audio_transcription: CameraAudioTranscriptionConfig = Field(
|
||||
default_factory=CameraAudioTranscriptionConfig,
|
||||
title="Audio transcription config.",
|
||||
title="Audio transcription",
|
||||
description="Settings for live and speech audio transcription used for events and live captions.",
|
||||
)
|
||||
birdseye: BirdseyeCameraConfig = Field(
|
||||
default_factory=BirdseyeCameraConfig, title="Birdseye camera configuration."
|
||||
default_factory=BirdseyeCameraConfig,
|
||||
title="Birdseye",
|
||||
description="Settings for the Birdseye composite view that composes multiple camera feeds into a single layout.",
|
||||
)
|
||||
detect: DetectConfig = Field(
|
||||
default_factory=DetectConfig, title="Object detection configuration."
|
||||
default_factory=DetectConfig,
|
||||
title="Object Detection",
|
||||
description="Settings for the detection/detect role used to run object detection and initialize trackers.",
|
||||
)
|
||||
face_recognition: CameraFaceRecognitionConfig = Field(
|
||||
default_factory=CameraFaceRecognitionConfig, title="Face recognition config."
|
||||
default_factory=CameraFaceRecognitionConfig,
|
||||
title="Face recognition",
|
||||
description="Settings for face detection and recognition for this camera.",
|
||||
)
|
||||
ffmpeg: CameraFfmpegConfig = Field(
|
||||
title="FFmpeg",
|
||||
description="FFmpeg settings including binary path, args, hwaccel options, and per-role output args.",
|
||||
)
|
||||
ffmpeg: CameraFfmpegConfig = Field(title="FFmpeg configuration for the camera.")
|
||||
live: CameraLiveConfig = Field(
|
||||
default_factory=CameraLiveConfig, title="Live playback settings."
|
||||
default_factory=CameraLiveConfig,
|
||||
title="Live playback",
|
||||
description="Settings used by the Web UI to control live stream selection, resolution and quality.",
|
||||
)
|
||||
lpr: CameraLicensePlateRecognitionConfig = Field(
|
||||
default_factory=CameraLicensePlateRecognitionConfig, title="LPR config."
|
||||
default_factory=CameraLicensePlateRecognitionConfig,
|
||||
title="License Plate Recognition",
|
||||
description="License plate recognition settings including detection thresholds, formatting, and known plates.",
|
||||
)
|
||||
motion: MotionConfig = Field(
|
||||
None,
|
||||
title="Motion detection",
|
||||
description="Default motion detection settings for this camera.",
|
||||
)
|
||||
motion: MotionConfig = Field(None, title="Motion detection configuration.")
|
||||
objects: ObjectConfig = Field(
|
||||
default_factory=ObjectConfig, title="Object configuration."
|
||||
default_factory=ObjectConfig,
|
||||
title="Objects",
|
||||
description="Object tracking defaults including which labels to track and per-object filters.",
|
||||
)
|
||||
record: RecordConfig = Field(
|
||||
default_factory=RecordConfig, title="Record configuration."
|
||||
default_factory=RecordConfig,
|
||||
title="Recording",
|
||||
description="Recording and retention settings for this camera.",
|
||||
)
|
||||
review: ReviewConfig = Field(
|
||||
default_factory=ReviewConfig, title="Review configuration."
|
||||
default_factory=ReviewConfig,
|
||||
title="Review",
|
||||
description="Settings that control alerts, detections, and GenAI review summaries used by the UI and storage for this camera.",
|
||||
)
|
||||
semantic_search: CameraSemanticSearchConfig = Field(
|
||||
default_factory=CameraSemanticSearchConfig,
|
||||
title="Semantic search configuration.",
|
||||
title="Semantic Search",
|
||||
description="Settings for semantic search which builds and queries object embeddings to find similar items.",
|
||||
)
|
||||
snapshots: SnapshotsConfig = Field(
|
||||
default_factory=SnapshotsConfig, title="Snapshot configuration."
|
||||
default_factory=SnapshotsConfig,
|
||||
title="Snapshots",
|
||||
description="Settings for saved JPEG snapshots of tracked objects for this camera.",
|
||||
)
|
||||
timestamp_style: TimestampStyleConfig = Field(
|
||||
default_factory=TimestampStyleConfig, title="Timestamp style configuration."
|
||||
default_factory=TimestampStyleConfig,
|
||||
title="Timestamp style",
|
||||
description="Styling options for in-feed timestamps applied to recordings and snapshots.",
|
||||
)
|
||||
|
||||
# Options without global fallback
|
||||
best_image_timeout: int = Field(
|
||||
default=60,
|
||||
title="How long to wait for the image with the highest confidence score.",
|
||||
title="Best image timeout",
|
||||
description="How long to wait for the image with the highest confidence score.",
|
||||
)
|
||||
mqtt: CameraMqttConfig = Field(
|
||||
default_factory=CameraMqttConfig, title="MQTT configuration."
|
||||
default_factory=CameraMqttConfig,
|
||||
title="MQTT",
|
||||
description="MQTT image publishing settings.",
|
||||
)
|
||||
notifications: NotificationConfig = Field(
|
||||
default_factory=NotificationConfig, title="Notifications configuration."
|
||||
default_factory=NotificationConfig,
|
||||
title="Notifications",
|
||||
description="Settings to enable and control notifications for this camera.",
|
||||
)
|
||||
onvif: OnvifConfig = Field(
|
||||
default_factory=OnvifConfig, title="Camera Onvif Configuration."
|
||||
default_factory=OnvifConfig,
|
||||
title="ONVIF",
|
||||
description="ONVIF connection and PTZ autotracking settings for this camera.",
|
||||
)
|
||||
type: CameraTypeEnum = Field(
|
||||
default=CameraTypeEnum.generic,
|
||||
title="Camera type",
|
||||
description="Camera Type",
|
||||
)
|
||||
type: CameraTypeEnum = Field(default=CameraTypeEnum.generic, title="Camera Type")
|
||||
ui: CameraUiConfig = Field(
|
||||
default_factory=CameraUiConfig, title="Camera UI Modifications."
|
||||
default_factory=CameraUiConfig,
|
||||
title="Camera UI",
|
||||
description="Display ordering and visibility for this camera in the UI. Ordering affects the default dashboard. For more granular control, use camera groups.",
|
||||
)
|
||||
webui_url: Optional[str] = Field(
|
||||
None,
|
||||
title="URL to visit the camera directly from system page",
|
||||
title="Camera URL",
|
||||
description="URL to visit the camera directly from system page",
|
||||
)
|
||||
zones: dict[str, ZoneConfig] = Field(
|
||||
default_factory=dict, title="Zone configuration."
|
||||
default_factory=dict,
|
||||
title="Zones",
|
||||
description="Zones allow you to define a specific area of the frame so you can determine whether or not an object is within a particular area.",
|
||||
)
|
||||
enabled_in_config: Optional[bool] = Field(
|
||||
default=None, title="Keep track of original state of camera."
|
||||
default=None,
|
||||
title="Original camera state",
|
||||
description="Keep track of original state of camera.",
|
||||
)
|
||||
|
||||
_ffmpeg_cmds: list[dict[str, list[str]]] = PrivateAttr()
|
||||
|
||||
@@ -8,56 +8,82 @@ __all__ = ["DetectConfig", "StationaryConfig", "StationaryMaxFramesConfig"]
|
||||
|
||||
|
||||
class StationaryMaxFramesConfig(FrigateBaseModel):
|
||||
default: Optional[int] = Field(default=None, title="Default max frames.", ge=1)
|
||||
default: Optional[int] = Field(
|
||||
default=None,
|
||||
title="Default max frames",
|
||||
description="Default maximum frames to track a stationary object before stopping.",
|
||||
ge=1,
|
||||
)
|
||||
objects: dict[str, int] = Field(
|
||||
default_factory=dict, title="Object specific max frames."
|
||||
default_factory=dict,
|
||||
title="Object max frames",
|
||||
description="Per-object overrides for maximum frames to track stationary objects.",
|
||||
)
|
||||
|
||||
|
||||
class StationaryConfig(FrigateBaseModel):
|
||||
interval: Optional[int] = Field(
|
||||
default=None,
|
||||
title="Frame interval for checking stationary objects.",
|
||||
title="Stationary interval",
|
||||
description="How often (in frames) to run a detection check to confirm a stationary object.",
|
||||
gt=0,
|
||||
)
|
||||
threshold: Optional[int] = Field(
|
||||
default=None,
|
||||
title="Number of frames without a position change for an object to be considered stationary",
|
||||
title="Stationary threshold",
|
||||
description="Number of frames with no position change required to mark an object as stationary.",
|
||||
ge=1,
|
||||
)
|
||||
max_frames: StationaryMaxFramesConfig = Field(
|
||||
default_factory=StationaryMaxFramesConfig,
|
||||
title="Max frames for stationary objects.",
|
||||
title="Max frames",
|
||||
description="Limits how long stationary objects are tracked before being discarded.",
|
||||
)
|
||||
classifier: bool = Field(
|
||||
default=True,
|
||||
title="Enable visual classifier for determing if objects with jittery bounding boxes are stationary.",
|
||||
title="Enable visual classifier",
|
||||
description="Use a visual classifier to detect truly stationary objects even when bounding boxes jitter.",
|
||||
)
|
||||
|
||||
|
||||
class DetectConfig(FrigateBaseModel):
|
||||
enabled: bool = Field(default=False, title="Detection Enabled.")
|
||||
enabled: bool = Field(
|
||||
default=False,
|
||||
title="Detection enabled",
|
||||
description="Enable or disable object detection for all cameras; can be overridden per-camera. Detection must be enabled for object tracking to run.",
|
||||
)
|
||||
height: Optional[int] = Field(
|
||||
default=None, title="Height of the stream for the detect role."
|
||||
default=None,
|
||||
title="Detect height",
|
||||
description="Height (pixels) of frames used for the detect stream; leave empty to use the native stream resolution.",
|
||||
)
|
||||
width: Optional[int] = Field(
|
||||
default=None, title="Width of the stream for the detect role."
|
||||
default=None,
|
||||
title="Detect width",
|
||||
description="Width (pixels) of frames used for the detect stream; leave empty to use the native stream resolution.",
|
||||
)
|
||||
fps: int = Field(
|
||||
default=5, title="Number of frames per second to process through detection."
|
||||
default=5,
|
||||
title="Detect FPS",
|
||||
description="Desired frames per second to run detection on; lower values reduce CPU usage (recommended value is 5, only set higher - at most 10 - if tracking extremely fast moving objects).",
|
||||
)
|
||||
min_initialized: Optional[int] = Field(
|
||||
default=None,
|
||||
title="Minimum number of consecutive hits for an object to be initialized by the tracker.",
|
||||
title="Minimum initialization frames",
|
||||
description="Number of consecutive detection hits required before creating a tracked object. Increase to reduce false initializations. Default value is fps divided by 2.",
|
||||
)
|
||||
max_disappeared: Optional[int] = Field(
|
||||
default=None,
|
||||
title="Maximum number of frames the object can disappear before detection ends.",
|
||||
title="Maximum disappeared frames",
|
||||
description="Number of frames without a detection before a tracked object is considered gone.",
|
||||
)
|
||||
stationary: StationaryConfig = Field(
|
||||
default_factory=StationaryConfig,
|
||||
title="Stationary objects config.",
|
||||
title="Stationary objects config",
|
||||
description="Settings to detect and manage objects that remain stationary for a period of time.",
|
||||
)
|
||||
annotation_offset: int = Field(
|
||||
default=0, title="Milliseconds to offset detect annotations by."
|
||||
default=0,
|
||||
title="Annotation offset",
|
||||
description="Milliseconds to shift detect annotations to better align timeline bounding boxes with recordings; can be positive or negative.",
|
||||
)
|
||||
|
||||
@@ -35,39 +35,58 @@ DETECT_FFMPEG_OUTPUT_ARGS_DEFAULT = [
|
||||
class FfmpegOutputArgsConfig(FrigateBaseModel):
|
||||
detect: Union[str, list[str]] = Field(
|
||||
default=DETECT_FFMPEG_OUTPUT_ARGS_DEFAULT,
|
||||
title="Detect role FFmpeg output arguments.",
|
||||
title="Detect output arguments",
|
||||
description="Default output arguments for detect role streams.",
|
||||
)
|
||||
record: Union[str, list[str]] = Field(
|
||||
default=RECORD_FFMPEG_OUTPUT_ARGS_DEFAULT,
|
||||
title="Record role FFmpeg output arguments.",
|
||||
title="Record output arguments",
|
||||
description="Default output arguments for record role streams.",
|
||||
)
|
||||
|
||||
|
||||
class FfmpegConfig(FrigateBaseModel):
|
||||
path: str = Field(default="default", title="FFmpeg path")
|
||||
path: str = Field(
|
||||
default="default",
|
||||
title="FFmpeg path",
|
||||
description='Path to the FFmpeg binary to use or a version alias ("5.0" or "7.0").',
|
||||
)
|
||||
global_args: Union[str, list[str]] = Field(
|
||||
default=FFMPEG_GLOBAL_ARGS_DEFAULT, title="Global FFmpeg arguments."
|
||||
default=FFMPEG_GLOBAL_ARGS_DEFAULT,
|
||||
title="FFmpeg global arguments",
|
||||
description="Global arguments passed to FFmpeg processes.",
|
||||
)
|
||||
hwaccel_args: Union[str, list[str]] = Field(
|
||||
default="auto", title="FFmpeg hardware acceleration arguments."
|
||||
default="auto",
|
||||
title="Hardware acceleration arguments",
|
||||
description="Hardware acceleration arguments for FFmpeg. Provider-specific presets are recommended.",
|
||||
)
|
||||
input_args: Union[str, list[str]] = Field(
|
||||
default=FFMPEG_INPUT_ARGS_DEFAULT, title="FFmpeg input arguments."
|
||||
default=FFMPEG_INPUT_ARGS_DEFAULT,
|
||||
title="Input arguments",
|
||||
description="Input arguments applied to FFmpeg input streams.",
|
||||
)
|
||||
output_args: FfmpegOutputArgsConfig = Field(
|
||||
default_factory=FfmpegOutputArgsConfig,
|
||||
title="FFmpeg output arguments per role.",
|
||||
title="Output arguments",
|
||||
description="Default output arguments used for different FFmpeg roles such as detect and record.",
|
||||
)
|
||||
retry_interval: float = Field(
|
||||
default=10.0,
|
||||
title="Time in seconds to wait before FFmpeg retries connecting to the camera.",
|
||||
title="FFmpeg retry time",
|
||||
description="Seconds to wait before attempting to reconnect a camera stream after failure. Default is 10.",
|
||||
gt=0.0,
|
||||
)
|
||||
apple_compatibility: bool = Field(
|
||||
default=False,
|
||||
title="Set tag on HEVC (H.265) recording stream to improve compatibility with Apple players.",
|
||||
title="Apple compatibility",
|
||||
description="Enable HEVC tagging for better Apple player compatibility when recording H.265.",
|
||||
)
|
||||
gpu: int = Field(
|
||||
default=0,
|
||||
title="GPU index",
|
||||
description="Default GPU index used for hardware acceleration if available.",
|
||||
)
|
||||
gpu: int = Field(default=0, title="GPU index to use for hardware acceleration.")
|
||||
|
||||
@property
|
||||
def ffmpeg_path(self) -> str:
|
||||
@@ -95,21 +114,36 @@ class CameraRoleEnum(str, Enum):
|
||||
|
||||
|
||||
class CameraInput(FrigateBaseModel):
|
||||
path: EnvString = Field(title="Camera input path.")
|
||||
roles: list[CameraRoleEnum] = Field(title="Roles assigned to this input.")
|
||||
path: EnvString = Field(
|
||||
title="Input path",
|
||||
description="Camera input stream URL or path.",
|
||||
)
|
||||
roles: list[CameraRoleEnum] = Field(
|
||||
title="Input roles",
|
||||
description="Roles for this input stream.",
|
||||
)
|
||||
global_args: Union[str, list[str]] = Field(
|
||||
default_factory=list, title="FFmpeg global arguments."
|
||||
default_factory=list,
|
||||
title="FFmpeg global arguments",
|
||||
description="FFmpeg global arguments for this input stream.",
|
||||
)
|
||||
hwaccel_args: Union[str, list[str]] = Field(
|
||||
default_factory=list, title="FFmpeg hardware acceleration arguments."
|
||||
default_factory=list,
|
||||
title="Hardware acceleration arguments",
|
||||
description="Hardware acceleration arguments for this input stream.",
|
||||
)
|
||||
input_args: Union[str, list[str]] = Field(
|
||||
default_factory=list, title="FFmpeg input arguments."
|
||||
default_factory=list,
|
||||
title="Input arguments",
|
||||
description="Input arguments specific to this stream.",
|
||||
)
|
||||
|
||||
|
||||
class CameraFfmpegConfig(FfmpegConfig):
|
||||
inputs: list[CameraInput] = Field(title="Camera inputs.")
|
||||
inputs: list[CameraInput] = Field(
|
||||
title="Camera inputs",
|
||||
description="List of input stream definitions (paths and roles) for this camera.",
|
||||
)
|
||||
|
||||
@field_validator("inputs")
|
||||
@classmethod
|
||||
|
||||
@@ -67,6 +67,3 @@ class GenAIConfig(FrigateBaseModel):
|
||||
description="Runtime options passed to the provider for each inference call.",
|
||||
json_schema_extra={"additionalProperties": {"type": "string"}},
|
||||
)
|
||||
runtime_options: dict[str, Any] = Field(
|
||||
default={}, title="Options to pass during inference calls."
|
||||
)
|
||||
|
||||
@@ -10,7 +10,18 @@ __all__ = ["CameraLiveConfig"]
|
||||
class CameraLiveConfig(FrigateBaseModel):
|
||||
streams: Dict[str, str] = Field(
|
||||
default_factory=list,
|
||||
title="Friendly names and restream names to use for live view.",
|
||||
title="Live stream names",
|
||||
description="Mapping of configured stream names to restream/go2rtc names used for live playback.",
|
||||
)
|
||||
height: int = Field(
|
||||
default=720,
|
||||
title="Live height",
|
||||
description="Height (pixels) to render the jsmpeg live stream in the Web UI; must be <= detect stream height.",
|
||||
)
|
||||
quality: int = Field(
|
||||
default=8,
|
||||
ge=1,
|
||||
le=31,
|
||||
title="Live quality",
|
||||
description="Encoding quality for the jsmpeg stream (1 highest, 31 lowest).",
|
||||
)
|
||||
height: int = Field(default=720, title="Live camera view height")
|
||||
quality: int = Field(default=8, ge=1, le=31, title="Live camera view quality")
|
||||
|
||||
@@ -8,30 +8,64 @@ __all__ = ["MotionConfig"]
|
||||
|
||||
|
||||
class MotionConfig(FrigateBaseModel):
|
||||
enabled: bool = Field(default=True, title="Enable motion on all cameras.")
|
||||
enabled: bool = Field(
|
||||
default=True,
|
||||
title="Enable motion detection",
|
||||
description="Enable or disable motion detection for all cameras; can be overridden per-camera.",
|
||||
)
|
||||
threshold: int = Field(
|
||||
default=30,
|
||||
title="Motion detection threshold (1-255).",
|
||||
title="Motion threshold",
|
||||
description="Pixel difference threshold used by the motion detector; higher values reduce sensitivity (range 1-255).",
|
||||
ge=1,
|
||||
le=255,
|
||||
)
|
||||
lightning_threshold: float = Field(
|
||||
default=0.8, title="Lightning detection threshold (0.3-1.0).", ge=0.3, le=1.0
|
||||
default=0.8,
|
||||
title="Lightning threshold",
|
||||
description="Threshold to detect and ignore brief lighting spikes (lower is more sensitive, values between 0.3 and 1.0).",
|
||||
ge=0.3,
|
||||
le=1.0,
|
||||
)
|
||||
improve_contrast: bool = Field(
|
||||
default=True,
|
||||
title="Improve contrast",
|
||||
description="Apply contrast improvement to frames before motion analysis to help detection.",
|
||||
)
|
||||
contour_area: Optional[int] = Field(
|
||||
default=10,
|
||||
title="Contour area",
|
||||
description="Minimum contour area in pixels required for a motion contour to be counted.",
|
||||
)
|
||||
delta_alpha: float = Field(
|
||||
default=0.2,
|
||||
title="Delta alpha",
|
||||
description="Alpha blending factor used in frame differencing for motion calculation.",
|
||||
)
|
||||
frame_alpha: float = Field(
|
||||
default=0.01,
|
||||
title="Frame alpha",
|
||||
description="Alpha value used when blending frames for motion preprocessing.",
|
||||
)
|
||||
frame_height: Optional[int] = Field(
|
||||
default=100,
|
||||
title="Frame height",
|
||||
description="Height in pixels to scale frames to when computing motion.",
|
||||
)
|
||||
improve_contrast: bool = Field(default=True, title="Improve Contrast")
|
||||
contour_area: Optional[int] = Field(default=10, title="Contour Area")
|
||||
delta_alpha: float = Field(default=0.2, title="Delta Alpha")
|
||||
frame_alpha: float = Field(default=0.01, title="Frame Alpha")
|
||||
frame_height: Optional[int] = Field(default=100, title="Frame Height")
|
||||
mask: Union[str, list[str]] = Field(
|
||||
default="", title="Coordinates polygon for the motion mask."
|
||||
default="",
|
||||
title="Mask coordinates",
|
||||
description="Ordered x,y coordinates defining the motion mask polygon used to include/exclude areas.",
|
||||
)
|
||||
mqtt_off_delay: int = Field(
|
||||
default=30,
|
||||
title="Delay for updating MQTT with no motion detected.",
|
||||
title="MQTT off delay",
|
||||
description="Seconds to wait after last motion before publishing an MQTT 'off' state.",
|
||||
)
|
||||
enabled_in_config: Optional[bool] = Field(
|
||||
default=None, title="Keep track of original state of motion detection."
|
||||
default=None,
|
||||
title="Original motion state",
|
||||
description="Indicates whether motion detection was enabled in the original static configuration.",
|
||||
)
|
||||
raw_mask: Union[str, list[str]] = ""
|
||||
|
||||
|
||||
@@ -6,18 +6,40 @@ __all__ = ["CameraMqttConfig"]
|
||||
|
||||
|
||||
class CameraMqttConfig(FrigateBaseModel):
|
||||
enabled: bool = Field(default=True, title="Send image over MQTT.")
|
||||
timestamp: bool = Field(default=True, title="Add timestamp to MQTT image.")
|
||||
bounding_box: bool = Field(default=True, title="Add bounding box to MQTT image.")
|
||||
crop: bool = Field(default=True, title="Crop MQTT image to detected object.")
|
||||
height: int = Field(default=270, title="MQTT image height.")
|
||||
enabled: bool = Field(
|
||||
default=True,
|
||||
title="Send image",
|
||||
description="Enable publishing image snapshots for objects to MQTT topics for this camera.",
|
||||
)
|
||||
timestamp: bool = Field(
|
||||
default=True,
|
||||
title="Add timestamp",
|
||||
description="Overlay a timestamp on images published to MQTT.",
|
||||
)
|
||||
bounding_box: bool = Field(
|
||||
default=True,
|
||||
title="Add bounding box",
|
||||
description="Draw bounding boxes on images published over MQTT.",
|
||||
)
|
||||
crop: bool = Field(
|
||||
default=True,
|
||||
title="Crop image",
|
||||
description="Crop images published to MQTT to the detected object's bounding box.",
|
||||
)
|
||||
height: int = Field(
|
||||
default=270,
|
||||
title="Image height",
|
||||
description="Height (pixels) to resize images published over MQTT.",
|
||||
)
|
||||
required_zones: list[str] = Field(
|
||||
default_factory=list,
|
||||
title="List of required zones to be entered in order to send the image.",
|
||||
title="Required zones",
|
||||
description="Zones that an object must enter for an MQTT image to be published.",
|
||||
)
|
||||
quality: int = Field(
|
||||
default=70,
|
||||
title="Quality of the encoded jpeg (0-100).",
|
||||
title="JPEG quality",
|
||||
description="JPEG quality for images published to MQTT (0-100).",
|
||||
ge=0,
|
||||
le=100,
|
||||
)
|
||||
|
||||
@@ -8,11 +8,24 @@ __all__ = ["NotificationConfig"]
|
||||
|
||||
|
||||
class NotificationConfig(FrigateBaseModel):
|
||||
enabled: bool = Field(default=False, title="Enable notifications")
|
||||
email: Optional[str] = Field(default=None, title="Email required for push.")
|
||||
enabled: bool = Field(
|
||||
default=False,
|
||||
title="Enable notifications",
|
||||
description="Enable or disable notifications for all cameras; can be overridden per-camera.",
|
||||
)
|
||||
email: Optional[str] = Field(
|
||||
default=None,
|
||||
title="Notification email",
|
||||
description="Email address used for push notifications or required by certain notification providers.",
|
||||
)
|
||||
cooldown: int = Field(
|
||||
default=0, ge=0, title="Cooldown period for notifications (time in seconds)."
|
||||
default=0,
|
||||
ge=0,
|
||||
title="Cooldown period",
|
||||
description="Cooldown (seconds) between notifications to avoid spamming recipients.",
|
||||
)
|
||||
enabled_in_config: Optional[bool] = Field(
|
||||
default=None, title="Keep track of original state of notifications."
|
||||
default=None,
|
||||
title="Original notifications state",
|
||||
description="Indicates whether notifications were enabled in the original static configuration.",
|
||||
)
|
||||
|
||||
@@ -13,30 +13,38 @@ DEFAULT_TRACKED_OBJECTS = ["person"]
|
||||
class FilterConfig(FrigateBaseModel):
|
||||
min_area: Union[int, float] = Field(
|
||||
default=0,
|
||||
title="Minimum area of bounding box for object to be counted. Can be pixels (int) or percentage (float between 0.000001 and 0.99).",
|
||||
title="Minimum object area",
|
||||
description="Minimum bounding box area (pixels or percentage) required for this object type. Can be pixels (int) or percentage (float between 0.000001 and 0.99).",
|
||||
)
|
||||
max_area: Union[int, float] = Field(
|
||||
default=24000000,
|
||||
title="Maximum area of bounding box for object to be counted. Can be pixels (int) or percentage (float between 0.000001 and 0.99).",
|
||||
title="Maximum object area",
|
||||
description="Maximum bounding box area (pixels or percentage) allowed for this object type. Can be pixels (int) or percentage (float between 0.000001 and 0.99).",
|
||||
)
|
||||
min_ratio: float = Field(
|
||||
default=0,
|
||||
title="Minimum ratio of bounding box's width/height for object to be counted.",
|
||||
title="Minimum aspect ratio",
|
||||
description="Minimum width/height ratio required for the bounding box to qualify.",
|
||||
)
|
||||
max_ratio: float = Field(
|
||||
default=24000000,
|
||||
title="Maximum ratio of bounding box's width/height for object to be counted.",
|
||||
title="Maximum aspect ratio",
|
||||
description="Maximum width/height ratio allowed for the bounding box to qualify.",
|
||||
)
|
||||
threshold: float = Field(
|
||||
default=0.7,
|
||||
title="Average detection confidence threshold for object to be counted.",
|
||||
title="Confidence threshold",
|
||||
description="Average detection confidence threshold required for the object to be considered a true positive.",
|
||||
)
|
||||
min_score: float = Field(
|
||||
default=0.5, title="Minimum detection confidence for object to be counted."
|
||||
default=0.5,
|
||||
title="Minimum confidence",
|
||||
description="Minimum single-frame detection confidence required for the object to be counted.",
|
||||
)
|
||||
mask: Optional[Union[str, list[str]]] = Field(
|
||||
default=None,
|
||||
title="Detection area polygon mask for this filter configuration.",
|
||||
title="Filter mask",
|
||||
description="Polygon coordinates defining where this filter applies within the frame.",
|
||||
)
|
||||
raw_mask: Union[str, list[str]] = ""
|
||||
|
||||
@@ -51,46 +59,64 @@ class FilterConfig(FrigateBaseModel):
|
||||
|
||||
class GenAIObjectTriggerConfig(FrigateBaseModel):
|
||||
tracked_object_end: bool = Field(
|
||||
default=True, title="Send once the object is no longer tracked."
|
||||
default=True,
|
||||
title="Send on end",
|
||||
description="Send a request to GenAI when the tracked object ends.",
|
||||
)
|
||||
after_significant_updates: Optional[int] = Field(
|
||||
default=None,
|
||||
title="Send an early request to generative AI when X frames accumulated.",
|
||||
title="Early GenAI trigger",
|
||||
description="Send a request to GenAI after a specified number of significant updates for the tracked object.",
|
||||
ge=1,
|
||||
)
|
||||
|
||||
|
||||
class GenAIObjectConfig(FrigateBaseModel):
|
||||
enabled: bool = Field(default=False, title="Enable GenAI for camera.")
|
||||
enabled: bool = Field(
|
||||
default=False,
|
||||
title="Enable GenAI",
|
||||
description="Enable GenAI generation of descriptions for tracked objects by default.",
|
||||
)
|
||||
use_snapshot: bool = Field(
|
||||
default=False, title="Use snapshots for generating descriptions."
|
||||
default=False,
|
||||
title="Use snapshots",
|
||||
description="Use object snapshots instead of thumbnails for GenAI description generation.",
|
||||
)
|
||||
prompt: str = Field(
|
||||
default="Analyze the sequence of images containing the {label}. Focus on the likely intent or behavior of the {label} based on its actions and movement, rather than describing its appearance or the surroundings. Consider what the {label} is doing, why, and what it might do next.",
|
||||
title="Default caption prompt.",
|
||||
title="Caption prompt",
|
||||
description="Default prompt template used when generating descriptions with GenAI.",
|
||||
)
|
||||
object_prompts: dict[str, str] = Field(
|
||||
default_factory=dict, title="Object specific prompts."
|
||||
default_factory=dict,
|
||||
title="Object prompts",
|
||||
description="Per-object prompts to customize GenAI outputs for specific labels.",
|
||||
)
|
||||
|
||||
objects: Union[str, list[str]] = Field(
|
||||
default_factory=list,
|
||||
title="List of objects to run generative AI for.",
|
||||
title="GenAI objects",
|
||||
description="List of object labels to send to GenAI by default.",
|
||||
)
|
||||
required_zones: Union[str, list[str]] = Field(
|
||||
default_factory=list,
|
||||
title="List of required zones to be entered in order to run generative AI.",
|
||||
title="Required zones",
|
||||
description="Zones that must be entered for objects to qualify for GenAI description generation.",
|
||||
)
|
||||
debug_save_thumbnails: bool = Field(
|
||||
default=False,
|
||||
title="Save thumbnails sent to generative AI for debugging purposes.",
|
||||
title="Save thumbnails",
|
||||
description="Save thumbnails sent to GenAI for debugging and review.",
|
||||
)
|
||||
send_triggers: GenAIObjectTriggerConfig = Field(
|
||||
default_factory=GenAIObjectTriggerConfig,
|
||||
title="What triggers to use to send frames to generative AI for a tracked object.",
|
||||
title="GenAI triggers",
|
||||
description="Defines when frames should be sent to GenAI (on end, after updates, etc.).",
|
||||
)
|
||||
enabled_in_config: Optional[bool] = Field(
|
||||
default=None, title="Keep track of original state of generative AI."
|
||||
default=None,
|
||||
title="Original GenAI state",
|
||||
description="Indicates whether GenAI was enabled in the original static config.",
|
||||
)
|
||||
|
||||
@field_validator("required_zones", mode="before")
|
||||
@@ -103,14 +129,25 @@ class GenAIObjectConfig(FrigateBaseModel):
|
||||
|
||||
|
||||
class ObjectConfig(FrigateBaseModel):
|
||||
track: list[str] = Field(default=DEFAULT_TRACKED_OBJECTS, title="Objects to track.")
|
||||
track: list[str] = Field(
|
||||
default=DEFAULT_TRACKED_OBJECTS,
|
||||
title="Objects to track",
|
||||
description="List of object labels to track for all cameras; can be overridden per-camera.",
|
||||
)
|
||||
filters: dict[str, FilterConfig] = Field(
|
||||
default_factory=dict, title="Object filters."
|
||||
default_factory=dict,
|
||||
title="Object filters",
|
||||
description="Filters applied to detected objects to reduce false positives (area, ratio, confidence).",
|
||||
)
|
||||
mask: Union[str, list[str]] = Field(
|
||||
default="",
|
||||
title="Object mask",
|
||||
description="Mask polygon used to prevent object detection in specified areas.",
|
||||
)
|
||||
mask: Union[str, list[str]] = Field(default="", title="Object mask.")
|
||||
genai: GenAIObjectConfig = Field(
|
||||
default_factory=GenAIObjectConfig,
|
||||
title="Config for using genai to analyze objects.",
|
||||
title="GenAI object config",
|
||||
description="GenAI options for describing tracked objects and sending frames for generation.",
|
||||
)
|
||||
_all_objects: list[str] = PrivateAttr()
|
||||
|
||||
|
||||
@@ -17,37 +17,57 @@ class ZoomingModeEnum(str, Enum):
|
||||
|
||||
|
||||
class PtzAutotrackConfig(FrigateBaseModel):
|
||||
enabled: bool = Field(default=False, title="Enable PTZ object autotracking.")
|
||||
enabled: bool = Field(
|
||||
default=False,
|
||||
title="Enable Autotracking",
|
||||
description="Enable or disable automatic PTZ camera tracking of detected objects.",
|
||||
)
|
||||
calibrate_on_startup: bool = Field(
|
||||
default=False, title="Perform a camera calibration when Frigate starts."
|
||||
default=False,
|
||||
title="Calibrate on start",
|
||||
description="Measure PTZ motor speeds on startup to improve tracking accuracy. Frigate will update config with movement_weights after calibration.",
|
||||
)
|
||||
zooming: ZoomingModeEnum = Field(
|
||||
default=ZoomingModeEnum.disabled, title="Autotracker zooming mode."
|
||||
default=ZoomingModeEnum.disabled,
|
||||
title="Zoom mode",
|
||||
description="Control zoom behavior: disabled (pan/tilt only), absolute (most compatible), or relative (concurrent pan/tilt/zoom).",
|
||||
)
|
||||
zoom_factor: float = Field(
|
||||
default=0.3,
|
||||
title="Zooming factor (0.1-0.75).",
|
||||
title="Zoom factor",
|
||||
description="Control zoom level on tracked objects. Lower values keep more scene in view; higher values zoom in closer but may lose tracking. Values between 0.1 and 0.75.",
|
||||
ge=0.1,
|
||||
le=0.75,
|
||||
)
|
||||
track: list[str] = Field(default=DEFAULT_TRACKED_OBJECTS, title="Objects to track.")
|
||||
track: list[str] = Field(
|
||||
default=DEFAULT_TRACKED_OBJECTS,
|
||||
title="Tracked objects",
|
||||
description="List of object types that should trigger autotracking.",
|
||||
)
|
||||
required_zones: list[str] = Field(
|
||||
default_factory=list,
|
||||
title="List of required zones to be entered in order to begin autotracking.",
|
||||
title="Required zones",
|
||||
description="Objects must enter one of these zones before autotracking begins.",
|
||||
)
|
||||
return_preset: str = Field(
|
||||
default="home",
|
||||
title="Name of camera preset to return to when object tracking is over.",
|
||||
title="Return preset",
|
||||
description="ONVIF preset name configured in camera firmware to return to after tracking ends.",
|
||||
)
|
||||
timeout: int = Field(
|
||||
default=10, title="Seconds to delay before returning to preset."
|
||||
default=10,
|
||||
title="Return timeout",
|
||||
description="Wait this many seconds after losing tracking before returning camera to preset position.",
|
||||
)
|
||||
movement_weights: Optional[Union[str, list[str]]] = Field(
|
||||
default_factory=list,
|
||||
title="Internal value used for PTZ movements based on the speed of your camera's motor.",
|
||||
title="Movement weights",
|
||||
description="Calibration values automatically generated by camera calibration. Do not modify manually.",
|
||||
)
|
||||
enabled_in_config: Optional[bool] = Field(
|
||||
default=None, title="Keep track of original state of autotracking."
|
||||
default=None,
|
||||
title="Original autotrack state",
|
||||
description="Internal field to track whether autotracking was enabled in configuration.",
|
||||
)
|
||||
|
||||
@field_validator("movement_weights", mode="before")
|
||||
@@ -72,16 +92,38 @@ class PtzAutotrackConfig(FrigateBaseModel):
|
||||
|
||||
|
||||
class OnvifConfig(FrigateBaseModel):
|
||||
host: str = Field(default="", title="Onvif Host")
|
||||
port: int = Field(default=8000, title="Onvif Port")
|
||||
user: Optional[EnvString] = Field(default=None, title="Onvif Username")
|
||||
password: Optional[EnvString] = Field(default=None, title="Onvif Password")
|
||||
tls_insecure: bool = Field(default=False, title="Onvif Disable TLS verification")
|
||||
host: str = Field(
|
||||
default="",
|
||||
title="ONVIF host",
|
||||
description="Host (and optional scheme) for the ONVIF service for this camera.",
|
||||
)
|
||||
port: int = Field(
|
||||
default=8000,
|
||||
title="ONVIF port",
|
||||
description="Port number for the ONVIF service.",
|
||||
)
|
||||
user: Optional[EnvString] = Field(
|
||||
default=None,
|
||||
title="ONVIF username",
|
||||
description="Username for ONVIF authentication; some devices require admin user for ONVIF.",
|
||||
)
|
||||
password: Optional[EnvString] = Field(
|
||||
default=None,
|
||||
title="ONVIF password",
|
||||
description="Password for ONVIF authentication.",
|
||||
)
|
||||
tls_insecure: bool = Field(
|
||||
default=False,
|
||||
title="Disable TLS verify",
|
||||
description="Skip TLS verification and disable digest auth for ONVIF (unsafe; use in safe networks only).",
|
||||
)
|
||||
autotracking: PtzAutotrackConfig = Field(
|
||||
default_factory=PtzAutotrackConfig,
|
||||
title="PTZ auto tracking config.",
|
||||
title="Autotracking",
|
||||
description="Automatically track moving objects and keep them centered in the frame using PTZ camera movements.",
|
||||
)
|
||||
ignore_time_mismatch: bool = Field(
|
||||
default=False,
|
||||
title="Onvif Ignore Time Synchronization Mismatch Between Camera and Server",
|
||||
title="Ignore time mismatch",
|
||||
description="Ignore time synchronization differences between camera and Frigate server for ONVIF communication.",
|
||||
)
|
||||
|
||||
@@ -21,7 +21,12 @@ __all__ = [
|
||||
|
||||
|
||||
class RecordRetainConfig(FrigateBaseModel):
|
||||
days: float = Field(default=0, ge=0, title="Default retention period.")
|
||||
days: float = Field(
|
||||
default=0,
|
||||
ge=0,
|
||||
title="Retention days",
|
||||
description="Days to retain recordings.",
|
||||
)
|
||||
|
||||
|
||||
class RetainModeEnum(str, Enum):
|
||||
@@ -31,22 +36,37 @@ class RetainModeEnum(str, Enum):
|
||||
|
||||
|
||||
class ReviewRetainConfig(FrigateBaseModel):
|
||||
days: float = Field(default=10, ge=0, title="Default retention period.")
|
||||
mode: RetainModeEnum = Field(default=RetainModeEnum.motion, title="Retain mode.")
|
||||
days: float = Field(
|
||||
default=10,
|
||||
ge=0,
|
||||
title="Retention days",
|
||||
description="Number of days to retain recordings of detection events.",
|
||||
)
|
||||
mode: RetainModeEnum = Field(
|
||||
default=RetainModeEnum.motion,
|
||||
title="Retention mode",
|
||||
description="Mode for retention: all (save all segments), motion (save segments with motion), or active_objects (save segments with active objects).",
|
||||
)
|
||||
|
||||
|
||||
class EventsConfig(FrigateBaseModel):
|
||||
pre_capture: int = Field(
|
||||
default=5,
|
||||
title="Seconds to retain before event starts.",
|
||||
title="Pre-capture seconds",
|
||||
description="Number of seconds before the detection event to include in the recording.",
|
||||
le=MAX_PRE_CAPTURE,
|
||||
ge=0,
|
||||
)
|
||||
post_capture: int = Field(
|
||||
default=5, ge=0, title="Seconds to retain after event ends."
|
||||
default=5,
|
||||
ge=0,
|
||||
title="Post-capture seconds",
|
||||
description="Number of seconds after the detection event to include in the recording.",
|
||||
)
|
||||
retain: ReviewRetainConfig = Field(
|
||||
default_factory=ReviewRetainConfig, title="Event retention settings."
|
||||
default_factory=ReviewRetainConfig,
|
||||
title="Event retention",
|
||||
description="Retention settings for recordings of detection events.",
|
||||
)
|
||||
|
||||
|
||||
@@ -60,43 +80,65 @@ class RecordQualityEnum(str, Enum):
|
||||
|
||||
class RecordPreviewConfig(FrigateBaseModel):
|
||||
quality: RecordQualityEnum = Field(
|
||||
default=RecordQualityEnum.medium, title="Quality of recording preview."
|
||||
default=RecordQualityEnum.medium,
|
||||
title="Preview quality",
|
||||
description="Preview quality level (very_low, low, medium, high, very_high).",
|
||||
)
|
||||
|
||||
|
||||
class RecordExportConfig(FrigateBaseModel):
|
||||
hwaccel_args: Union[str, list[str]] = Field(
|
||||
default="auto", title="Export-specific FFmpeg hardware acceleration arguments."
|
||||
default="auto",
|
||||
title="Export hwaccel args",
|
||||
description="Hardware acceleration args to use for export/transcode operations.",
|
||||
)
|
||||
|
||||
|
||||
class RecordConfig(FrigateBaseModel):
|
||||
enabled: bool = Field(default=False, title="Enable record on all cameras.")
|
||||
enabled: bool = Field(
|
||||
default=False,
|
||||
title="Enable recording",
|
||||
description="Enable or disable recording for all cameras; can be overridden per-camera.",
|
||||
)
|
||||
expire_interval: int = Field(
|
||||
default=60,
|
||||
title="Number of minutes to wait between cleanup runs.",
|
||||
title="Record cleanup interval",
|
||||
description="Minutes between cleanup passes that remove expired recording segments.",
|
||||
)
|
||||
continuous: RecordRetainConfig = Field(
|
||||
default_factory=RecordRetainConfig,
|
||||
title="Continuous recording retention settings.",
|
||||
title="Continuous retention",
|
||||
description="Number of days to retain recordings regardless of tracked objects or motion. Set to 0 if you only want to retain recordings of alerts and detections.",
|
||||
)
|
||||
motion: RecordRetainConfig = Field(
|
||||
default_factory=RecordRetainConfig, title="Motion recording retention settings."
|
||||
default_factory=RecordRetainConfig,
|
||||
title="Motion retention",
|
||||
description="Number of days to retain recordings triggered by motion regardless of tracked objects. Set to 0 if you only want to retain recordings of alerts and detections.",
|
||||
)
|
||||
detections: EventsConfig = Field(
|
||||
default_factory=EventsConfig, title="Detection specific retention settings."
|
||||
default_factory=EventsConfig,
|
||||
title="Detection retention",
|
||||
description="Recording retention settings for detection events including pre/post capture durations.",
|
||||
)
|
||||
alerts: EventsConfig = Field(
|
||||
default_factory=EventsConfig, title="Alert specific retention settings."
|
||||
default_factory=EventsConfig,
|
||||
title="Alert retention",
|
||||
description="Recording retention settings for alert events including pre/post capture durations.",
|
||||
)
|
||||
export: RecordExportConfig = Field(
|
||||
default_factory=RecordExportConfig, title="Recording Export Config"
|
||||
default_factory=RecordExportConfig,
|
||||
title="Export config",
|
||||
description="Settings used when exporting recordings such as timelapse and hardware acceleration.",
|
||||
)
|
||||
preview: RecordPreviewConfig = Field(
|
||||
default_factory=RecordPreviewConfig, title="Recording Preview Config"
|
||||
default_factory=RecordPreviewConfig,
|
||||
title="Preview config",
|
||||
description="Settings controlling the quality of recording previews shown in the UI.",
|
||||
)
|
||||
enabled_in_config: Optional[bool] = Field(
|
||||
default=None, title="Keep track of original state of recording."
|
||||
default=None,
|
||||
title="Original recording state",
|
||||
description="Indicates whether recording was enabled in the original static configuration.",
|
||||
)
|
||||
|
||||
@property
|
||||
|
||||
@@ -21,22 +21,32 @@ DEFAULT_ALERT_OBJECTS = ["person", "car"]
|
||||
class AlertsConfig(FrigateBaseModel):
|
||||
"""Configure alerts"""
|
||||
|
||||
enabled: bool = Field(default=True, title="Enable alerts.")
|
||||
enabled: bool = Field(
|
||||
default=True,
|
||||
title="Enable alerts",
|
||||
description="Enable or disable alert generation for all cameras; can be overridden per-camera.",
|
||||
)
|
||||
|
||||
labels: list[str] = Field(
|
||||
default=DEFAULT_ALERT_OBJECTS, title="Labels to create alerts for."
|
||||
default=DEFAULT_ALERT_OBJECTS,
|
||||
title="Alert labels",
|
||||
description="List of object labels that qualify as alerts (for example: car, person).",
|
||||
)
|
||||
required_zones: Union[str, list[str]] = Field(
|
||||
default_factory=list,
|
||||
title="List of required zones to be entered in order to save the event as an alert.",
|
||||
title="Required zones",
|
||||
description="Zones that an object must enter to be considered an alert; leave empty to allow any zone.",
|
||||
)
|
||||
|
||||
enabled_in_config: Optional[bool] = Field(
|
||||
default=None, title="Keep track of original state of alerts."
|
||||
default=None,
|
||||
title="Original alerts state",
|
||||
description="Tracks whether alerts were originally enabled in the static configuration.",
|
||||
)
|
||||
cutoff_time: int = Field(
|
||||
default=40,
|
||||
title="Time to cutoff alerts after no alert-causing activity has occurred.",
|
||||
title="Alerts cutoff time",
|
||||
description="Seconds to wait after no alert-causing activity before cutting off an alert.",
|
||||
)
|
||||
|
||||
@field_validator("required_zones", mode="before")
|
||||
@@ -51,22 +61,32 @@ class AlertsConfig(FrigateBaseModel):
|
||||
class DetectionsConfig(FrigateBaseModel):
|
||||
"""Configure detections"""
|
||||
|
||||
enabled: bool = Field(default=True, title="Enable detections.")
|
||||
enabled: bool = Field(
|
||||
default=True,
|
||||
title="Enable detections",
|
||||
description="Enable or disable detection events for all cameras; can be overridden per-camera.",
|
||||
)
|
||||
|
||||
labels: Optional[list[str]] = Field(
|
||||
default=None, title="Labels to create detections for."
|
||||
default=None,
|
||||
title="Detection labels",
|
||||
description="List of object labels that qualify as detection events.",
|
||||
)
|
||||
required_zones: Union[str, list[str]] = Field(
|
||||
default_factory=list,
|
||||
title="List of required zones to be entered in order to save the event as a detection.",
|
||||
title="Required zones",
|
||||
description="Zones that an object must enter to be considered a detection; leave empty to allow any zone.",
|
||||
)
|
||||
cutoff_time: int = Field(
|
||||
default=30,
|
||||
title="Time to cutoff detection after no detection-causing activity has occurred.",
|
||||
title="Detections cutoff time",
|
||||
description="Seconds to wait after no detection-causing activity before cutting off a detection.",
|
||||
)
|
||||
|
||||
enabled_in_config: Optional[bool] = Field(
|
||||
default=None, title="Keep track of original state of detections."
|
||||
default=None,
|
||||
title="Original detections state",
|
||||
description="Tracks whether detections were originally enabled in the static configuration.",
|
||||
)
|
||||
|
||||
@field_validator("required_zones", mode="before")
|
||||
@@ -81,27 +101,42 @@ class DetectionsConfig(FrigateBaseModel):
|
||||
class GenAIReviewConfig(FrigateBaseModel):
|
||||
enabled: bool = Field(
|
||||
default=False,
|
||||
title="Enable GenAI descriptions for review items.",
|
||||
title="Enable GenAI descriptions",
|
||||
description="Enable or disable GenAI-generated descriptions and summaries for review items.",
|
||||
)
|
||||
alerts: bool = Field(
|
||||
default=True,
|
||||
title="Enable GenAI for alerts",
|
||||
description="Use GenAI to generate descriptions for alert items.",
|
||||
)
|
||||
detections: bool = Field(
|
||||
default=False,
|
||||
title="Enable GenAI for detections",
|
||||
description="Use GenAI to generate descriptions for detection items.",
|
||||
)
|
||||
alerts: bool = Field(default=True, title="Enable GenAI for alerts.")
|
||||
detections: bool = Field(default=False, title="Enable GenAI for detections.")
|
||||
image_source: ImageSourceEnum = Field(
|
||||
default=ImageSourceEnum.preview,
|
||||
title="Image source for review descriptions.",
|
||||
title="Review image source",
|
||||
description="Source of images sent to GenAI ('preview' or 'recordings'); 'recordings' uses higher quality frames but more tokens.",
|
||||
)
|
||||
additional_concerns: list[str] = Field(
|
||||
default=[],
|
||||
title="Additional concerns that GenAI should make note of on this camera.",
|
||||
title="Additional concerns",
|
||||
description="A list of additional concerns or notes the GenAI should consider when evaluating activity on this camera.",
|
||||
)
|
||||
debug_save_thumbnails: bool = Field(
|
||||
default=False,
|
||||
title="Save thumbnails sent to generative AI for debugging purposes.",
|
||||
title="Save thumbnails",
|
||||
description="Save thumbnails that are sent to the GenAI provider for debugging and review.",
|
||||
)
|
||||
enabled_in_config: Optional[bool] = Field(
|
||||
default=None, title="Keep track of original state of generative AI."
|
||||
default=None,
|
||||
title="Original GenAI state",
|
||||
description="Tracks whether GenAI review was originally enabled in the static configuration.",
|
||||
)
|
||||
preferred_language: str | None = Field(
|
||||
title="Preferred language for GenAI Response",
|
||||
title="Preferred language",
|
||||
description="Preferred language to request from the GenAI provider for generated responses.",
|
||||
default=None,
|
||||
)
|
||||
activity_context_prompt: str = Field(
|
||||
@@ -139,19 +174,24 @@ Evaluate in this order:
|
||||
3. **Escalate to Level 2 if:** Weapons, break-in tools, forced entry in progress, violence, or active property damage visible (escalates from Level 0 or 1)
|
||||
|
||||
The mere presence of an unidentified person in private areas during late night hours is inherently suspicious and warrants human review, regardless of what activity they appear to be doing or how brief the sequence is.""",
|
||||
title="Custom activity context prompt defining normal and suspicious activity patterns for this property.",
|
||||
title="Activity context prompt",
|
||||
description="Custom prompt describing what is and is not suspicious activity to provide context for GenAI summaries.",
|
||||
)
|
||||
|
||||
|
||||
class ReviewConfig(FrigateBaseModel):
|
||||
"""Configure reviews"""
|
||||
|
||||
alerts: AlertsConfig = Field(
|
||||
default_factory=AlertsConfig, title="Review alerts config."
|
||||
default_factory=AlertsConfig,
|
||||
title="Alerts config",
|
||||
description="Settings for which tracked objects generate alerts and how alerts are retained.",
|
||||
)
|
||||
detections: DetectionsConfig = Field(
|
||||
default_factory=DetectionsConfig, title="Review detections config."
|
||||
default_factory=DetectionsConfig,
|
||||
title="Detections config",
|
||||
description="Settings for creating detection events (non-alert) and how long to keep them.",
|
||||
)
|
||||
genai: GenAIReviewConfig = Field(
|
||||
default_factory=GenAIReviewConfig, title="Review description genai config."
|
||||
default_factory=GenAIReviewConfig,
|
||||
title="GenAI config",
|
||||
description="Controls use of generative AI for producing descriptions and summaries of review items.",
|
||||
)
|
||||
|
||||
@@ -9,36 +9,68 @@ __all__ = ["SnapshotsConfig", "RetainConfig"]
|
||||
|
||||
|
||||
class RetainConfig(FrigateBaseModel):
|
||||
default: float = Field(default=10, title="Default retention period.")
|
||||
mode: RetainModeEnum = Field(default=RetainModeEnum.motion, title="Retain mode.")
|
||||
default: float = Field(
|
||||
default=10,
|
||||
title="Default retention",
|
||||
description="Default number of days to retain snapshots.",
|
||||
)
|
||||
mode: RetainModeEnum = Field(
|
||||
default=RetainModeEnum.motion,
|
||||
title="Retention mode",
|
||||
description="Mode for retention: all (save all segments), motion (save segments with motion), or active_objects (save segments with active objects).",
|
||||
)
|
||||
objects: dict[str, float] = Field(
|
||||
default_factory=dict, title="Object retention period."
|
||||
default_factory=dict,
|
||||
title="Object retention",
|
||||
description="Per-object overrides for snapshot retention days.",
|
||||
)
|
||||
|
||||
|
||||
class SnapshotsConfig(FrigateBaseModel):
|
||||
enabled: bool = Field(default=False, title="Snapshots enabled.")
|
||||
enabled: bool = Field(
|
||||
default=False,
|
||||
title="Snapshots enabled",
|
||||
description="Enable or disable saving snapshots for all cameras; can be overridden per-camera.",
|
||||
)
|
||||
clean_copy: bool = Field(
|
||||
default=True, title="Create a clean copy of the snapshot image."
|
||||
default=True,
|
||||
title="Save clean copy",
|
||||
description="Save an unannotated clean copy of snapshots in addition to annotated ones.",
|
||||
)
|
||||
timestamp: bool = Field(
|
||||
default=False, title="Add a timestamp overlay on the snapshot."
|
||||
default=False,
|
||||
title="Timestamp overlay",
|
||||
description="Overlay a timestamp on saved snapshots.",
|
||||
)
|
||||
bounding_box: bool = Field(
|
||||
default=True, title="Add a bounding box overlay on the snapshot."
|
||||
default=True,
|
||||
title="Bounding box overlay",
|
||||
description="Draw bounding boxes for tracked objects on saved snapshots.",
|
||||
)
|
||||
crop: bool = Field(
|
||||
default=False,
|
||||
title="Crop snapshot",
|
||||
description="Crop saved snapshots to the detected object's bounding box.",
|
||||
)
|
||||
crop: bool = Field(default=False, title="Crop the snapshot to the detected object.")
|
||||
required_zones: list[str] = Field(
|
||||
default_factory=list,
|
||||
title="List of required zones to be entered in order to save a snapshot.",
|
||||
title="Required zones",
|
||||
description="Zones an object must enter for a snapshot to be saved.",
|
||||
)
|
||||
height: Optional[int] = Field(
|
||||
default=None,
|
||||
title="Snapshot height",
|
||||
description="Height (pixels) to resize saved snapshots to; leave empty to preserve original size.",
|
||||
)
|
||||
height: Optional[int] = Field(default=None, title="Snapshot image height.")
|
||||
retain: RetainConfig = Field(
|
||||
default_factory=RetainConfig, title="Snapshot retention."
|
||||
default_factory=RetainConfig,
|
||||
title="Snapshot retention",
|
||||
description="Retention settings for saved snapshots including default days and per-object overrides.",
|
||||
)
|
||||
quality: int = Field(
|
||||
default=70,
|
||||
title="Quality of the encoded jpeg (0-100).",
|
||||
title="JPEG quality",
|
||||
description="JPEG encode quality for saved snapshots (0-100).",
|
||||
ge=0,
|
||||
le=100,
|
||||
)
|
||||
|
||||
@@ -27,9 +27,27 @@ class TimestampPositionEnum(str, Enum):
|
||||
|
||||
|
||||
class ColorConfig(FrigateBaseModel):
|
||||
red: int = Field(default=255, ge=0, le=255, title="Red")
|
||||
green: int = Field(default=255, ge=0, le=255, title="Green")
|
||||
blue: int = Field(default=255, ge=0, le=255, title="Blue")
|
||||
red: int = Field(
|
||||
default=255,
|
||||
ge=0,
|
||||
le=255,
|
||||
title="Red",
|
||||
description="Red component (0-255) for timestamp color.",
|
||||
)
|
||||
green: int = Field(
|
||||
default=255,
|
||||
ge=0,
|
||||
le=255,
|
||||
title="Green",
|
||||
description="Green component (0-255) for timestamp color.",
|
||||
)
|
||||
blue: int = Field(
|
||||
default=255,
|
||||
ge=0,
|
||||
le=255,
|
||||
title="Blue",
|
||||
description="Blue component (0-255) for timestamp color.",
|
||||
)
|
||||
|
||||
|
||||
class TimestampEffectEnum(str, Enum):
|
||||
@@ -39,11 +57,27 @@ class TimestampEffectEnum(str, Enum):
|
||||
|
||||
class TimestampStyleConfig(FrigateBaseModel):
|
||||
position: TimestampPositionEnum = Field(
|
||||
default=TimestampPositionEnum.tl, title="Timestamp position."
|
||||
default=TimestampPositionEnum.tl,
|
||||
title="Timestamp position",
|
||||
description="Position of the timestamp on the image (tl/tr/bl/br).",
|
||||
)
|
||||
format: str = Field(
|
||||
default=DEFAULT_TIME_FORMAT,
|
||||
title="Timestamp format",
|
||||
description="Datetime format string used for timestamps (Python datetime format codes).",
|
||||
)
|
||||
color: ColorConfig = Field(
|
||||
default_factory=ColorConfig,
|
||||
title="Timestamp color",
|
||||
description="RGB color values for the timestamp text (all values 0-255).",
|
||||
)
|
||||
thickness: int = Field(
|
||||
default=2,
|
||||
title="Timestamp thickness",
|
||||
description="Line thickness of the timestamp text.",
|
||||
)
|
||||
format: str = Field(default=DEFAULT_TIME_FORMAT, title="Timestamp format.")
|
||||
color: ColorConfig = Field(default_factory=ColorConfig, title="Timestamp color.")
|
||||
thickness: int = Field(default=2, title="Timestamp thickness.")
|
||||
effect: Optional[TimestampEffectEnum] = Field(
|
||||
default=None, title="Timestamp effect."
|
||||
default=None,
|
||||
title="Timestamp effect",
|
||||
description="Visual effect for the timestamp text (none, solid, shadow).",
|
||||
)
|
||||
|
||||
@@ -6,7 +6,13 @@ __all__ = ["CameraUiConfig"]
|
||||
|
||||
|
||||
class CameraUiConfig(FrigateBaseModel):
|
||||
order: int = Field(default=0, title="Order of camera in UI.")
|
||||
order: int = Field(
|
||||
default=0,
|
||||
title="UI order",
|
||||
description="Numeric order used to sort the camera in the UI (default dashboard and lists); larger numbers appear later.",
|
||||
)
|
||||
dashboard: bool = Field(
|
||||
default=True, title="Show this camera in Frigate dashboard UI."
|
||||
default=True,
|
||||
title="Show in UI",
|
||||
description="Toggle whether this camera is visible everywhere in the Frigate UI. Disabling this will require manually editing the config to view this camera in the UI again.",
|
||||
)
|
||||
|
||||
@@ -14,36 +14,46 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
class ZoneConfig(BaseModel):
|
||||
friendly_name: Optional[str] = Field(
|
||||
None, title="Zone friendly name used in the Frigate UI."
|
||||
None,
|
||||
title="Zone name",
|
||||
description="A user-friendly name for the zone, displayed in the Frigate UI. If not set, a formatted version of the zone name will be used.",
|
||||
)
|
||||
filters: dict[str, FilterConfig] = Field(
|
||||
default_factory=dict, title="Zone filters."
|
||||
default_factory=dict,
|
||||
title="Zone filters",
|
||||
description="Filters to apply to objects within this zone. Used to reduce false positives or restrict which objects are considered present in the zone.",
|
||||
)
|
||||
coordinates: Union[str, list[str]] = Field(
|
||||
title="Coordinates polygon for the defined zone."
|
||||
title="Coordinates",
|
||||
description="Polygon coordinates that define the zone area. Can be a comma-separated string or a list of coordinate strings. Coordinates should be relative (0-1) or absolute (legacy).",
|
||||
)
|
||||
distances: Optional[Union[str, list[str]]] = Field(
|
||||
default_factory=list,
|
||||
title="Real-world distances for the sides of quadrilateral for the defined zone.",
|
||||
title="Real-world distances",
|
||||
description="Optional real-world distances for each side of the zone quadrilateral, used for speed or distance calculations. Must have exactly 4 values if set.",
|
||||
)
|
||||
inertia: int = Field(
|
||||
default=3,
|
||||
title="Number of consecutive frames required for object to be considered present in the zone.",
|
||||
title="Inertia frames",
|
||||
gt=0,
|
||||
description="Number of consecutive frames an object must be detected in the zone before it is considered present. Helps filter out transient detections.",
|
||||
)
|
||||
loitering_time: int = Field(
|
||||
default=0,
|
||||
ge=0,
|
||||
title="Number of seconds that an object must loiter to be considered in the zone.",
|
||||
title="Loitering seconds",
|
||||
description="Number of seconds an object must remain in the zone to be considered as loitering. Set to 0 to disable loitering detection.",
|
||||
)
|
||||
speed_threshold: Optional[float] = Field(
|
||||
default=None,
|
||||
ge=0.1,
|
||||
title="Minimum speed value for an object to be considered in the zone.",
|
||||
title="Minimum speed",
|
||||
description="Minimum speed (in real-world units if distances are set) required for an object to be considered present in the zone. Used for speed-based zone triggers.",
|
||||
)
|
||||
objects: Union[str, list[str]] = Field(
|
||||
default_factory=list,
|
||||
title="List of objects that can trigger the zone.",
|
||||
title="Trigger objects",
|
||||
description="List of object types (from labelmap) that can trigger this zone. Can be a string or a list of strings. If empty, all objects are considered.",
|
||||
)
|
||||
_color: Optional[tuple[int, int, int]] = PrivateAttr()
|
||||
_contour: np.ndarray = PrivateAttr()
|
||||
|
||||
Reference in New Issue
Block a user