Compare commits

..
Author SHA1 Message Date
dependabot[bot]andGitHub ea447e53e6 Bump body-parser from 1.20.4 to 1.20.6 in /docs
Bumps [body-parser](https://github.com/expressjs/body-parser) from 1.20.4 to 1.20.6.
- [Release notes](https://github.com/expressjs/body-parser/releases)
- [Changelog](https://github.com/expressjs/body-parser/blob/master/HISTORY.md)
- [Commits](https://github.com/expressjs/body-parser/compare/1.20.4...1.20.6)

---
updated-dependencies:
- dependency-name: body-parser
  dependency-version: 1.20.6
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-25 13:21:18 +00:00
Josh HawkinsandGitHub 12dd242151 Miscellaneous fixes (0.18 beta) (#23809)
* fix calendars greying out the current day after midnight

The cutoff for disabling future days was computed with setHours(getHours() + 24, -1, 0, 0), which is not "24 hours from now" but tomorrow at the current hour minus one minute. Between 00:00 and 00:59 that lands back on today, and react-day-picker matches range matchers by calendar day, so today itself was disabled, leaving the export dialog's start time stuck on the previous day. TimezoneAwareCalendar also added the configured timezone's raw UTC offset instead of its difference from the browser's, widening the broken window to several hours in negative-offset zones and letting future days through in positive-offset ones. Derive the current date in the display timezone once, then build each cutoff in the space its calendar uses: ReviewActivityCalendar passes timeZone to react-day-picker so its day cells are TZDate and need a real instant, while TimezoneAwareCalendar is handed pre-shifted dates and needs a local one. Also corrects the today prop, which was off by the browser's offset, and the truthiness check that treated a configured timezone of UTC as unset.

* pin react-zoom-pan-pinch to 3.6.1

3.7.0 attaches a ResizeObserver to the transform wrapper and content unconditionally and clamps the pan position into the current bounds on every resize. The history player hides itself with display:none while scrubbing and while a new hour of recordings loads, so the observer measures it as 0x0, collapses the bounds to zero, and snaps a zoomed in view back to the top left corner. Zoom scale survives, only the position is lost.

That observer was only created for centerOnInit in 3.4.4 through 3.6.1 and 4.0.0 reverted it again, so 3.7.0 is the only affected release. The caret is what picked it up during the React 19 upgrade, so pin the version exactly.

Reported in #23807
2026-07-25 07:19:58 -06:00
Josh HawkinsandGitHub a573ea49bf update icons and i18n for 2026.2 frigate+ labels (#23803)
CI / AMD64 Build (push) Canceled after 0s
CI / ARM Build (push) Canceled after 0s
CI / Jetson Jetpack 6 (push) Canceled after 0s
CI / AMD64 Extra Build (push) Canceled after 0s
CI / ARM Extra Build (push) Canceled after 0s
CI / Synaptics Build (push) Canceled after 0s
CI / Assemble and push default build (push) Canceled after 0s
2026-07-24 16:15:58 -05:00
9f918362e9 Miscellaneous fixes (0.18 beta) (#23790)
CI / AMD64 Build (push) Canceled after 0s
CI / ARM Build (push) Canceled after 0s
CI / Jetson Jetpack 6 (push) Canceled after 0s
CI / AMD64 Extra Build (push) Canceled after 0s
CI / ARM Extra Build (push) Canceled after 0s
CI / Synaptics Build (push) Canceled after 0s
CI / Assemble and push default build (push) Canceled after 0s
* recreate review thumbnail directory before writing and log write failures

cleanup's remove_empty_directories() can rmdir an empty clips/review, after which thumbnail writes silently fail. Ensure the directory exists before both cv2.imwrite calls and check their return value

* add docs for add camera wizard

* Handle indefinite events when a segment needs to forcibly be ended for a ceamera

* update keyframe interval article link

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2026-07-24 10:08:21 -06:00
60 changed files with 683 additions and 1144 deletions
+212 -236
View File
@@ -34,13 +34,12 @@ edgeTPU:
type: edgetpu
device: usb
models:
default:
model_type: yolo-generic
width: 320 # <--- should match the imgsize of the model, typically 320
height: 320 # <--- should match the imgsize of the model, typically 320
path: /config/model_cache/yolov9-s-relu6-best_320_int8_edgetpu.tflite
labelmap_path: /config/labels-coco17.txt
model:
model_type: yolo-generic
width: 320 # <--- should match the imgsize of the model, typically 320
height: 320 # <--- should match the imgsize of the model, typically 320
path: /config/model_cache/yolov9-s-relu6-best_320_int8_edgetpu.tflite
labelmap_path: /config/labels-coco17.txt
hailo8l:
title: Hailo-8/Hailo-8L
models:
@@ -68,28 +67,27 @@ hailo8l:
type: hailo8l
device: PCIe
models:
default:
width: 320
height: 320
input_tensor: nhwc
input_pixel_format: rgb
input_dtype: int
model_type: yolo-generic
labelmap_path: /labelmap/coco-80.txt
model:
width: 320
height: 320
input_tensor: nhwc
input_pixel_format: rgb
input_dtype: int
model_type: yolo-generic
labelmap_path: /labelmap/coco-80.txt
# The detector automatically selects the default model based on your hardware:
# - For Hailo-8 hardware: YOLOv6n (default: yolov6n.hef)
# - For Hailo-8L hardware: YOLOv6n (default: yolov6n.hef)
#
# Optionally, you can specify a local model path to override the default.
# If a local path is provided and the file exists, it will be used instead of downloading.
# Example:
# path: /config/model_cache/hailo/yolov6n.hef
#
# You can also override using a custom URL:
# path: https://hailo-model-zoo.s3.eu-west-2.amazonaws.com/ModelZoo/Compiled/v2.14.0/hailo8/yolov6n.hef
# just make sure to give it the write configuration based on the model
# The detector automatically selects the default model based on your hardware:
# - For Hailo-8 hardware: YOLOv6n (default: yolov6n.hef)
# - For Hailo-8L hardware: YOLOv6n (default: yolov6n.hef)
#
# Optionally, you can specify a local model path to override the default.
# If a local path is provided and the file exists, it will be used instead of downloading.
# Example:
# path: /config/model_cache/hailo/yolov6n.hef
#
# You can also override using a custom URL:
# path: https://hailo-model-zoo.s3.eu-west-2.amazonaws.com/ModelZoo/Compiled/v2.14.0/hailo8/yolov6n.hef
# just make sure to give it the write configuration based on the model
- key: ssd
label: SSD MobileNet v1
recommended: false
@@ -113,19 +111,18 @@ hailo8l:
type: hailo8l
device: PCIe
models:
default:
width: 300
height: 300
input_tensor: nhwc
input_pixel_format: rgb
model_type: ssd
# Specify the local model path (if available) or URL for SSD MobileNet v1.
# Example with a local path:
# path: /config/model_cache/h8l_cache/ssd_mobilenet_v1.hef
#
# Or override using a custom URL:
# path: https://hailo-model-zoo.s3.eu-west-2.amazonaws.com/ModelZoo/Compiled/v2.14.0/hailo8l/ssd_mobilenet_v1.hef
model:
width: 300
height: 300
input_tensor: nhwc
input_pixel_format: rgb
model_type: ssd
# Specify the local model path (if available) or URL for SSD MobileNet v1.
# Example with a local path:
# path: /config/model_cache/h8l_cache/ssd_mobilenet_v1.hef
#
# Or override using a custom URL:
# path: https://hailo-model-zoo.s3.eu-west-2.amazonaws.com/ModelZoo/Compiled/v2.14.0/hailo8l/ssd_mobilenet_v1.hef
openvino:
title: OpenVINO
models:
@@ -174,15 +171,14 @@ openvino:
type: openvino
device: GPU # or NPU
models:
default:
model_type: yolo-generic
width: 320 # <--- should match the imgsize set during model export
height: 320 # <--- should match the imgsize set during model export
input_tensor: nchw
input_dtype: float
path: /config/model_cache/yolo.onnx # use the filename you generated above
labelmap_path: /labelmap/coco-80.txt
model:
model_type: yolo-generic
width: 320 # <--- should match the imgsize set during model export
height: 320 # <--- should match the imgsize set during model export
input_tensor: nchw
input_dtype: float
path: /config/model_cache/yolo.onnx # use the filename you generated above
labelmap_path: /labelmap/coco-80.txt
- key: ssd
label: SSDLite MobileNet v2
recommended: false
@@ -206,14 +202,13 @@ openvino:
type: openvino
device: GPU # Or NPU
models:
default:
width: 300
height: 300
input_tensor: nhwc
input_pixel_format: bgr
path: /openvino-model/ssdlite_mobilenet_v2.xml
labelmap_path: /openvino-model/coco_91cl_bkgr.txt
model:
width: 300
height: 300
input_tensor: nhwc
input_pixel_format: bgr
path: /openvino-model/ssdlite_mobilenet_v2.xml
labelmap_path: /openvino-model/coco_91cl_bkgr.txt
- key: yolo-legacy
label: YOLO (v3, v4, v7)
recommended: false
@@ -245,15 +240,14 @@ openvino:
type: openvino
device: GPU # or NPU
models:
default:
model_type: yolo-generic
width: 320 # <--- should match the imgsize set during model export
height: 320 # <--- should match the imgsize set during model export
input_tensor: nchw
input_dtype: float
path: /config/model_cache/yolo.onnx # use the filename you generated above
labelmap_path: /labelmap/coco-80.txt
model:
model_type: yolo-generic
width: 320 # <--- should match the imgsize set during model export
height: 320 # <--- should match the imgsize set during model export
input_tensor: nchw
input_dtype: float
path: /config/model_cache/yolo.onnx # use the filename you generated above
labelmap_path: /labelmap/coco-80.txt
- key: yolonas
label: YOLO-NAS
recommended: false
@@ -286,15 +280,14 @@ openvino:
type: openvino
device: GPU
models:
default:
model_type: yolonas
width: 320 # <--- should match whatever was set in notebook
height: 320 # <--- should match whatever was set in notebook
input_tensor: nchw
input_pixel_format: bgr
path: /config/yolo_nas_s.onnx
labelmap_path: /labelmap/coco-80.txt
model:
model_type: yolonas
width: 320 # <--- should match whatever was set in notebook
height: 320 # <--- should match whatever was set in notebook
input_tensor: nchw
input_pixel_format: bgr
path: /config/yolo_nas_s.onnx
labelmap_path: /labelmap/coco-80.txt
- key: yolox
label: YOLOX
recommended: false
@@ -315,11 +308,10 @@ openvino:
type: openvino
device: GPU
models:
default:
model_type: yolox
path: /config/model_cache/yolox.onnx # use the filename you generated above
labelmap_path: /labelmap/coco-80.txt
model:
model_type: yolox
path: /config/model_cache/yolox.onnx # use the filename you generated above
labelmap_path: /labelmap/coco-80.txt
- key: rfdetr
label: RF-DETR
recommended: false
@@ -358,14 +350,13 @@ openvino:
type: openvino
device: GPU
models:
default:
model_type: rfdetr
width: 320
height: 320
input_tensor: nchw
input_dtype: float
path: /config/model_cache/rfdetr.onnx # use the filename you generated above
model:
model_type: rfdetr
width: 320
height: 320
input_tensor: nchw
input_dtype: float
path: /config/model_cache/rfdetr.onnx # use the filename you generated above
- key: dfine
label: D-FINE / DEIMv2
recommended: false
@@ -457,15 +448,14 @@ openvino:
type: openvino
device: CPU
models:
default:
model_type: dfine
width: 640
height: 640
input_tensor: nchw
input_dtype: float
path: /config/model_cache/dfine-s.onnx # use the filename you generated above
labelmap_path: /labelmap/coco-80.txt
model:
model_type: dfine
width: 640
height: 640
input_tensor: nchw
input_dtype: float
path: /config/model_cache/dfine-s.onnx # use the filename you generated above
labelmap_path: /labelmap/coco-80.txt
appleSilicon:
title: Apple Silicon
models:
@@ -514,15 +504,14 @@ appleSilicon:
type: zmq
endpoint: tcp://host.docker.internal:5555
models:
default:
model_type: yolo-generic
width: 320 # <--- should match the imgsize set during model export
height: 320 # <--- should match the imgsize set during model export
input_tensor: nchw
input_dtype: float
path: /config/model_cache/yolo.onnx # use the filename you generated above
labelmap_path: /labelmap/coco-80.txt
model:
model_type: yolo-generic
width: 320 # <--- should match the imgsize set during model export
height: 320 # <--- should match the imgsize set during model export
input_tensor: nchw
input_dtype: float
path: /config/model_cache/yolo.onnx # use the filename you generated above
labelmap_path: /labelmap/coco-80.txt
- key: yolo-legacy
label: YOLO (v3, v4, v7)
recommended: false
@@ -554,15 +543,14 @@ appleSilicon:
type: zmq
endpoint: tcp://host.docker.internal:5555
models:
default:
model_type: yolo-generic
width: 320 # <--- should match the imgsize set during model export
height: 320 # <--- should match the imgsize set during model export
input_tensor: nchw
input_dtype: float
path: /config/model_cache/yolo.onnx # use the filename you generated above
labelmap_path: /labelmap/coco-80.txt
model:
model_type: yolo-generic
width: 320 # <--- should match the imgsize set during model export
height: 320 # <--- should match the imgsize set during model export
input_tensor: nchw
input_dtype: float
path: /config/model_cache/yolo.onnx # use the filename you generated above
labelmap_path: /labelmap/coco-80.txt
onnx:
title: ONNX
models:
@@ -610,15 +598,14 @@ onnx:
onnx:
type: onnx
models:
default:
model_type: yolo-generic
width: 320 # <--- should match the imgsize set during model export
height: 320 # <--- should match the imgsize set during model export
input_tensor: nchw
input_dtype: float
path: /config/model_cache/yolo.onnx # use the filename you generated above
labelmap_path: /labelmap/coco-80.txt
model:
model_type: yolo-generic
width: 320 # <--- should match the imgsize set during model export
height: 320 # <--- should match the imgsize set during model export
input_tensor: nchw
input_dtype: float
path: /config/model_cache/yolo.onnx # use the filename you generated above
labelmap_path: /labelmap/coco-80.txt
- key: rfdetr
label: RF-DETR
recommended: false
@@ -656,14 +643,13 @@ onnx:
onnx:
type: onnx
models:
default:
model_type: rfdetr
width: 320
height: 320
input_tensor: nchw
input_dtype: float
path: /config/model_cache/rfdetr.onnx # use the filename you generated above
model:
model_type: rfdetr
width: 320
height: 320
input_tensor: nchw
input_dtype: float
path: /config/model_cache/rfdetr.onnx # use the filename you generated above
- key: yolonas
label: YOLO-NAS
recommended: false
@@ -695,15 +681,14 @@ onnx:
onnx:
type: onnx
models:
default:
model_type: yolonas
width: 320 # <--- should match whatever was set in notebook
height: 320 # <--- should match whatever was set in notebook
input_pixel_format: bgr
input_tensor: nchw
path: /config/yolo_nas_s.onnx
labelmap_path: /labelmap/coco-80.txt
model:
model_type: yolonas
width: 320 # <--- should match whatever was set in notebook
height: 320 # <--- should match whatever was set in notebook
input_pixel_format: bgr
input_tensor: nchw
path: /config/yolo_nas_s.onnx
labelmap_path: /labelmap/coco-80.txt
- key: yolox
label: YOLOX
recommended: false
@@ -726,15 +711,14 @@ onnx:
onnx:
type: onnx
models:
default:
model_type: yolox
width: 416 # <--- should match the imgsize set during model export
height: 416 # <--- should match the imgsize set during model export
input_tensor: nchw
input_dtype: float_denorm
path: /config/model_cache/yolox_tiny.onnx # use the filename you generated above
labelmap_path: /labelmap/coco-80.txt
model:
model_type: yolox
width: 416 # <--- should match the imgsize set during model export
height: 416 # <--- should match the imgsize set during model export
input_tensor: nchw
input_dtype: float_denorm
path: /config/model_cache/yolox_tiny.onnx # use the filename you generated above
labelmap_path: /labelmap/coco-80.txt
- key: dfine
label: D-FINE / DEIMv2
recommended: false
@@ -825,15 +809,14 @@ onnx:
onnx:
type: onnx
models:
default:
model_type: dfine
width: 640
height: 640
input_tensor: nchw
input_dtype: float
path: /config/model_cache/dfine_m_obj2coco.onnx # use the filename you generated above
labelmap_path: /labelmap/coco-80.txt
model:
model_type: dfine
width: 640
height: 640
input_tensor: nchw
input_dtype: float
path: /config/model_cache/dfine_m_obj2coco.onnx # use the filename you generated above
labelmap_path: /labelmap/coco-80.txt
- key: yolo-legacy
label: YOLO (v3, v4, v7)
recommended: false
@@ -864,15 +847,14 @@ onnx:
onnx:
type: onnx
models:
default:
model_type: yolo-generic
width: 320 # <--- should match the imgsize set during model export
height: 320 # <--- should match the imgsize set during model export
input_tensor: nchw
input_dtype: float
path: /config/model_cache/yolo.onnx # use the filename you generated above
labelmap_path: /labelmap/coco-80.txt
model:
model_type: yolo-generic
width: 320 # <--- should match the imgsize set during model export
height: 320 # <--- should match the imgsize set during model export
input_tensor: nchw
input_dtype: float
path: /config/model_cache/yolo.onnx # use the filename you generated above
labelmap_path: /labelmap/coco-80.txt
cpu:
title: CPU
models:
@@ -946,19 +928,18 @@ memryx:
type: memryx
device: PCIe:0
models:
default:
model_type: yolonas
width: 320 # (Can be set to 640 for higher resolution)
height: 320 # (Can be set to 640 for higher resolution)
input_tensor: nchw
input_dtype: float
labelmap_path: /labelmap/coco-80.txt
# Optional: The model is normally fetched through the runtime, so 'path' can be omitted unless you want to use a custom or local model.
# path: /config/yolonas.zip
# The .zip file must contain:
# ── yolonas.dfp (a file ending with .dfp)
# └── yolonas_post.onnx (optional; only if the model includes a cropped post-processing network)
model:
model_type: yolonas
width: 320 # (Can be set to 640 for higher resolution)
height: 320 # (Can be set to 640 for higher resolution)
input_tensor: nchw
input_dtype: float
labelmap_path: /labelmap/coco-80.txt
# Optional: The model is normally fetched through the runtime, so 'path' can be omitted unless you want to use a custom or local model.
# path: /config/yolonas.zip
# The .zip file must contain:
# ├── yolonas.dfp (a file ending with .dfp)
# ── yolonas_post.onnx (optional; only if the model includes a cropped post-processing network)
- key: yolov9
label: YOLOv9
recommended: false
@@ -984,18 +965,17 @@ memryx:
type: memryx
device: PCIe:0
models:
default:
model_type: yolo-generic
width: 320 # (Can be set to 640 for higher resolution)
height: 320 # (Can be set to 640 for higher resolution)
input_tensor: nchw
input_dtype: float
labelmap_path: /labelmap/coco-80.txt
# Optional: The model is normally fetched through the runtime, so 'path' can be omitted unless you want to use a custom or local model.
# path: /config/yolov9.zip
# The .zip file must contain:
# ├── yolov9.dfp (a file ending with .dfp)
model:
model_type: yolo-generic
width: 320 # (Can be set to 640 for higher resolution)
height: 320 # (Can be set to 640 for higher resolution)
input_tensor: nchw
input_dtype: float
labelmap_path: /labelmap/coco-80.txt
# Optional: The model is normally fetched through the runtime, so 'path' can be omitted unless you want to use a custom or local model.
# path: /config/yolov9.zip
# The .zip file must contain:
# ├── yolov9.dfp (a file ending with .dfp)
- key: yolox
label: YOLOX
recommended: false
@@ -1021,18 +1001,17 @@ memryx:
type: memryx
device: PCIe:0
models:
default:
model_type: yolox
width: 640
height: 640
input_tensor: nchw
input_dtype: float_denorm
labelmap_path: /labelmap/coco-80.txt
# Optional: The model is normally fetched through the runtime, so 'path' can be omitted unless you want to use a custom or local model.
# path: /config/yolox.zip
# The .zip file must contain:
# ├── yolox.dfp (a file ending with .dfp)
model:
model_type: yolox
width: 640
height: 640
input_tensor: nchw
input_dtype: float_denorm
labelmap_path: /labelmap/coco-80.txt
# Optional: The model is normally fetched through the runtime, so 'path' can be omitted unless you want to use a custom or local model.
# path: /config/yolox.zip
# The .zip file must contain:
# ├── yolox.dfp (a file ending with .dfp)
- key: ssd
label: SSDLite MobileNet v2
recommended: false
@@ -1058,19 +1037,18 @@ memryx:
type: memryx
device: PCIe:0
models:
default:
model_type: ssd
width: 320
height: 320
input_tensor: nchw
input_dtype: float
labelmap_path: /labelmap/coco-80.txt
# Optional: The model is normally fetched through the runtime, so 'path' can be omitted unless you want to use a custom or local model.
# path: /config/ssdlite_mobilenet.zip
# The .zip file must contain:
# ── ssdlite_mobilenet.dfp (a file ending with .dfp)
# └── ssdlite_mobilenet_post.onnx (optional; only if the model includes a cropped post-processing network)
model:
model_type: ssd
width: 320
height: 320
input_tensor: nchw
input_dtype: float
labelmap_path: /labelmap/coco-80.txt
# Optional: The model is normally fetched through the runtime, so 'path' can be omitted unless you want to use a custom or local model.
# path: /config/ssdlite_mobilenet.zip
# The .zip file must contain:
# ├── ssdlite_mobilenet.dfp (a file ending with .dfp)
# ── ssdlite_mobilenet_post.onnx (optional; only if the model includes a cropped post-processing network)
tensorrt:
title: TensorRT
models:
@@ -1109,14 +1087,13 @@ tensorrt:
type: tensorrt
device: 0 #This is the default, select the first GPU
models:
default:
path: /config/model_cache/tensorrt/yolov7-320.trt # use the filename you generated above
labelmap_path: /labelmap/coco-80.txt
input_tensor: nchw
input_pixel_format: rgb
width: 320 # MUST match the chosen model i.e yolov7-320 -> 320, yolov4-416 -> 416
height: 320 # MUST match the chosen model i.e yolov7-320 -> 320 yolov4-416 -> 416
model:
path: /config/model_cache/tensorrt/yolov7-320.trt # use the filename you generated above
labelmap_path: /labelmap/coco-80.txt
input_tensor: nchw
input_pixel_format: rgb
width: 320 # MUST match the chosen model i.e yolov7-320 -> 320, yolov4-416 -> 416
height: 320 # MUST match the chosen model i.e yolov7-320 -> 320 yolov4-416 -> 416
synaptics:
title: Synaptics
models:
@@ -1284,15 +1261,14 @@ axengine:
axengine:
type: axengine
models:
default:
path: frigate-yolov9-tiny
model_type: yolo-generic
width: 320
height: 320
input_dtype: int
input_pixel_format: bgr
labelmap_path: /labelmap/coco-80.txt
model:
path: frigate-yolov9-tiny
model_type: yolo-generic
width: 320
height: 320
input_dtype: int
input_pixel_format: bgr
labelmap_path: /labelmap/coco-80.txt
degirumAiServer:
title: DeGirum AI Server
models:
+36 -46
View File
@@ -157,51 +157,44 @@ auth:
- front_door
- back_yard
# Optional: named object detection models (default: a single model named "default")
# Each entry defines a model; cameras choose which model to use with detect.model.
# Detectors that support multiple models (openvino, onnx, tensorrt, cpu, rknn) run
# one instance per model in use. Detectors that only support a single model
# (edgetpu, hailo8l, memryx, and others) are assigned to models round robin, so at
# least as many of those detectors as models are required when no multi-model
# capable detector is configured.
# Optional: model modifications
# NOTE: The default values are for the EdgeTPU detector.
# Other detectors will require the model config to be set.
models:
default:
# Required: path to the model. Frigate+ models use plus://<model_id> (default: automatic based on detector)
path: /edgetpu_model.tflite
# Required: path to the labelmap (default: shown below)
labelmap_path: /labelmap.txt
# Required: Object detection model input width (default: shown below)
width: 320
# Required: Object detection model input height (default: shown below)
height: 320
# Required: Object detection model input colorspace
# Valid values are rgb, bgr, or yuv. (default: shown below)
input_pixel_format: rgb
# Required: Object detection model input tensor format
# Valid values are nhwc, nchw, hwnc, or hwcn (default: shown below)
input_tensor: nhwc
# Optional: Data type of the model input tensor
# Valid values are float, float_denorm, or int (default: shown below)
input_dtype: int
# Required: Object detection model architecture, used by detectors that support more
# than one model type (openvino, onnx, rknn, memryx, axengine, synaptics, and others)
# Valid values are ssd, yolox, yolonas, yolo-generic, rfdetr, dfine (default: shown below)
model_type: ssd
# Required: Label name modifications. These are merged into the standard labelmap.
labelmap:
2: vehicle
# Optional: Map of object labels to their attribute labels (default: depends on model)
attributes_map:
person:
- amazon
- face
car:
- amazon
- fedex
- license_plate
- ups
model:
# Required: path to the model. Frigate+ models use plus://<model_id> (default: automatic based on detector)
path: /edgetpu_model.tflite
# Required: path to the labelmap (default: shown below)
labelmap_path: /labelmap.txt
# Required: Object detection model input width (default: shown below)
width: 320
# Required: Object detection model input height (default: shown below)
height: 320
# Required: Object detection model input colorspace
# Valid values are rgb, bgr, or yuv. (default: shown below)
input_pixel_format: rgb
# Required: Object detection model input tensor format
# Valid values are nhwc, nchw, hwnc, or hwcn (default: shown below)
input_tensor: nhwc
# Optional: Data type of the model input tensor
# Valid values are float, float_denorm, or int (default: shown below)
input_dtype: int
# Required: Object detection model architecture, used by detectors that support more
# than one model type (openvino, onnx, rknn, memryx, axengine, synaptics, and others)
# Valid values are ssd, yolox, yolonas, yolo-generic, rfdetr, dfine (default: shown below)
model_type: ssd
# Required: Label name modifications. These are merged into the standard labelmap.
labelmap:
2: vehicle
# Optional: Map of object labels to their attribute labels (default: depends on model)
attributes_map:
person:
- amazon
- face
car:
- amazon
- fedex
- license_plate
- ups
# Optional: Audio Events Configuration
# NOTE: Can be overridden at the camera level
@@ -309,9 +302,6 @@ ffmpeg:
detect:
# Optional: enables detection for the camera (default: shown below)
enabled: False
# Optional: name of the model (key under models) used by this camera
# (default: the only defined model, or the model named "default")
model: default
# Optional: width of the frame for the input with the detect role (default: use native stream resolution)
width: 1280
# Optional: height of the frame for the input with the detect role (default: use native stream resolution)
+15 -17
View File
@@ -192,13 +192,12 @@ Navigate to <NavPath path="Settings > System > Detectors and model" /> and open
```yaml
# Optional: model config
models:
default:
path: /path/to/model
width: 320
height: 320
input_tensor: "nhwc"
input_pixel_format: "bgr"
model:
path: /path/to/model
width: 320
height: 320
input_tensor: "nhwc"
input_pixel_format: "bgr"
```
</TabItem>
@@ -215,16 +214,15 @@ If the labelmap is customized then the labels used for alerts will need to be ad
The labelmap can be customized to your needs. A common reason to do this is to combine multiple object types that are easily confused when you don't need to be as granular such as car/truck. By default, truck is renamed to car because they are often confused. You cannot add new object types, but you can change the names of existing objects in the model.
```yaml
models:
default:
labelmap:
2: vehicle
3: vehicle
5: vehicle
7: vehicle
15: animal
16: animal
17: animal
model:
labelmap:
2: vehicle
3: vehicle
5: vehicle
7: vehicle
15: animal
16: animal
17: animal
```
Note that if you rename objects in the labelmap, you will also need to update your `objects -> track` list as well.
+1 -1
View File
@@ -165,7 +165,7 @@ If available, recommended settings are:
#### Setup via the Add Camera Wizard
The Add Camera Wizard is the recommended way to add a standard Reolink camera. Before starting, make sure [HTTP is enabled](https://support.reolink.com/articles/360003452893-How-to-Access-Reolink-Cameras-NVRs-Home-Hub-Locally-via-Web-Browsers/) in the camera's advanced network settings. The wizard uses the camera's HTTP API to determine its resolution and choose the recommended stream type from the table above.
The [Add Camera Wizard](cameras.md#adding-a-camera-with-the-add-camera-wizard) is the recommended way to add a standard Reolink camera. Before starting, make sure [HTTP is enabled](https://support.reolink.com/articles/360003452893-How-to-Access-Reolink-Cameras-NVRs-Home-Hub-Locally-via-Web-Browsers/) in the camera's advanced network settings. The wizard uses the camera's HTTP API to determine its resolution and choose the recommended stream type from the table above.
1. Click **Add Camera** in <NavPath path="Settings > Global configuration > Camera management" />.
2. Choose **Manual selection** as the stream detection method and select **Reolink** as the camera brand.
+44 -1
View File
@@ -7,6 +7,49 @@ import ConfigTabs from "@site/src/components/ConfigTabs";
import TabItem from "@theme/TabItem";
import NavPath from "@site/src/components/NavPath";
## Adding a camera with the Add Camera Wizard
The Add Camera Wizard is the recommended way to add a camera. Click **Add Camera** in <NavPath path="Settings > Global configuration > Camera management" />. The wizard connects to your camera, tests each stream, and writes the camera's configuration for you, including the [go2rtc](go2rtc.md) restream and the live view stream mapping, so a standard setup needs no hand-written YAML.
### Step 1: Name and connection
Enter a name for the camera along with its host or IP address and credentials, then choose how the wizard should find the camera's streams:
- **Probe camera** queries the camera over ONVIF (the ONVIF port is usually 80 or 8080) and asks it for its stream URLs. Some cameras use a separate ONVIF/service account rather than the device admin user, and some require **Use digest authentication** to be enabled.
- **Manual selection** builds a stream URL from a template for the camera brand you pick (Dahua/Amcrest/EmpireTech, Hikvision/Uniview/Annke, Ubiquiti, Reolink, Axis, TP-Link, or Foscam). Choose **Other** to enter a custom RTSP URL directly. Non-RTSP stream types must be [configured manually](#setting-up-camera-inputs).
The name you enter is lowercased and spaces become underscores. If the result still isn't a valid config key, the wizard generates a safe name and stores what you typed as `friendly_name`.
### Step 2: Probe or snapshot
In probe mode, the wizard reports what the camera returned (manufacturer, model, firmware, profile count, and whether PTZ, presets, and [autotracking](autotracking.md) are supported) along with the RTSP URLs it discovered. Test each candidate to see its resolution, frame rate, and codecs together with a snapshot, then select the one you want to use.
In manual mode, the wizard tests the templated URL and shows the same metadata and snapshot.
If no RTSP URLs are found, the credentials may be wrong or the camera may not support ONVIF. Go back and use manual selection instead.
### Step 3: Stream configuration
Assign [roles](#setting-up-camera-inputs) to the stream, and use **Add Another Stream** to add the camera's other streams, for example a substream for `detect` alongside the main stream for `record`. At least one stream must have the `detect` role before you can continue.
**Reduce connections to camera** routes that input through the go2rtc restream so Frigate and the live view share a single connection to the camera instead of each opening their own. See [restream](restream.md) for more detail.
### Step 4: Validation and testing
Connect each stream to get a live preview, an estimated bandwidth figure, and a list of validation results. The wizard checks for the most common misconfigurations, including:
- A detect resolution that is too high (increased resource usage) or too low for reliable detection, or one it could not probe at all
- A stream marked `record` whose audio codec is not AAC, or that has no audio at all
- A stream marked `audio` that carries no audio stream
- Using a restreamed input for the `record` role
- Brand-specific issues, such as an RTSP stream on a Reolink camera that should use http-flv, or a Dahua/Hikvision substream selected for `detect`
**Use stream compatibility mode** passes the stream through go2rtc's ffmpeg module. Enable it if a stream fails to load after several attempts. Note that this also prevents [two way talk](/configuration/live#two-way-talk) from being detected for that stream.
**Save New Camera** writes the configuration and starts the camera right away. No restart is required.
Other features, including [hardware acceleration](hardware_acceleration_video.md), [two way talk](/configuration/live#two-way-talk), and audio transcoding, is configured after the camera has been added. For camera model specific quirks, see the [camera specific](camera_specific.md) docs.
## Setting Up Camera Inputs
Several inputs can be configured for each camera and the role of each input can be mixed and matched based on your needs. This allows you to use a lower resolution stream for object detection, but create recordings from a higher resolution stream, or vice versa.
@@ -69,7 +112,7 @@ Additional cameras are simply added under the camera configuration section.
<ConfigTabs>
<TabItem value="ui">
Navigate to <NavPath path="Settings > Global configuration > Camera management" /> and use the add camera button to configure each additional camera.
Navigate to <NavPath path="Settings > Global configuration > Camera management" /> and use the [Add Camera Wizard](#adding-a-camera-with-the-add-camera-wizard) to configure each additional camera.
</TabItem>
<TabItem value="yaml">
+7 -8
View File
@@ -334,14 +334,13 @@ detectors:
type: openvino
device: AUTO
models:
default:
width: 300
height: 300
input_tensor: nhwc
input_pixel_format: bgr
path: /openvino-model/ssdlite_mobilenet_v2.xml
labelmap_path: /openvino-model/coco_91cl_bkgr.txt
model:
width: 300
height: 300
input_tensor: nhwc
input_pixel_format: bgr
path: /openvino-model/ssdlite_mobilenet_v2.xml
labelmap_path: /openvino-model/coco_91cl_bkgr.txt
record:
enabled: True
+1 -1
View File
@@ -15,7 +15,7 @@ Frigate uses the bundled go2rtc to power a number of key features:
:::tip[Most users no longer need to configure go2rtc by hand]
The **camera setup wizard** is the recommended way to add cameras. Click **Add Camera** in <NavPath path="Settings > Global configuration > Camera management" />, and the wizard probes your camera and writes its configuration for you, including the go2rtc restream and the live stream mapping, so go2rtc is set up automatically.
The [**camera setup wizard**](cameras.md#adding-a-camera-with-the-add-camera-wizard) is the recommended way to add cameras. Click **Add Camera** in <NavPath path="Settings > Global configuration > Camera management" />, and the wizard probes your camera and writes its configuration for you, including the go2rtc restream and the live stream mapping, so go2rtc is set up automatically.
This guide is mainly useful if you are **upgrading from an older version and have existing cameras that don't yet use go2rtc**, or if you want to fine-tune a stream by hand (for example, to transcode a codec your browser can't play). The [go2rtc troubleshooting guide](/troubleshooting/go2rtc) applies regardless of how your cameras were added.
+1 -1
View File
@@ -34,7 +34,7 @@ If you are using go2rtc, you should adjust the following settings in your camera
- Video codec: **H.264** - provides the most compatible video codec with all Live view technologies and browsers. Avoid any kind of "smart codec" or "+" codec like _H.264+_ or _H.265+_. as these non-standard codecs remove keyframes (see below).
- Audio codec: **AAC** - provides the most compatible audio codec with all Live view technologies and browsers that support audio.
- I-frame interval (sometimes called the keyframe interval, the interframe space, or the GOP length): match your camera's frame rate, or choose "1x" (for interframe space on Reolink cameras). For example, if your stream outputs 20fps, your i-frame interval should be 20 (or 1x on Reolink). Values higher than the frame rate will cause the stream to take longer to begin playback. See [this page](https://gardinal.net/understanding-the-keyframe-interval/) for more on keyframes. For many users this may not be an issue, but it should be noted that a 1x i-frame interval will cause more storage utilization if you are using the stream for the `record` role as well.
- I-frame interval (sometimes called the keyframe interval, the interframe space, or the GOP length): match your camera's frame rate, or choose "1x" (for interframe space on Reolink cameras). For example, if your stream outputs 20fps, your i-frame interval should be 20 (or 1x on Reolink). Values higher than the frame rate will cause the stream to take longer to begin playback. See [this page](https://web.archive.org/web/20251213190836/https://gardinal.net/understanding-the-keyframe-interval/) for more on keyframes. For many users this may not be an issue, but it should be noted that a 1x i-frame interval will cause more storage utilization if you are using the stream for the `record` role as well.
The default video and audio codec on your camera may not always be compatible with your browser, which is why setting them to H.264 and AAC is recommended. See the [go2rtc docs](https://github.com/AlexxIT/go2rtc?tab=readme-ov-file#codecs-madness) for codec support information.
+15 -53
View File
@@ -91,41 +91,6 @@ The best detection accuracy comes from a model trained on images that look like
:::
### Running multiple models
Models are defined as named entries under `models`, and each camera selects the model it uses with `detect.model`. This makes it possible to run different models for different groups of cameras, for example a dedicated model for indoor cameras, outdoor cameras, or thermal cameras.
```yaml
detectors:
ov:
type: openvino
device: GPU
models:
indoor:
path: /config/model_cache/indoor-model.xml
model_type: yolo-generic
width: 320
height: 320
outdoor:
path: plus://<your_model_id>
cameras:
living_room:
detect:
model: indoor
driveway:
detect:
model: outdoor
```
When only one model is defined, all cameras use it automatically. With multiple models, cameras use the model named `default` unless `detect.model` selects another one; `detect.model` can also be set globally and overridden per camera.
How detectors handle multiple models depends on the hardware:
- **Detectors that support multiple models** (`openvino`, `onnx`, `tensorrt`, `cpu`, `rknn`): a single detector entry is automatically expanded into one instance per model in use. For example, detector `ov` with models `indoor` and `outdoor` runs as `ov_indoor` and `ov_outdoor`, and each instance appears separately in the System Metrics page. Keep in mind that each instance loads its own copy of the model, which increases GPU memory usage.
- **Detectors that only support a single model** (`edgetpu`, `hailo8l`, `memryx`, and other single-session hardware): each detector entry serves exactly one model. Detector entries are assigned to models round robin, so running two models on Coral hardware requires two Corals. If these are the only detectors configured and there are fewer of them than models in use, Frigate will fail to start with an error explaining the options.
# Officially Supported Detectors
Frigate provides a number of builtin detector types. By default, Frigate will use a single CPU detector. Other detectors may require additional configuration as described below. When using multiple detectors they will run in dedicated processes, but pull from a common queue of detection requests from across all cameras.
@@ -824,12 +789,11 @@ You can set it to:
- A path to some model.json.
```yaml
models:
default:
path: ./mobilenet_v2_ssd_coco--300x300_quant_n2x_orca1_1 # directory to model .json and file
width: 300 # width is in the model name as the first number in the "int"x"int" section
height: 300 # height is in the model name as the second number in the "int"x"int" section
input_pixel_format: rgb/bgr # look at the model.json to figure out which to put here
model:
path: ./mobilenet_v2_ssd_coco--300x300_quant_n2x_orca1_1 # directory to model .json and file
width: 300 # width is in the model name as the first number in the "int"x"int" section
height: 300 # height is in the model name as the second number in the "int"x"int" section
input_pixel_format: rgb/bgr # look at the model.json to figure out which to put here
```
#### Local Inference
@@ -845,12 +809,11 @@ It is also possible to eliminate the need for an AI server and run the hardware
Once `degirum_detector` is setup, you can choose a model through 'model' section in the `config.yml` file.
```yaml
models:
default:
path: mobilenet_v2_ssd_coco--300x300_quant_n2x_orca1_1
width: 300 # width is in the model name as the first number in the "int"x"int" section
height: 300 # height is in the model name as the second number in the "int"x"int" section
input_pixel_format: rgb/bgr # look at the model.json to figure out which to put here
model:
path: mobilenet_v2_ssd_coco--300x300_quant_n2x_orca1_1
width: 300 # width is in the model name as the first number in the "int"x"int" section
height: 300 # height is in the model name as the second number in the "int"x"int" section
input_pixel_format: rgb/bgr # look at the model.json to figure out which to put here
```
#### AI Hub Cloud Inference
@@ -866,12 +829,11 @@ If you do not possess whatever hardware you want to run, there's also the option
Once `degirum_detector` is setup, you can choose a model through 'model' section in the `config.yml` file.
```yaml
models:
default:
path: mobilenet_v2_ssd_coco--300x300_quant_n2x_orca1_1
width: 300 # width is in the model name as the first number in the "int"x"int" section
height: 300 # height is in the model name as the second number in the "int"x"int" section
input_pixel_format: rgb/bgr # look at the model.json to figure out which to put here
model:
path: mobilenet_v2_ssd_coco--300x300_quant_n2x_orca1_1
width: 300 # width is in the model name as the first number in the "int"x"int" section
height: 300 # height is in the model name as the second number in the "int"x"int" section
input_pixel_format: rgb/bgr # look at the model.json to figure out which to put here
```
## AXERA
+8 -9
View File
@@ -144,7 +144,7 @@ At this point you should be able to start Frigate and a basic config will be cre
### Step 2: Add a camera
Click the **Add Camera** button in <NavPath path="Settings > Global configuration > Camera management" /> to use the camera setup wizard to get your first camera added into Frigate.
Click the **Add Camera** button in <NavPath path="Settings > Global configuration > Camera management" /> to use the camera setup wizard to get your first camera added into Frigate. See [Adding a camera with the Add Camera Wizard](../configuration/cameras.md#adding-a-camera-with-the-add-camera-wizard) for a walkthrough of each step.
### Step 3: Configure hardware acceleration (recommended)
@@ -228,14 +228,13 @@ detectors: # <---- add detectors
device: GPU
# We will use the default MobileNet_v2 model from OpenVINO.
models:
default:
width: 300
height: 300
input_tensor: nhwc
input_pixel_format: bgr
path: /openvino-model/ssdlite_mobilenet_v2.xml
labelmap_path: /openvino-model/coco_91cl_bkgr.txt
model:
width: 300
height: 300
input_tensor: nhwc
input_pixel_format: bgr
path: /openvino-model/ssdlite_mobilenet_v2.xml
labelmap_path: /openvino-model/coco_91cl_bkgr.txt
cameras:
name_of_your_camera:
+8 -10
View File
@@ -64,9 +64,8 @@ You can either choose the new model from the <NavPath path="Settings > System >
```yaml
detectors: ...
models:
default:
path: plus://<your_model_id>
model:
path: plus://<your_model_id>
```
:::note
@@ -80,11 +79,10 @@ Models are downloaded into the `/config/model_cache` folder and only downloaded
If needed, you can override the labelmap for Frigate+ models. This is not recommended as renaming labels will break the Submit to Frigate+ feature if the labels are not available in Frigate+.
```yaml
models:
default:
path: plus://<your_model_id>
labelmap:
3: animal
4: animal
5: animal
model:
path: plus://<your_model_id>
labelmap:
3: animal
4: animal
5: animal
```
+2 -3
View File
@@ -38,9 +38,8 @@ Navigate to <NavPath path="Settings > System > Detectors and model" />. In the *
```yaml
detectors: ...
models:
default:
path: plus://<your_model_id>
model:
path: plus://<your_model_id>
```
:::tip
+30 -13
View File
@@ -19,6 +19,7 @@
"docusaurus-plugin-openapi-docs": "^4.5.1",
"docusaurus-theme-openapi-docs": "^4.5.1",
"js-yaml": "^4.1.1",
"marked": "^16.4.2",
"prism-react-renderer": "^2.4.1",
"raw-loader": "^4.0.2",
"react": "^18.3.1",
@@ -6729,9 +6730,9 @@
}
},
"node_modules/body-parser": {
"version": "1.20.4",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.4.tgz",
"integrity": "sha512-ZTgYYLMOXY9qKU/57FAo8F+HA2dGX7bqGc71txDRC1rS4frdFI5R7NhluHxH6M0YItAP0sHB4uqAOcYKxO6uGA==",
"version": "1.20.6",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.6.tgz",
"integrity": "sha512-p5tAzS57i5MV9fZFDj9LeIiTZEufbSe2eDozP+ElheSUq1m74CRq1jI4mYNDdVs9vQztXFLuk/Gd6BWTdwRJ5g==",
"license": "MIT",
"dependencies": {
"bytes": "~3.1.2",
@@ -6742,7 +6743,7 @@
"http-errors": "~2.0.1",
"iconv-lite": "~0.4.24",
"on-finished": "~2.4.1",
"qs": "~6.14.0",
"qs": "~6.15.1",
"raw-body": "~2.5.3",
"type-is": "~1.6.18",
"unpipe": "~1.0.0"
@@ -6788,6 +6789,22 @@
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
"license": "MIT"
},
"node_modules/body-parser/node_modules/qs": {
"version": "6.15.3",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.15.3.tgz",
"integrity": "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==",
"license": "BSD-3-Clause",
"dependencies": {
"es-define-property": "^1.0.1",
"side-channel": "^1.1.1"
},
"engines": {
"node": ">=0.6"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/bonjour-service": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/bonjour-service/-/bonjour-service-1.3.0.tgz",
@@ -20985,14 +21002,14 @@
"license": "MIT"
},
"node_modules/side-channel": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz",
"integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz",
"integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==",
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0",
"object-inspect": "^1.13.3",
"side-channel-list": "^1.0.0",
"object-inspect": "^1.13.4",
"side-channel-list": "^1.0.1",
"side-channel-map": "^1.0.1",
"side-channel-weakmap": "^1.0.2"
},
@@ -21004,13 +21021,13 @@
}
},
"node_modules/side-channel-list": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz",
"integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz",
"integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==",
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0",
"object-inspect": "^1.13.3"
"object-inspect": "^1.13.4"
},
"engines": {
"node": ">= 0.4"
+25 -37
View File
@@ -372,40 +372,31 @@ def config(request: Request):
config["go2rtc"]["streams"][stream_name] = cleaned
config["plus"] = {"enabled": request.app.frigate_config.plus_api.is_active()}
config["model"]["colormap"] = config_obj.model.colormap
config["model"]["all_attributes"] = config_obj.model.all_attributes
config["model"]["non_logo_attributes"] = config_obj.model.non_logo_attributes
for model_key, model in config_obj.models.items():
model_dict = config["models"][model_key]
model_dict["colormap"] = model.colormap
model_dict["all_attributes"] = model.all_attributes
model_dict["non_logo_attributes"] = model.non_logo_attributes
# Add model plus data if plus is enabled
if config["plus"]["enabled"]:
model_path = config.get("model", {}).get("path")
if model_path:
model_json_path = FilePath(model_path).with_suffix(".json")
try:
with open(model_json_path) as f:
model_plus_data = json.load(f)
config["model"]["plus"] = model_plus_data
except FileNotFoundError:
config["model"]["plus"] = None
except json.JSONDecodeError:
config["model"]["plus"] = None
else:
config["model"]["plus"] = None
# Add model plus data if plus is enabled
if config["plus"]["enabled"]:
model_plus_data = None
if model.path:
model_json_path = FilePath(model.path).with_suffix(".json")
try:
with open(model_json_path) as f:
model_plus_data = json.load(f)
except (FileNotFoundError, json.JSONDecodeError):
model_plus_data = None
model_dict["plus"] = model_plus_data
# legacy single-model block kept for frontend compatibility, remove
# once the UI is fully multi-model aware
default_model_key = (
"default" if "default" in config_obj.models else next(iter(config_obj.models))
)
config["model"] = config["models"][default_model_key]
# use each detector's assigned merged labelmap
for key, detector_config in config["detectors"].items():
if config_obj.detectors[key].model:
detector_config["model"]["labelmap"] = config_obj.detectors[
key
].model.merged_labelmap
# use merged labelamp
for detector_config in config["detectors"].values():
detector_config["model"]["labelmap"] = (
request.app.frigate_config.model.merged_labelmap
)
return JSONResponse(content=config)
@@ -1332,11 +1323,8 @@ def plusModels(request: Request, filterByCurrentModelDetector: bool = False):
modelList = models["list"]
# current model type, based on the default model until the UI is
# fully multi-model aware
config_models = request.app.frigate_config.models
default_model = config_models.get("default") or next(iter(config_models.values()))
modelType = default_model.model_type
# current model type
modelType = request.app.frigate_config.model.model_type
# current detectorType for comparing to supportedDetectors
detectorType = list(request.app.frigate_config.detectors.values())[0].type
+1 -1
View File
@@ -813,7 +813,7 @@ async def event_snapshot(
timestamp_style=request.app.frigate_config.cameras[
event.camera
].timestamp_style,
colormap=request.app.frigate_config.model_for_camera(event.camera).colormap,
colormap=request.app.frigate_config.model.colormap,
)
except DoesNotExist:
# see if the object is currently being tracked
+17 -19
View File
@@ -97,9 +97,7 @@ class FrigateApp:
self.metrics_manager = manager
self.audio_process: mp.Process | None = None
self.stop_event = stop_event
self.detection_queues: dict[str, Queue] = {
model_key: mp.Queue() for model_key in config.models
}
self.detection_queue: Queue = mp.Queue()
self.detectors: dict[str, ObjectDetectProcess] = {}
self.detection_shms: list[mp.shared_memory.SharedMemory] = []
self.log_queue: Queue = mp.Queue()
@@ -365,14 +363,20 @@ class FrigateApp:
)
def start_detectors(self) -> None:
for name, camera_config in self.config.cameras.items():
camera_model = self.config.models[camera_config.detect.model]
for name in self.config.cameras.keys():
try:
largest_frame = max(
[
det.model.height * det.model.width * 3
if det.model is not None
else 320
for det in self.config.detectors.values()
]
)
shm_in = UntrackedSharedMemory(
name=name,
create=True,
size=camera_model.height * camera_model.width * 3,
size=largest_frame,
)
except FileExistsError:
shm_in = UntrackedSharedMemory(name=name)
@@ -387,16 +391,11 @@ class FrigateApp:
self.detection_shms.append(shm_in)
self.detection_shms.append(shm_out)
for name, detector_config in self.config.detector_instances.items():
cameras_using_model = [
camera_name
for camera_name, camera_config in self.config.cameras.items()
if camera_config.detect.model == detector_config.model_key
]
for name, detector_config in self.config.detectors.items():
self.detectors[name] = ObjectDetectProcess(
name,
self.detection_queues[detector_config.model_key],
cameras_using_model,
self.detection_queue,
list(self.config.cameras.keys()),
self.config,
detector_config,
self.stop_event,
@@ -431,7 +430,7 @@ class FrigateApp:
def start_camera_processor(self) -> None:
self.camera_maintainer = CameraMaintainer(
self.config,
self.detection_queues,
self.detection_queue,
self.detected_frames_queue,
self.camera_metrics,
self.ptz_metrics,
@@ -686,9 +685,8 @@ class FrigateApp:
for detector in self.detectors.values():
detector.stop()
for detection_queue in self.detection_queues.values():
empty_and_close_queue(detection_queue)
logger.info("Detection queues closed")
empty_and_close_queue(self.detection_queue)
logger.info("Detection queue closed")
self.detected_frames_processor.join()
empty_and_close_queue(self.detected_frames_queue)
+1 -1
View File
@@ -178,7 +178,7 @@ class CameraActivityManager:
return
for label in camera_config.objects.track:
if label in self.config.model_for_camera(camera).non_logo_attributes:
if label in self.config.model.non_logo_attributes:
continue
new_count = all_objects[label]
+16 -11
View File
@@ -29,7 +29,7 @@ class CameraMaintainer(threading.Thread):
def __init__(
self,
config: FrigateConfig,
detection_queues: dict[str, Queue],
detection_queue: Queue,
detected_frames_queue: Queue,
camera_metrics: DictProxy,
ptz_metrics: dict[str, PTZMetrics],
@@ -38,7 +38,7 @@ class CameraMaintainer(threading.Thread):
):
super().__init__(name="camera_processor")
self.config = config
self.detection_queues = detection_queues
self.detection_queue = detection_queue
self.detected_frames_queue = detected_frames_queue
self.stop_event = stop_event
self.camera_metrics = camera_metrics
@@ -79,11 +79,10 @@ class CameraMaintainer(threading.Thread):
# create or update region grids for each camera
for camera in self.config.cameras.values():
assert camera.name is not None
camera_model = self.config.models[camera.detect.model]
self.region_grids[camera.name] = get_camera_regions_grid(
camera.name,
camera.detect,
max(camera_model.width, camera_model.height),
max(self.config.model.width, self.config.model.height),
)
def __calculate_shm_frame_count(self) -> int:
@@ -116,8 +115,6 @@ class CameraMaintainer(threading.Thread):
camera_stop_event = self.__ensure_camera_stop_event(name)
camera_model = self.config.models[config.detect.model]
if runtime:
self.camera_metrics[name] = CameraMetrics(self.metrics_manager)
self.ptz_metrics[name] = PTZMetrics(
@@ -126,24 +123,32 @@ class CameraMaintainer(threading.Thread):
self.region_grids[name] = get_camera_regions_grid(
name,
config.detect,
max(camera_model.width, camera_model.height),
max(self.config.model.width, self.config.model.height),
)
try:
largest_frame = max(
[
det.model.height * det.model.width * 3
if det.model is not None
else 320
for det in self.config.detectors.values()
]
)
UntrackedSharedMemory(name=f"out-{name}", create=True, size=20 * 6 * 4)
UntrackedSharedMemory(
name=name,
create=True,
size=camera_model.height * camera_model.width * 3,
size=largest_frame,
)
except FileExistsError:
pass
camera_process = CameraTracker(
config,
camera_model,
camera_model.merged_labelmap,
self.detection_queues[config.detect.model],
self.config.model,
self.config.model.merged_labelmap,
self.detection_queue,
self.detected_frames_queue,
self.camera_metrics[name],
self.ptz_metrics[name],
+5 -6
View File
@@ -40,7 +40,6 @@ class CameraState:
self.name = name
self.config = config
self.camera_config = config.cameras[name]
self.model_config = config.model_for_camera(name)
self.frame_manager = frame_manager
self.best_objects: dict[str, TrackedObject] = {}
self.tracked_objects: dict[str, TrackedObject] = {}
@@ -102,7 +101,7 @@ class CameraState:
thickness = 1
else:
thickness = 2
color = self.model_config.colormap.get(
color = self.config.model.colormap.get(
obj["label"], (255, 255, 255)
)
else:
@@ -126,7 +125,7 @@ class CameraState:
and obj["frame_time"] == frame_time
):
thickness = 5
color = self.model_config.colormap.get(
color = self.config.model.colormap.get(
obj["label"], (255, 255, 255)
)
@@ -262,7 +261,7 @@ class CameraState:
if draw_options.get("paths"):
for obj in tracked_objects.values():
if obj["frame_time"] == frame_time and obj["path_data"]:
color = self.model_config.colormap.get(
color = self.config.model.colormap.get(
obj["label"], (255, 255, 255)
)
@@ -367,7 +366,7 @@ class CameraState:
for id in new_ids:
logger.debug(f"{self.name}: New tracked object ID: {id}")
new_obj = tracked_objects[id] = TrackedObject(
self.model_config,
self.config.model,
self.camera_config,
self.config.ui,
self.frame_cache,
@@ -511,7 +510,7 @@ class CameraState:
sub_label = None
if obj.obj_data.get("sub_label"):
if obj.obj_data["sub_label"][0] in self.model_config.all_attributes:
if obj.obj_data["sub_label"][0] in self.config.model.all_attributes:
label = obj.obj_data["sub_label"][0]
else:
label = f"{object_type}-verified"
+1 -2
View File
@@ -156,11 +156,10 @@ class Dispatcher:
if camera not in self.config.cameras:
return None
camera_model = self.config.model_for_camera(camera)
grid = get_camera_regions_grid(
camera,
self.config.cameras[camera].detect,
max(camera_model.width, camera_model.height),
max(self.config.model.width, self.config.model.height),
)
return grid
-5
View File
@@ -50,11 +50,6 @@ class DetectConfig(FrigateBaseModel):
title="Enable object detection",
description="Enable or disable object detection for all cameras; can be overridden per-camera.",
)
model: str | None = Field(
default=None,
title="Detection model name",
description="Name of the model (key under `models`) used by this camera. Defaults to the only defined model, or the model named 'default'.",
)
height: int | None = Field(
default=None,
title="Detect height",
+32 -154
View File
@@ -4,7 +4,6 @@ import io
import json
import logging
import os
import re
from typing import Any, Self
import numpy as np
@@ -12,7 +11,6 @@ from pydantic import (
BaseModel,
ConfigDict,
Field,
PrivateAttr,
TypeAdapter,
ValidationInfo,
field_validator,
@@ -21,11 +19,7 @@ from pydantic import (
from ruamel.yaml import YAML
from frigate.const import REGEX_JSON
from frigate.detectors import (
DetectorConfig,
ModelConfig,
assign_detector_instances,
)
from frigate.detectors import DetectorConfig, ModelConfig
from frigate.detectors.detector_config import BaseDetectorConfig
from frigate.plus import PlusApi
from frigate.util.builtin import (
@@ -115,7 +109,7 @@ DEFAULT_CONFIG = f"""
mqtt:
enabled: False
{_render_default_yaml({"detectors": NEW_CONFIG_DETECTORS, "models": {"default": DEFAULT_MODEL}})}
{_render_default_yaml({"detectors": NEW_CONFIG_DETECTORS, "model": DEFAULT_MODEL})}
cameras: {{}} # No cameras defined, UI wizard should be used
version: {CURRENT_CONFIG_VERSION}
"""
@@ -509,10 +503,10 @@ class FrigateConfig(FrigateBaseModel):
title="Detector hardware",
description="Configuration for object detectors (CPU, GPU, ONNX backends) and any detector-specific model settings.",
)
models: dict[str, ModelConfig] = Field(
default_factory=lambda: {"default": ModelConfig()},
title="Detection models",
description="Named object detection models. Cameras select a model with detect.model; detectors are assigned to models automatically.",
model: ModelConfig = Field(
default_factory=ModelConfig,
title="Detection model",
description="Settings to configure a custom object detection model and its input shape.",
)
# GenAI config (named provider configs: name -> GenAIConfig)
@@ -627,37 +621,11 @@ class FrigateConfig(FrigateBaseModel):
)
_plus_api: PlusApi
_detector_instances: dict[str, BaseDetectorConfig] = PrivateAttr(
default_factory=dict
)
@property
def plus_api(self) -> PlusApi:
return self._plus_api
@property
def detector_instances(self) -> dict[str, BaseDetectorConfig]:
"""Runtime detector instances expanded per assigned model."""
return self._detector_instances
def model_for_camera(self, camera_name: str) -> ModelConfig:
"""Return the detection model config used by the given camera."""
return self.models[self.cameras[camera_name].detect.model]
@field_validator("models")
@classmethod
def validate_model_names(cls, v: dict[str, ModelConfig]):
if not v:
raise ValueError("At least one model must be defined under models")
for name in v.keys():
if not re.match(r"^[a-zA-Z0-9_-]+$", name):
raise ValueError(
f"Invalid model name '{name}'. Model names can only contain letters, numbers, underscores, and hyphens"
)
return v
@model_validator(mode="after")
def post_validation(self, info: ValidationInfo) -> Self:
# Load plus api from context, if possible.
@@ -703,12 +671,7 @@ class FrigateConfig(FrigateBaseModel):
)
# set default min_score for object attributes
all_model_attributes = {
attribute
for model in self.models.values()
for attribute in model.all_attributes
}
for attribute in sorted(all_model_attributes):
for attribute in self.model.all_attributes:
existing = self.objects.filters.get(attribute)
if existing is None:
self.objects.filters[attribute] = FilterConfig(min_score=0.7)
@@ -758,18 +721,8 @@ class FrigateConfig(FrigateBaseModel):
exclude_unset=True,
)
# capture raw model dumps before plus models are loaded so detector
# instances can run their own detector-specific plus validation
raw_model_dumps = {
name: model.model_dump(exclude_unset=True, warnings="none")
for name, model in self.models.items()
}
for model in self.models.values():
model.check_and_load_plus_model(self.plus_api)
adapter = TypeAdapter(DetectorConfig)
for key, detector in self.detectors.items():
adapter = TypeAdapter(DetectorConfig)
model_dict = (
detector
if isinstance(detector, dict)
@@ -784,6 +737,27 @@ class FrigateConfig(FrigateBaseModel):
)
detector_config.model = None
model_config = self.model.model_dump(exclude_unset=True, warnings="none")
if detector_config.model_path:
model_config["path"] = detector_config.model_path
if "path" not in model_config:
if detector_config.type == "cpu" or detector_config.type.endswith(
"_tfl"
):
model_config["path"] = "/cpu_model.tflite"
elif detector_config.type == "edgetpu":
model_config["path"] = "/edgetpu_model.tflite"
elif detector_config.type == "openvino":
for default_key, default_value in DEFAULT_MODEL.items():
model_config.setdefault(default_key, default_value)
model = ModelConfig.model_validate(model_config)
model.check_and_load_plus_model(self.plus_api, detector_config.type)
model.compute_model_hash()
labelmap_objects = model.merged_labelmap.values()
detector_config.model = model
self.detectors[key] = detector_config
for name, camera in self.cameras.items():
@@ -811,21 +785,6 @@ class FrigateConfig(FrigateBaseModel):
{"name": name, **merged_config}
)
# resolve which named model this camera uses
if camera_config.detect.model is not None:
if camera_config.detect.model not in self.models:
raise ValueError(
f"Camera {name} references model '{camera_config.detect.model}' which is not defined under models. Defined models: {', '.join(self.models.keys())}"
)
elif len(self.models) == 1:
camera_config.detect.model = next(iter(self.models))
elif "default" in self.models:
camera_config.detect.model = "default"
else:
raise ValueError(
f"Camera {name} does not specify detect.model and multiple models are defined. Set detect.model on the camera or globally, or name one of the models 'default'."
)
if camera_config.ffmpeg.hwaccel_args == "auto":
camera_config.ffmpeg.hwaccel_args = self.ffmpeg.hwaccel_args
@@ -1046,10 +1005,7 @@ class FrigateConfig(FrigateBaseModel):
verify_profile_overrides_match_base(camera_config)
verify_autotrack_zones(camera_config)
verify_motion_and_detect(camera_config)
verify_objects_track(
camera_config,
self.models[camera_config.detect.model].merged_labelmap.values(),
)
verify_objects_track(camera_config, labelmap_objects)
verify_lpr_and_face(self, camera_config)
# Validate camera profiles reference top-level profile definitions
@@ -1066,11 +1022,8 @@ class FrigateConfig(FrigateBaseModel):
config.name = name
self.objects.parse_all_objects(self.cameras)
for model in self.models.values():
model.create_colormap(sorted(self.objects.all_objects))
# expand detectors into per-model runtime instances
self.__build_detector_instances(raw_model_dumps)
self.model.create_colormap(sorted(self.objects.all_objects))
self.model.check_and_load_plus_model(self.plus_api)
# Check audio transcription and audio detection requirements
if self.audio_transcription.enabled:
@@ -1101,81 +1054,6 @@ class FrigateConfig(FrigateBaseModel):
return self
def __build_detector_instances(
self, raw_model_dumps: dict[str, dict[str, Any]]
) -> None:
"""Expand detector entries into runtime instances, one per assigned model."""
used_models = list(
dict.fromkeys(camera.detect.model for camera in self.cameras.values())
) or list(self.models.keys())
unused_models = set(self.models.keys()) - set(used_models)
if unused_models:
logger.warning(
f"Models {', '.join(sorted(unused_models))} are defined but not used by any camera, no detector instances will be created for them"
)
assignments = assign_detector_instances(
{key: detector.type for key, detector in self.detectors.items()},
used_models,
)
models_per_detector: dict[str, int] = {}
for _, detector_key, _ in assignments:
models_per_detector[detector_key] = (
models_per_detector.get(detector_key, 0) + 1
)
instances: dict[str, BaseDetectorConfig] = {}
for instance_name, detector_key, model_key in assignments:
instance = self.detectors[detector_key].model_copy(deep=True)
instance.model_key = model_key
model_dict = raw_model_dumps[model_key].copy()
if instance.model_path:
if models_per_detector[detector_key] > 1:
logger.warning(
f"Detector {detector_key} runs multiple models, its model_path will be ignored"
)
else:
model_dict["path"] = instance.model_path
if "path" not in model_dict:
if instance.type == "cpu" or instance.type.endswith("_tfl"):
model_dict["path"] = "/cpu_model.tflite"
elif instance.type == "edgetpu":
model_dict["path"] = "/edgetpu_model.tflite"
elif instance.type == "openvino":
for default_key, default_value in DEFAULT_MODEL.items():
model_dict.setdefault(default_key, default_value)
model = ModelConfig.model_validate(model_dict)
try:
model.check_and_load_plus_model(self.plus_api, instance.type)
except ValueError as e:
raise ValueError(f"Model '{model_key}': {e}") from e
model.compute_model_hash()
instance.model = model
instances[instance_name] = instance
logger.log(
logging.INFO if len(used_models) > 1 else logging.DEBUG,
f"Detector instance {instance_name} ({instance.type}) will run model '{model_key}'",
)
# populate user-facing detector entries with their first assigned
# model for display purposes
for instance_name, detector_key, model_key in assignments:
detector = self.detectors[detector_key]
if detector.model is None:
detector.model = instances[instance_name].model
detector.model_key = model_key
self._detector_instances = instances
@field_validator("cameras")
@classmethod
def ensure_zones_and_cameras_have_different_names(cls, v: dict[str, CameraConfig]):
@@ -72,10 +72,9 @@ class LicensePlateProcessingMixin:
# Object config
self.lp_objects: list[str] = []
for model in self.config.models.values():
for obj, attributes in model.attributes_map.items():
if "license_plate" in attributes and obj not in self.lp_objects:
self.lp_objects.append(obj)
for obj, attributes in self.config.model.attributes_map.items():
if "license_plate" in attributes:
self.lp_objects.append(obj)
# Detection specific parameters
self.min_size = 8
@@ -231,12 +231,8 @@ class ReviewDescriptionProcessor(PostProcessorApi):
final_data,
thumbs,
camera_config.review.genai,
list(
self.config.model_for_camera(
camera_config.name
).merged_labelmap.values()
),
self.config.model_for_camera(camera_config.name).all_attributes,
list(self.config.model.merged_labelmap.values()),
self.config.model.all_attributes,
),
).start()
+1 -59
View File
@@ -1,69 +1,11 @@
import logging
from .detector_config import InputTensorEnum, ModelConfig, PixelFormatEnum # noqa: F401
from .detector_types import ( # noqa: F401
DetectorConfig,
DetectorTypeEnum,
api_types,
detector_supports_multiple_models,
)
from .detector_types import DetectorConfig, DetectorTypeEnum, api_types # noqa: F401
logger = logging.getLogger(__name__)
def assign_detector_instances(
detector_types: dict[str, str],
used_models: list[str],
) -> list[tuple[str, str, str]]:
"""Assign detector entries to models.
Detector types that support multiple models get one instance per model.
Single-model detector entries are round-robin assigned across the models,
wrapping around so that every detector entry is assigned.
Args:
detector_types: Detector key to detector type, in config order
used_models: Ordered model keys in use by cameras
Returns:
List of (instance_name, detector_key, model_key) assignments
"""
multi = [
key
for key, type_key in detector_types.items()
if detector_supports_multiple_models(type_key)
]
single = [key for key in detector_types if key not in multi]
if not multi and len(single) < len(used_models):
single_types = sorted({detector_types[key] for key in single})
raise ValueError(
f"Detectors {', '.join(single)} (types: {', '.join(single_types)}) can each only run a single model, "
f"but {len(used_models)} models are in use ({', '.join(used_models)}). "
"Add more detectors, use a detector type that supports multiple models, or reduce the number of models assigned to cameras."
)
assignments: list[tuple[str, str, str]] = []
for key in multi:
for model_key in used_models:
instance_name = key if len(used_models) == 1 else f"{key}_{model_key}"
assignments.append((instance_name, key, model_key))
for i, key in enumerate(single):
assignments.append((key, key, used_models[i % len(used_models)]))
instance_names = [name for name, _, _ in assignments]
duplicates = {name for name in instance_names if instance_names.count(name) > 1}
if duplicates:
raise ValueError(
f"Detector instance names collide: {', '.join(sorted(duplicates))}. "
"Rename the conflicting detectors or models so that expanded instance names (detector_model) are unique."
)
return assignments
def create_detector(detector_config):
if detector_config.type == DetectorTypeEnum.cpu:
logger.warning(
-4
View File
@@ -11,10 +11,6 @@ logger = logging.getLogger(__name__)
class DetectionApi(ABC):
type_key: str
supported_models: list[ModelTypeEnum]
# whether this detector type can run multiple model instances concurrently
# on the same hardware (one detector config entry can be expanded to an
# instance per model); single-model detectors serve exactly one model each
supports_multiple_models: bool = False
@abstractmethod
def __init__(self, detector_config: BaseDetectorConfig):
-5
View File
@@ -250,11 +250,6 @@ class BaseDetectorConfig(BaseModel):
title="Detector specific model path",
description="File path to the detector model binary if required by the chosen detector.",
)
model_key: str | None = Field(
default=None,
title="Assigned model name",
description="Name of the model (key under `models`) this detector instance serves. Set automatically at runtime, users should not set this.",
)
model_config = ConfigDict(
extra="allow", arbitrary_types_allowed=True, protected_namespaces=()
)
-6
View File
@@ -29,12 +29,6 @@ for _, name, _ in _included_modules:
api_types = {det.type_key: det for det in DetectionApi.__subclasses__()}
def detector_supports_multiple_models(type_key: str) -> bool:
"""Return whether the given detector type can run multiple model instances."""
detector = api_types.get(type_key)
return bool(detector and getattr(detector, "supports_multiple_models", False))
class StrEnum(str, Enum):
pass
-1
View File
@@ -37,7 +37,6 @@ class CpuDetectorConfig(BaseDetectorConfig):
class CpuTfl(DetectionApi):
type_key = DETECTOR_KEY
supports_multiple_models = True
def __init__(self, detector_config: CpuDetectorConfig):
# Suppress TFLite delegate creation messages that bypass Python logging
-1
View File
@@ -41,7 +41,6 @@ class ONNXDetectorConfig(BaseDetectorConfig):
class ONNXDetector(DetectionApi):
type_key = DETECTOR_KEY
supports_multiple_models = True
def __init__(self, detector_config: ONNXDetectorConfig):
super().__init__(detector_config)
-1
View File
@@ -36,7 +36,6 @@ class OvDetectorConfig(BaseDetectorConfig):
class OvDetector(DetectionApi):
type_key = DETECTOR_KEY
supports_multiple_models = True
supported_models = [
ModelTypeEnum.dfine,
ModelTypeEnum.rfdetr,
-1
View File
@@ -47,7 +47,6 @@ class RknnDetectorConfig(BaseDetectorConfig):
class Rknn(DetectionApi):
type_key = DETECTOR_KEY
supports_multiple_models = True
def __init__(self, config: RknnDetectorConfig):
super().__init__(config)
-1
View File
@@ -30,7 +30,6 @@ class TeflonDetectorConfig(BaseDetectorConfig):
class TeflonTfl(DetectionApi):
type_key = DETECTOR_KEY
supports_multiple_models = True
def __init__(self, detector_config: TeflonDetectorConfig):
# Location in Debian's mesa-teflon-delegate
-1
View File
@@ -82,7 +82,6 @@ class HostDeviceMem:
class TensorRtDetector(DetectionApi):
type_key = DETECTOR_KEY
supports_multiple_models = True
def _load_engine(self, model_path):
try:
+6 -15
View File
@@ -159,16 +159,7 @@ class EventProcessor(threading.Thread):
if width is None or height is None:
return
# find a detector instance running this camera's model so the
# event records the model that produced it
camera_detector = next(
(
detector
for detector in self.config.detector_instances.values()
if detector.model_key == camera_config.detect.model
),
list(self.config.detectors.values())[0],
)
first_detector = list(self.config.detectors.values())[0]
start_time = event_data["start_time"]
end_time = (
@@ -238,13 +229,13 @@ class EventProcessor(threading.Thread):
Event.thumbnail: event_data.get("thumbnail"),
Event.has_clip: event_data["has_clip"],
Event.has_snapshot: event_data["has_snapshot"],
Event.model_hash: camera_detector.model.model_hash
if camera_detector.model
Event.model_hash: first_detector.model.model_hash
if first_detector.model
else None,
Event.model_type: camera_detector.model.model_type
if camera_detector.model
Event.model_type: first_detector.model.model_type
if first_detector.model
else None,
Event.detector_type: camera_detector.type,
Event.detector_type: first_detector.type,
Event.data: {
"box": box,
"region": region,
+20 -12
View File
@@ -115,9 +115,11 @@ class PendingReviewSegment:
if self._frame is not None:
self.thumb_time = datetime.datetime.now().timestamp()
self.has_frame = True
cv2.imwrite(
Path(self.frame_path).parent.mkdir(parents=True, exist_ok=True)
if not cv2.imwrite(
self.frame_path, self._frame, [int(cv2.IMWRITE_WEBP_QUALITY), 60]
)
):
logger.error("Failed to write review thumbnail to %s", self.frame_path)
def save_full_frame(self, camera_config: CameraConfig, frame: np.ndarray) -> None:
color_frame = cv2.cvtColor(frame, cv2.COLOR_YUV2BGR_I420)
@@ -128,9 +130,11 @@ class PendingReviewSegment:
if self._frame is not None:
self.has_frame = True
cv2.imwrite(
Path(self.frame_path).parent.mkdir(parents=True, exist_ok=True)
if not cv2.imwrite(
self.frame_path, self._frame, [int(cv2.IMWRITE_WEBP_QUALITY), 60]
)
):
logger.error("Failed to write review thumbnail to %s", self.frame_path)
def get_data(self, ended: bool) -> dict:
end_time = None
@@ -374,6 +378,16 @@ class ReviewSegmentMaintainer(threading.Thread):
"""Forcibly end the pending segment for a camera."""
segment = self.active_review_segments.get(camera)
if segment:
if self.indefinite_events.get(camera):
self.indefinite_events[camera] = {}
now = datetime.datetime.now().timestamp()
if segment.last_alert_time == sys.maxsize:
segment.last_alert_time = now
if segment.last_detection_time == sys.maxsize:
segment.last_detection_time = now
prev_data = segment.get_data(False)
return self._publish_segment_end(segment, prev_data)
return None
@@ -436,10 +450,7 @@ class ReviewSegmentMaintainer(threading.Thread):
if not object["sub_label"]:
segment.detections[object["id"]] = object["label"]
elif (
object["sub_label"][0]
in self.config.model_for_camera(segment.camera).all_attributes
):
elif object["sub_label"][0] in self.config.model.all_attributes:
segment.detections[object["id"]] = object["sub_label"][0]
else:
segment.detections[object["id"]] = f"{object['label']}-verified"
@@ -577,10 +588,7 @@ class ReviewSegmentMaintainer(threading.Thread):
for object in activity.get_all_objects():
if not object["sub_label"]:
detections[object["id"]] = object["label"]
elif (
object["sub_label"][0]
in self.config.model_for_camera(camera).all_attributes
):
elif object["sub_label"][0] in self.config.model.all_attributes:
detections[object["id"]] = object["sub_label"][0]
else:
detections[object["id"]] = f"{object['label']}-verified"
+9 -181
View File
@@ -86,7 +86,7 @@ class TestConfig(unittest.TestCase):
},
},
# needs to be a file that will exist, doesn't matter what
"models": {"default": {"path": "/etc/hosts", "width": 512}},
"model": {"path": "/etc/hosts", "width": 512},
}
frigate_config = FrigateConfig(**(deep_merge(config, self.minimal)))
@@ -103,7 +103,7 @@ class TestConfig(unittest.TestCase):
assert frigate_config.detectors["edgetpu"].device is None
assert frigate_config.detectors["openvino"].device is None
assert frigate_config.models["default"].path == "/etc/hosts"
assert frigate_config.model.path == "/etc/hosts"
assert frigate_config.detectors["cpu"].model.path == "/cpu_model.tflite"
assert frigate_config.detectors["edgetpu"].model.path == "/edgetpu_model.tflite"
assert frigate_config.detectors["openvino"].model.path == "/etc/hosts"
@@ -956,7 +956,7 @@ class TestConfig(unittest.TestCase):
def test_merge_labelmap(self):
config = {
"mqtt": {"host": "mqtt"},
"models": {"default": {"labelmap": {7: "truck"}}},
"model": {"labelmap": {7: "truck"}},
"cameras": {
"back": {
"ffmpeg": {
@@ -977,7 +977,7 @@ class TestConfig(unittest.TestCase):
}
frigate_config = FrigateConfig(**config)
assert frigate_config.models["default"].merged_labelmap[7] == "truck"
assert frigate_config.model.merged_labelmap[7] == "truck"
def test_default_labelmap_empty(self):
config = {
@@ -1002,12 +1002,12 @@ class TestConfig(unittest.TestCase):
}
frigate_config = FrigateConfig(**config)
assert frigate_config.models["default"].merged_labelmap[0] == "person"
assert frigate_config.model.merged_labelmap[0] == "person"
def test_default_labelmap(self):
config = {
"mqtt": {"host": "mqtt"},
"models": {"default": {"width": 320, "height": 320}},
"model": {"width": 320, "height": 320},
"cameras": {
"back": {
"ffmpeg": {
@@ -1028,7 +1028,7 @@ class TestConfig(unittest.TestCase):
}
frigate_config = FrigateConfig(**config)
assert frigate_config.models["default"].merged_labelmap[0] == "person"
assert frigate_config.model.merged_labelmap[0] == "person"
def test_plus_labelmap(self):
with open(os.path.join(MODEL_CACHE_DIR, "test"), "w") as f:
@@ -1039,7 +1039,7 @@ class TestConfig(unittest.TestCase):
config = {
"mqtt": {"host": "mqtt"},
"detectors": {"cpu": {"type": "cpu"}},
"models": {"default": {"path": "plus://test"}},
"model": {"path": "plus://test"},
"cameras": {
"back": {
"ffmpeg": {
@@ -1060,7 +1060,7 @@ class TestConfig(unittest.TestCase):
}
frigate_config = FrigateConfig(**config)
assert frigate_config.models["default"].merged_labelmap[0] == "amazon"
assert frigate_config.model.merged_labelmap[0] == "amazon"
def test_fails_on_invalid_role(self):
config = {
@@ -1765,177 +1765,5 @@ class TestAttributeFilterDefaults(unittest.TestCase):
self.assertEqual(face_filter.min_score, 0.3)
class TestMultiModelConfig(unittest.TestCase):
"""Tests for named models and detector instance assignment."""
def setUp(self):
self.base = {
"mqtt": {"host": "mqtt"},
"models": {
"indoor": {"width": 320, "height": 320},
"outdoor": {"width": 640, "height": 640},
},
"cameras": {
"living_room": self._camera("indoor"),
"driveway": self._camera("outdoor"),
},
}
def _camera(self, model=None):
camera = {
"ffmpeg": {
"inputs": [{"path": "rtsp://10.0.0.1:554/video", "roles": ["detect"]}]
},
"detect": {"height": 1080, "width": 1920, "fps": 5},
}
if model:
camera["detect"]["model"] = model
return camera
def test_single_model_resolves_implicitly(self):
config = FrigateConfig(
mqtt={"host": "mqtt"},
models={"custom": {"width": 320, "height": 320}},
cameras={"back": self._camera()},
)
assert config.cameras["back"].detect.model == "custom"
def test_multiple_models_resolve_to_default(self):
config = FrigateConfig(
mqtt={"host": "mqtt"},
models={
"default": {"width": 320, "height": 320},
"outdoor": {"width": 640, "height": 640},
},
cameras={"back": self._camera()},
)
assert config.cameras["back"].detect.model == "default"
def test_multiple_models_without_default_requires_selection(self):
config = self.base.copy()
config["cameras"] = {"back": self._camera()}
self.assertRaises(ValidationError, lambda: FrigateConfig(**config))
def test_camera_references_missing_model(self):
config = self.base.copy()
config["cameras"] = {"back": self._camera("thermal")}
self.assertRaises(ValidationError, lambda: FrigateConfig(**config))
def test_global_detect_model_inherited_and_overridden(self):
config = self.base.copy()
config["detect"] = {"model": "indoor"}
config["cameras"] = {
"living_room": self._camera(),
"driveway": self._camera("outdoor"),
}
frigate_config = FrigateConfig(**config)
assert frigate_config.cameras["living_room"].detect.model == "indoor"
assert frigate_config.cameras["driveway"].detect.model == "outdoor"
def test_invalid_model_name(self):
config = self.base.copy()
config["models"] = {"bad name!": {"width": 320, "height": 320}}
self.assertRaises(ValidationError, lambda: FrigateConfig(**config))
def test_multi_model_detector_expands_instances(self):
config = self.base.copy()
config["detectors"] = {
"ov0": {"type": "openvino", "device": "GPU"},
"ov1": {"type": "openvino", "device": "GPU.1"},
}
frigate_config = FrigateConfig(**config)
assert sorted(frigate_config.detector_instances.keys()) == [
"ov0_indoor",
"ov0_outdoor",
"ov1_indoor",
"ov1_outdoor",
]
assert frigate_config.detector_instances["ov0_indoor"].model_key == "indoor"
assert frigate_config.detector_instances["ov0_indoor"].model.width == 320
assert frigate_config.detector_instances["ov0_outdoor"].model.width == 640
def test_multi_model_detector_single_model_keeps_name(self):
config = self.base.copy()
config["models"] = {"default": {"width": 320, "height": 320}}
config["cameras"] = {"back": self._camera()}
config["detectors"] = {"ov": {"type": "openvino", "device": "GPU"}}
frigate_config = FrigateConfig(**config)
assert list(frigate_config.detector_instances.keys()) == ["ov"]
assert frigate_config.detector_instances["ov"].model_key == "default"
def test_single_model_detectors_round_robin(self):
config = self.base.copy()
config["detectors"] = {
"coral0": {"type": "edgetpu", "device": "usb:0"},
"coral1": {"type": "edgetpu", "device": "usb:1"},
"coral2": {"type": "edgetpu", "device": "usb:2"},
}
frigate_config = FrigateConfig(**config)
assignments = {
key: instance.model_key
for key, instance in frigate_config.detector_instances.items()
}
assert assignments == {
"coral0": "indoor",
"coral1": "outdoor",
"coral2": "indoor",
}
def test_single_model_detectors_insufficient_coverage(self):
config = self.base.copy()
config["detectors"] = {"coral": {"type": "edgetpu", "device": "usb"}}
self.assertRaises(ValidationError, lambda: FrigateConfig(**config))
def test_single_model_detector_with_multi_model_detector(self):
config = self.base.copy()
config["detectors"] = {
"coral": {"type": "edgetpu", "device": "usb"},
"ov": {"type": "openvino", "device": "GPU"},
}
frigate_config = FrigateConfig(**config)
assert frigate_config.detector_instances["coral"].model_key == "indoor"
assert frigate_config.detector_instances["ov_indoor"].model_key == "indoor"
assert frigate_config.detector_instances["ov_outdoor"].model_key == "outdoor"
def test_unused_model_gets_no_instances(self):
config = self.base.copy()
config["models"] = {
**config["models"],
"thermal": {"width": 320, "height": 320},
}
frigate_config = FrigateConfig(**config)
model_keys = {
instance.model_key
for instance in frigate_config.detector_instances.values()
}
assert "thermal" not in model_keys
def test_model_path_ignored_when_detector_runs_multiple_models(self):
config = self.base.copy()
config["detectors"] = {
"cpu": {"type": "cpu", "model_path": "/custom_model.tflite"}
}
frigate_config = FrigateConfig(**config)
assert (
frigate_config.detector_instances["cpu_indoor"].model.path
== "/cpu_model.tflite"
)
def test_model_path_applied_when_detector_runs_one_model(self):
config = self.base.copy()
config["models"] = {"default": {"width": 320, "height": 320}}
config["cameras"] = {"back": self._camera()}
config["detectors"] = {
"cpu": {"type": "cpu", "model_path": "/custom_model.tflite"}
}
frigate_config = FrigateConfig(**config)
assert (
frigate_config.detector_instances["cpu"].model.path
== "/custom_model.tflite"
)
if __name__ == "__main__":
unittest.main(verbosity=2)
-42
View File
@@ -1,42 +0,0 @@
"""Tests for config file migration functions."""
import unittest
from frigate.util.config import migrate_019_0
class TestMigrate019(unittest.TestCase):
def test_migrates_model_to_named_models(self):
config = {
"version": "0.18-0",
"mqtt": {"host": "mqtt"},
"model": {"path": "/config/model.tflite", "width": 320, "height": 320},
}
new_config = migrate_019_0(config)
assert "model" not in new_config
assert new_config["models"] == {
"default": {"path": "/config/model.tflite", "width": 320, "height": 320}
}
assert new_config["version"] == "0.19-0"
def test_no_model_defined(self):
config = {"version": "0.18-0", "mqtt": {"host": "mqtt"}}
new_config = migrate_019_0(config)
assert "model" not in new_config
assert "models" not in new_config
assert new_config["version"] == "0.19-0"
def test_existing_models_not_overwritten(self):
config = {
"version": "0.18-0",
"model": {"width": 320},
"models": {"custom": {"width": 640}},
}
new_config = migrate_019_0(config)
assert "model" not in new_config
assert new_config["models"] == {"custom": {"width": 640}}
assert new_config["version"] == "0.19-0"
if __name__ == "__main__":
unittest.main(verbosity=2)
+1 -4
View File
@@ -209,10 +209,7 @@ class TrackedObjectProcessor(threading.Thread):
if obj.obj_data.get("sub_label"):
sub_label = obj.obj_data["sub_label"][0]
if (
sub_label
in self.config.model_for_camera(camera).all_attribute_logos
):
if sub_label in self.config.model.all_attribute_logos:
self.dispatcher.publish(
f"{camera}/{sub_label}/snapshot",
jpg_bytes,
+1 -29
View File
@@ -20,7 +20,7 @@ from frigate.util.services import get_video_properties
logger = logging.getLogger(__name__)
CURRENT_CONFIG_VERSION = "0.19-0"
CURRENT_CONFIG_VERSION = "0.18-0"
DEFAULT_CONFIG_FILE = os.path.join(CONFIG_DIR, "config.yml")
@@ -99,7 +99,6 @@ def migrate_frigate_config(config_file: str):
new_config = migrate_014(config)
with open(config_file, "w") as f:
yaml.dump(new_config, f)
config = new_config
previous_version = "0.14"
logger.info("Migrating export file names...")
@@ -118,7 +117,6 @@ def migrate_frigate_config(config_file: str):
new_config = migrate_015_0(config)
with open(config_file, "w") as f:
yaml.dump(new_config, f)
config = new_config
previous_version = "0.15-0"
if previous_version < "0.15-1":
@@ -126,7 +124,6 @@ def migrate_frigate_config(config_file: str):
new_config = migrate_015_1(config)
with open(config_file, "w") as f:
yaml.dump(new_config, f)
config = new_config
previous_version = "0.15-1"
if previous_version < "0.16-0":
@@ -134,7 +131,6 @@ def migrate_frigate_config(config_file: str):
new_config = migrate_016_0(config)
with open(config_file, "w") as f:
yaml.dump(new_config, f)
config = new_config
previous_version = "0.16-0"
if previous_version < "0.17-0":
@@ -142,7 +138,6 @@ def migrate_frigate_config(config_file: str):
new_config = migrate_017_0(config)
with open(config_file, "w") as f:
yaml.dump(new_config, f)
config = new_config
previous_version = "0.17-0"
if previous_version < "0.18-0":
@@ -150,17 +145,8 @@ def migrate_frigate_config(config_file: str):
new_config = migrate_018_0(config)
with open(config_file, "w") as f:
yaml.dump(new_config, f)
config = new_config
previous_version = "0.18-0"
if previous_version < "0.19-0":
logger.info(f"Migrating frigate config from {previous_version} to 0.19-0...")
new_config = migrate_019_0(config)
with open(config_file, "w") as f:
yaml.dump(new_config, f)
config = new_config
previous_version = "0.19-0"
logger.info("Finished frigate config migration...")
@@ -672,20 +658,6 @@ def migrate_018_0(config: dict[str, dict[str, Any]]) -> dict[str, dict[str, Any]
return new_config
def migrate_019_0(config: dict[str, dict[str, Any]]) -> dict[str, dict[str, Any]]:
"""Handle migrating frigate config to 0.19-0"""
new_config = config.copy()
# Migrate the single model config to named models
model = new_config.pop("model", None)
if model is not None and "models" not in new_config:
new_config["models"] = {"default": model}
new_config["version"] = "0.19-0"
return new_config
def get_relative_coordinates(
mask: str | list | None,
frame_shape: tuple[int, int],
+1 -1
View File
@@ -1 +1 @@
[{"id": "case-001", "name": "Package Theft Investigation", "description": "Review of suspicious activity near the front porch", "created_at": 1784761296.1184616, "updated_at": 1784836896.1184616}]
[{"id": "case-001", "name": "Package Theft Investigation", "description": "Review of suspicious activity near the front porch", "created_at": 1780597809.365581, "updated_at": 1780673409.365581}]
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
[{"id": "event-person-001", "label": "person", "sub_label": null, "camera": "front_door", "start_time": 1784840496.1184616, "end_time": 1784840526.1184616, "false_positive": false, "zones": ["front_yard"], "thumbnail": null, "has_clip": true, "has_snapshot": true, "retain_indefinitely": false, "plus_id": null, "model_hash": "abc123", "detector_type": "cpu", "model_type": "ssd", "data": {"top_score": 0.92, "score": 0.92, "region": [0.1, 0.1, 0.5, 0.8], "box": [0.2, 0.15, 0.45, 0.75], "area": 0.18, "ratio": 0.6, "type": "object", "description": "A person walking toward the front door", "average_estimated_speed": 1.2, "velocity_angle": 45.0, "path_data": [[[0.2, 0.5], 0.0], [[0.3, 0.5], 1.0]]}}, {"id": "event-car-001", "label": "car", "sub_label": null, "camera": "backyard", "start_time": 1784836896.1184616, "end_time": 1784836941.1184616, "false_positive": false, "zones": ["driveway"], "thumbnail": null, "has_clip": true, "has_snapshot": true, "retain_indefinitely": false, "plus_id": null, "model_hash": "def456", "detector_type": "cpu", "model_type": "ssd", "data": {"top_score": 0.87, "score": 0.87, "region": [0.3, 0.2, 0.9, 0.7], "box": [0.35, 0.25, 0.85, 0.65], "area": 0.2, "ratio": 1.25, "type": "object", "description": "A car parked in the driveway", "average_estimated_speed": 0.0, "velocity_angle": 0.0, "path_data": []}}, {"id": "event-person-002", "label": "person", "sub_label": null, "camera": "garage", "start_time": 1784833296.1184616, "end_time": 1784833316.1184616, "false_positive": false, "zones": [], "thumbnail": null, "has_clip": false, "has_snapshot": true, "retain_indefinitely": false, "plus_id": null, "model_hash": "ghi789", "detector_type": "cpu", "model_type": "ssd", "data": {"top_score": 0.78, "score": 0.78, "region": [0.0, 0.0, 0.6, 0.9], "box": [0.1, 0.05, 0.5, 0.85], "area": 0.32, "ratio": 0.5, "type": "object", "description": null, "average_estimated_speed": 0.5, "velocity_angle": 90.0, "path_data": [[[0.1, 0.4], 0.0]]}}]
[{"id": "event-person-001", "label": "person", "sub_label": null, "camera": "front_door", "start_time": 1780677009.365581, "end_time": 1780677039.365581, "false_positive": false, "zones": ["front_yard"], "thumbnail": null, "has_clip": true, "has_snapshot": true, "retain_indefinitely": false, "plus_id": null, "model_hash": "abc123", "detector_type": "cpu", "model_type": "ssd", "data": {"top_score": 0.92, "score": 0.92, "region": [0.1, 0.1, 0.5, 0.8], "box": [0.2, 0.15, 0.45, 0.75], "area": 0.18, "ratio": 0.6, "type": "object", "description": "A person walking toward the front door", "average_estimated_speed": 1.2, "velocity_angle": 45.0, "path_data": [[[0.2, 0.5], 0.0], [[0.3, 0.5], 1.0]]}}, {"id": "event-car-001", "label": "car", "sub_label": null, "camera": "backyard", "start_time": 1780673409.365581, "end_time": 1780673454.365581, "false_positive": false, "zones": ["driveway"], "thumbnail": null, "has_clip": true, "has_snapshot": true, "retain_indefinitely": false, "plus_id": null, "model_hash": "def456", "detector_type": "cpu", "model_type": "ssd", "data": {"top_score": 0.87, "score": 0.87, "region": [0.3, 0.2, 0.9, 0.7], "box": [0.35, 0.25, 0.85, 0.65], "area": 0.2, "ratio": 1.25, "type": "object", "description": "A car parked in the driveway", "average_estimated_speed": 0.0, "velocity_angle": 0.0, "path_data": []}}, {"id": "event-person-002", "label": "person", "sub_label": null, "camera": "garage", "start_time": 1780669809.365581, "end_time": 1780669829.365581, "false_positive": false, "zones": [], "thumbnail": null, "has_clip": false, "has_snapshot": true, "retain_indefinitely": false, "plus_id": null, "model_hash": "ghi789", "detector_type": "cpu", "model_type": "ssd", "data": {"top_score": 0.78, "score": 0.78, "region": [0.0, 0.0, 0.6, 0.9], "box": [0.1, 0.05, 0.5, 0.85], "area": 0.32, "ratio": 0.5, "type": "object", "description": null, "average_estimated_speed": 0.5, "velocity_angle": 90.0, "path_data": [[[0.1, 0.4], 0.0]]}}]
+1 -1
View File
@@ -1 +1 @@
[{"id": "export-001", "camera": "front_door", "name": "Front Door - Person Alert", "date": 1784844096.1184616, "video_path": "/exports/export-001.mp4", "thumb_path": "/exports/export-001-thumb.jpg", "in_progress": false, "export_case_id": null}, {"id": "export-002", "camera": "backyard", "name": "Backyard - Car Detection", "date": 1784836896.1184616, "video_path": "/exports/export-002.mp4", "thumb_path": "/exports/export-002-thumb.jpg", "in_progress": false, "export_case_id": "case-001"}, {"id": "export-003", "camera": "garage", "name": "Garage - In Progress", "date": 1784845896.1184616, "video_path": "/exports/export-003.mp4", "thumb_path": "/exports/export-003-thumb.jpg", "in_progress": true, "export_case_id": null}]
[{"id": "export-001", "camera": "front_door", "name": "Front Door - Person Alert", "date": 1780680609.365581, "video_path": "/exports/export-001.mp4", "thumb_path": "/exports/export-001-thumb.jpg", "in_progress": false, "export_case_id": null}, {"id": "export-002", "camera": "backyard", "name": "Backyard - Car Detection", "date": 1780673409.365581, "video_path": "/exports/export-002.mp4", "thumb_path": "/exports/export-002-thumb.jpg", "in_progress": false, "export_case_id": "case-001"}, {"id": "export-003", "camera": "garage", "name": "Garage - In Progress", "date": 1780682409.365581, "video_path": "/exports/export-003.mp4", "thumb_path": "/exports/export-003-thumb.jpg", "in_progress": true, "export_case_id": null}]
@@ -102,17 +102,11 @@ def generate_config():
snapshot = config.model_dump()
# Runtime-computed fields not in the Pydantic dump
for model_dict in snapshot.get("models", {}).values():
all_attrs = set()
for attrs in model_dict.get("attributes_map", {}).values():
all_attrs.update(attrs)
model_dict["all_attributes"] = sorted(all_attrs)
model_dict["colormap"] = {}
# legacy single-model block mirrors the default model, matching /api/config
models = snapshot.get("models", {})
default_key = "default" if "default" in models else next(iter(models))
snapshot["model"] = models[default_key]
all_attrs = set()
for attrs in snapshot.get("model", {}).get("attributes_map", {}).values():
all_attrs.update(attrs)
snapshot["model"]["all_attributes"] = sorted(all_attrs)
snapshot["model"]["colormap"] = {}
return snapshot
@@ -1 +1 @@
{"2026-07-23": {"day": "2026-07-23", "reviewed_alert": 1, "reviewed_detection": 0, "total_alert": 2, "total_detection": 2}, "2026-07-22": {"day": "2026-07-22", "reviewed_alert": 3, "reviewed_detection": 2, "total_alert": 3, "total_detection": 4}}
{"2026-06-05": {"day": "2026-06-05", "reviewed_alert": 1, "reviewed_detection": 0, "total_alert": 2, "total_detection": 2}, "2026-06-04": {"day": "2026-06-04", "reviewed_alert": 3, "reviewed_detection": 2, "total_alert": 3, "total_detection": 4}}
+1 -1
View File
@@ -1 +1 @@
[{"id": "review-alert-001", "camera": "front_door", "start_time": "2026-07-23T21:01:36.118462", "end_time": "2026-07-23T21:02:06.118462", "has_been_reviewed": false, "severity": "alert", "thumb_path": "/clips/front_door/review-alert-001-thumb.jpg", "data": {"audio": [], "detections": ["person-abc123"], "objects": ["person"], "sub_labels": [], "significant_motion_areas": [], "zones": ["front_yard"]}}, {"id": "review-alert-002", "camera": "backyard", "start_time": "2026-07-23T20:01:36.118462", "end_time": "2026-07-23T20:02:21.118462", "has_been_reviewed": true, "severity": "alert", "thumb_path": "/clips/backyard/review-alert-002-thumb.jpg", "data": {"audio": [], "detections": ["car-def456"], "objects": ["car"], "sub_labels": [], "significant_motion_areas": [], "zones": ["driveway"]}}, {"id": "review-detect-001", "camera": "garage", "start_time": "2026-07-23T19:01:36.118462", "end_time": "2026-07-23T19:01:56.118462", "has_been_reviewed": false, "severity": "detection", "thumb_path": "/clips/garage/review-detect-001-thumb.jpg", "data": {"audio": [], "detections": ["person-ghi789"], "objects": ["person"], "sub_labels": [], "significant_motion_areas": [], "zones": []}}, {"id": "review-detect-002", "camera": "front_door", "start_time": "2026-07-23T18:01:36.118462", "end_time": "2026-07-23T18:01:51.118462", "has_been_reviewed": false, "severity": "detection", "thumb_path": "/clips/front_door/review-detect-002-thumb.jpg", "data": {"audio": [], "detections": ["car-jkl012"], "objects": ["car"], "sub_labels": [], "significant_motion_areas": [], "zones": ["front_yard"]}}]
[{"id": "review-alert-001", "camera": "front_door", "start_time": "2026-06-05T11:30:09.365581", "end_time": "2026-06-05T11:30:39.365581", "has_been_reviewed": false, "severity": "alert", "thumb_path": "/clips/front_door/review-alert-001-thumb.jpg", "data": {"audio": [], "detections": ["person-abc123"], "objects": ["person"], "sub_labels": [], "significant_motion_areas": [], "zones": ["front_yard"]}}, {"id": "review-alert-002", "camera": "backyard", "start_time": "2026-06-05T10:30:09.365581", "end_time": "2026-06-05T10:30:54.365581", "has_been_reviewed": true, "severity": "alert", "thumb_path": "/clips/backyard/review-alert-002-thumb.jpg", "data": {"audio": [], "detections": ["car-def456"], "objects": ["car"], "sub_labels": [], "significant_motion_areas": [], "zones": ["driveway"]}}, {"id": "review-detect-001", "camera": "garage", "start_time": "2026-06-05T09:30:09.365581", "end_time": "2026-06-05T09:30:29.365581", "has_been_reviewed": false, "severity": "detection", "thumb_path": "/clips/garage/review-detect-001-thumb.jpg", "data": {"audio": [], "detections": ["person-ghi789"], "objects": ["person"], "sub_labels": [], "significant_motion_areas": [], "zones": []}}, {"id": "review-detect-002", "camera": "front_door", "start_time": "2026-06-05T08:30:09.365581", "end_time": "2026-06-05T08:30:24.365581", "has_been_reviewed": false, "severity": "detection", "thumb_path": "/clips/front_door/review-detect-002-thumb.jpg", "data": {"audio": [], "detections": ["car-jkl012"], "objects": ["car"], "sub_labels": [], "significant_motion_areas": [], "zones": ["front_yard"]}}]
+4 -4
View File
@@ -73,7 +73,7 @@
"react-markdown": "^9.0.1",
"react-router-dom": "^6.30.3",
"react-swipeable": "^7.0.2",
"react-zoom-pan-pinch": "^3.7.0",
"react-zoom-pan-pinch": "3.6.1",
"remark-gfm": "^4.0.0",
"scroll-into-view-if-needed": "^3.1.0",
"sonner": "^2.0.7",
@@ -12354,9 +12354,9 @@
}
},
"node_modules/react-zoom-pan-pinch": {
"version": "3.7.0",
"resolved": "https://registry.npmjs.org/react-zoom-pan-pinch/-/react-zoom-pan-pinch-3.7.0.tgz",
"integrity": "sha512-UmReVZ0TxlKzxSbYiAj+LeGRW8s8LraAFTXRAxzMYnNRgGPsxCudwZKVkjvGmjtx7SW/hZamt69NUmGf4xrkXA==",
"version": "3.6.1",
"resolved": "https://registry.npmjs.org/react-zoom-pan-pinch/-/react-zoom-pan-pinch-3.6.1.tgz",
"integrity": "sha512-SdPqdk7QDSV7u/WulkFOi+cnza8rEZ0XX4ZpeH7vx3UZEg7DoyuAy3MCmm+BWv/idPQL2Oe73VoC0EhfCN+sZQ==",
"license": "MIT",
"engines": {
"node": ">=8",
+1 -1
View File
@@ -87,7 +87,7 @@
"react-markdown": "^9.0.1",
"react-router-dom": "^6.30.3",
"react-swipeable": "^7.0.2",
"react-zoom-pan-pinch": "^3.7.0",
"react-zoom-pan-pinch": "3.6.1",
"remark-gfm": "^4.0.0",
"scroll-into-view-if-needed": "^3.1.0",
"sonner": "^2.0.7",
@@ -86,10 +86,6 @@
"label": "Enable object detection",
"description": "Enable or disable object detection for this camera."
},
"model": {
"label": "Detection model name",
"description": "Name of the model (key under `models`) used by this camera. Defaults to the only defined model, or the model named 'default'."
},
"height": {
"label": "Detect height",
"description": "Height (pixels) of frames used for the detect stream; leave empty to use the native stream resolution."
+3 -11
View File
@@ -329,10 +329,6 @@
"label": "Detector specific model path",
"description": "File path to the detector model binary if required by the chosen detector."
},
"model_key": {
"label": "Assigned model name",
"description": "Name of the model (key under `models`) this detector instance serves. Set automatically at runtime, users should not set this."
},
"axengine": {
"label": "AXEngine NPU",
"description": "AXERA AX650N/AX8850N NPU detector running compiled .axmodel files via the AXEngine runtime."
@@ -458,9 +454,9 @@
}
}
},
"models": {
"label": "Detection models",
"description": "Named object detection models. Cameras select a model with detect.model; detectors are assigned to models automatically.",
"model": {
"label": "Detection model",
"description": "Settings to configure a custom object detection model and its input shape.",
"path": {
"label": "Custom object detector model path",
"description": "Path to a custom detection model file (or plus://<model_id> for Frigate+ models)."
@@ -629,10 +625,6 @@
"label": "Enable object detection",
"description": "Enable or disable object detection for all cameras; can be overridden per-camera."
},
"model": {
"label": "Detection model name",
"description": "Name of the model (key under `models`) used by this camera. Defaults to the only defined model, or the model named 'default'."
},
"height": {
"label": "Detect height",
"description": "Height (pixels) of frames used for the detect stream; leave empty to use the native stream resolution."
+3 -1
View File
@@ -125,5 +125,7 @@
"baby": "Baby",
"baby_stroller": "Baby Stroller",
"rickshaw": "Rickshaw",
"rodent": "Rodent"
"rodent": "Rodent",
"possum": "Possum",
"garbage_truck": "Garbage Truck"
}
@@ -74,7 +74,6 @@ const SECTIONS_WITHOUT_OVERRIDE_BADGE = new Set([
"birdseye",
"detectors",
"model",
"models",
]);
type CameraEntryProps = {
+39
View File
@@ -0,0 +1,39 @@
import { SVGProps } from "react";
/**
* Skunk silhouette for the `skunk` object label.
*
* react-icons has no skunk in any of its packs. The usable stand-ins are
* either squirrels, which are indistinguishable from the `squirrel` label, or
* animals such as porcupine and hedgehog that are themselves Frigate+
* candidate labels.
*
* Adapted from "skunk silhouette" by dear_theophilus, published by Openclipart
* and released into the public domain, which permits reproduction,
* distribution and derivative works:
* https://openclipart.org/detail/170808/skunk-silhouette-by-dear_theophilus-170808
*
* Changes from the original: the unused Inkscape text region was dropped, the
* layer translate was folded into the viewBox, the viewBox was padded to give
* the same optical margin as the surrounding react-icons, and the fill was
* switched to currentColor. The white back stripe is negative space in a
* single path under the default nonzero fill rule, so no fill-rule override is
* needed here.
*
* Sized to sit alongside the react-icons set: currentColor fill and a 1em
* default box.
*/
export default function SkunkIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="96.87 93.174 110.58 109.81"
fill="currentColor"
height="1em"
width="1em"
{...props}
>
<path d="m169.58 196.93c-0.18864-0.85889 0.0134-1.3274 0.99603-2.31 0.67796-0.67797 1.7065-1.3304 2.2857-1.4498 1.3854-0.2857 5.2538-1.7692 5.8796-2.2549 0.27087-0.2102 0.4925-0.61406 0.4925-0.89746 0-0.77202-6.6659-6.0863-7.6343-6.0863-0.46161 0-2.0798 0.36441-3.596 0.80981-3.4618 1.0169-10.449 1.4599-16.39 1.0391-7.1408-0.50577-6.6473-0.58559-8.3439 1.3494-0.8327 0.94969-1.9642 2.5979-2.5144 3.6627-1.164 2.2525-4.5952 6.5163-5.8025 7.2106-1.0288 0.59154-4.5445 0.64844-5.9949 0.097-0.71722-0.27269-1.4467-0.28055-2.184-0.0235-2.4986 0.871-1.4597-1.341 1.2885-2.7437 0.78536-0.40084 1.9099-1.3016 2.499-2.0016 1.0163-1.2078 1.0634-1.4452 0.92116-4.6468-0.12622-2.8412-0.38301-3.9062-1.6262-6.7446-2.6443-6.0373-7.3573-11.099-12.678-13.617-1.5889-0.75179-2.62-0.93285-5.3302-0.93595-3.0016-0.004-3.6532-0.14511-6.107-1.3278-5.2109-2.5116-5.8227-4.8841-1.4913-5.7833 1.8591-0.38596 2.618-0.82052 4.4338-2.539 1.2049-1.1403 2.7581-2.3618 3.4516-2.7146 1.9684-1.001 7.7872-0.84521 13.816 0.37 5.7138 1.1517 10.339 1.3571 13.488 0.59905 1.1919-0.28691 4.6492-1.5446 7.683-2.7949 9.8002-4.0389 14.311-4.9373 19.109-3.806 1.4086 0.33208 2.7106 0.4572 2.8935 0.27806 1.0374-1.0164-1.1645-3.1382-6.6365-6.3947-5.6439-3.3588-9.8091-9.1231-10.764-14.897-0.60953-3.6839 0.72362-12.081 1.2923-13.596 0.56871-1.5152 1.4436-3.3754 1.9442-4.1338 2.9223-4.4276 8.177-9.1772 12.256-11.078 6.691-3.1177 17.754-2.3107 25.847 1.8855 3.5353 1.8329 6.7739 4.7994 8.0035 7.3309 1.3563 2.7924 2.3788 9.4802 1.6321 10.675-0.28831 0.46149-1.0187 1.9915-1.6231 3.4001-1.0066 2.3458-2.3392 4.3362-2.9009 4.3326-0.12475-0.00078-0.81827-1.1453-1.5412-2.5434-1.642-3.1756-6.3156-7.6992-7.9544-7.6992-0.58481 0-2.2156 0.52248-3.624 1.1611-3.1804 1.4421-4.0269 2.8569-3.7769 6.3127 0.24247 3.3521 2.1549 6.8946 9.8511 18.247 3.3307 4.9132 4.5143 10.219 3.7106 16.634-0.40898 3.2645-0.77579 4.5016-2.1396 7.2158-0.90527 1.8017-2.1169 3.8932-2.6924 4.6478-1.3686 1.7944-3.6318 10.202-4.0199 14.935-0.34632 4.2221-1.4143 6.7775-3.7479 8.9681l-1.5853 1.4881s-10.87 1.3087-11.076 0.36929zm-0.94988-19.482c5.4569-0.84327 10.316-2.9685 15.305-6.694 2.2799-1.7026 7.2867-9.9628 7.5372-11.17 1.1907-5.7355-0.81743-10.348-8.1457-18.709-1.1818-1.3484-3.251-4.3132-4.5981-6.5886 0 0-1.8246-3.0395-2.2503-4.734-0.4037-1.6068-0.24133-4.9643-0.24133-4.9643-0.0233-3.0587 1.7125-7.8176 2.7258-8.9913 2.4126-2.7945 5.1792-3.93 8.9395-3.6689 2.4539 0.17036 6.2631 1.6358 6.8904 2.6509 0.46463 0.75179 1.7776 0.45185 1.7776-0.40608 0-2.1062-2.1313-4.3793-5.8702-6.261-8.5709-4.3134-18.12-1.6112-22.089 6.2506-0.84198 1.6679-1.9752 7.8544-1.5778 9.9776 0.98137 5.2435 7.314 15.066 15.216 23.602 2.3474 2.5357 2.891 3.3814 3.2505 5.0579 0.62386 2.909 0.53762 3.9625-0.45679 5.5804-2.2494 3.6597-6.0764 5.9532-12.424 7.446-5.4931 1.2918-14.085 0.80251-19.932-1.135-2.8291-0.93745-3.2146-1.1799-3.3204-2.0877-0.26031-2.2347 5.8542-6.1292 12.294-7.8306 1.712-0.45228 3.469-1.013 3.9045-1.2461 2.613-1.3984-5.139-1.3894-10.001 0.0116-1.4244 0.41047-4.1726 1.3784-6.107 2.151-4.0916 1.6341-9.9725 3.2146-13.412 3.6046-1.9171 0.21734-3.2711 0.0654-6.6311-0.74437-6.6813-1.6101-8.8678-1.2892-6.6918 0.98197 1.1258 1.1751 6.0865 4.3046 6.8234 4.3046 0.22537 0 0.58888 0.3347 0.80781 0.74378 0.50815 0.94949 5.6856 4.2866 11.253 7.2529 3.5996 1.918 5.4022 2.5812 10.638 3.9141 3.4672 0.88264 7.7224 1.7278 9.456 1.8781 1.7336 0.15029 3.1675 0.30072 3.1864 0.33427 0.0189 0.0336 1.7032-0.1969 3.743-0.5121zm-55.67-16.07c0.0817-0.43098-0.25131-0.85888-0.89769-1.1534-0.8518-0.38811-1.1373-0.35853-1.6687 0.17289-0.53858 0.53858-0.55739 0.74197-0.11767 1.2718 0.67722 0.816 2.5119 0.61688 2.6841-0.29131zm7.5598-0.11521c0-0.95213-0.94275-1.7372-1.4622-1.2177-0.30143 0.30141 0.67899 2.2151 1.1348 2.2151 0.18008 0 0.32742-0.44882 0.32742-0.99738z" />
</svg>
);
}
@@ -20,6 +20,26 @@ function formatCalendarDay(day: Date): string {
return `${y}-${m}-${d}`;
}
function getTodayInTimezone(timezone?: string): {
year: number;
month: number;
day: number;
offset: number;
} {
const now = new Date();
const offset = Math.round(getUTCOffset(now, timezone));
// shifting by the offset makes the UTC getters read the timezone's wall clock
const wallClock = new Date(now.getTime() + offset * 60000);
return {
year: wallClock.getUTCFullYear(),
month: wallClock.getUTCMonth(),
day: wallClock.getUTCDate(),
offset,
};
}
type ReviewActivityCalendarProps = {
reviewSummary?: ReviewSummary;
recordingsSummary?: RecordingsSummary;
@@ -37,12 +57,14 @@ export default function ReviewActivityCalendar({
const [weekStartsOn] = useUserPersistence("weekStartsOn", 0);
const disabledDates = useMemo(() => {
const tomorrow = new Date();
tomorrow.setHours(tomorrow.getHours() + 24, -1, 0, 0);
const future = new Date();
future.setFullYear(tomorrow.getFullYear() + 10);
return { from: tomorrow, to: future };
}, []);
// day cells are TZDate in `timezone`, so the cutoff must be a real instant
const { year, month, day, offset } = getTodayInTimezone(timezone);
// midday: ranges match by calendar day, so this dodges DST edges
const from = new Date(Date.UTC(year, month, day + 1, 12) - offset * 60000);
const to = new Date(from);
to.setFullYear(from.getFullYear() + 10);
return { from, to };
}, [timezone]);
const modifiers = useMemo(() => {
const recordingsSet = new Set<string>();
@@ -182,48 +204,25 @@ export function TimezoneAwareCalendar({
};
}, [recordingsSummary]);
const timezoneOffset = useMemo(
() =>
timezone ? Math.round(getUTCOffset(new Date(), timezone)) : undefined,
// callers pre-shift dates so the local clock reads `timezone`, so boundaries
// are built in local time rather than as instants
const { year, month, day } = useMemo(
() => getTodayInTimezone(timezone),
[timezone],
);
const disabledDates = useMemo(() => {
const tomorrow = new Date();
// midday: ranges match by calendar day, so this dodges DST edges
const from = new Date(year, month, day + 1, 12);
const to = new Date(from);
to.setFullYear(from.getFullYear() + 10);
return { from, to };
}, [year, month, day]);
if (timezoneOffset) {
tomorrow.setHours(
tomorrow.getHours() + 24,
tomorrow.getMinutes() + timezoneOffset,
0,
0,
);
} else {
tomorrow.setHours(tomorrow.getHours() + 24, -1, 0, 0);
}
const future = new Date();
future.setFullYear(tomorrow.getFullYear() + 10);
return { from: tomorrow, to: future };
}, [timezoneOffset]);
const today = useMemo(() => {
if (!timezoneOffset) {
return undefined;
}
const date = new Date();
const utc = Date.UTC(
date.getUTCFullYear(),
date.getUTCMonth(),
date.getUTCDate(),
date.getUTCHours(),
date.getUTCMinutes(),
date.getUTCSeconds(),
);
const todayUtc = new Date(utc);
todayUtc.setMinutes(todayUtc.getMinutes() + timezoneOffset, 0, 0);
return todayUtc;
}, [timezoneOffset]);
const today = useMemo(
() => new Date(year, month, day, 12),
[year, month, day],
);
return (
<Calendar
+1 -11
View File
@@ -70,17 +70,7 @@ export function extractSectionSchema(
// For global level, get from root properties
if (schemaObj.properties) {
const props = schemaObj.properties;
let sectionProp = props[sectionPath];
// the model editor edits a single entry of the `models` map, so
// resolve the map value schema since there is no root `model` property
if (!sectionProp && sectionPath === "model") {
const modelsProp = props["models"] as SchemaWithDefinitions | undefined;
const additional = modelsProp?.additionalProperties;
if (additional && typeof additional === "object") {
sectionProp = additional as RJSFSchema;
}
}
const sectionProp = props[sectionPath];
if (sectionProp && typeof sectionProp === "object") {
if ("$ref" in sectionProp && typeof sectionProp.$ref === "string") {
+23 -30
View File
@@ -59,7 +59,6 @@ export interface CameraConfig {
height: number;
max_disappeared: number;
min_initialized: number;
model: string;
stationary: {
interval: number;
max_frames: {
@@ -395,30 +394,6 @@ export type GenAIAgentConfig = {
runtime_options?: Record<string, unknown>;
};
export interface ModelConfig {
height: number;
input_pixel_format: string;
input_tensor: string;
labelmap: Record<string, unknown>;
labelmap_path: string | null;
model_type: string;
path: string | null;
width: number;
colormap: { [key: string]: [number, number, number] };
attributes_map: { [key: string]: string[] };
all_attributes: string[];
plus?: {
name: string;
id: string;
trainDate: string;
baseModel: string;
isBaseModel: boolean;
supportedDetectors: string[];
width: number;
height: number;
} | null;
}
export interface FrigateConfig {
version: string;
safe_mode: boolean;
@@ -471,7 +446,6 @@ export interface FrigateConfig {
height: number | null;
max_disappeared: number | null;
min_initialized: number | null;
model: string | null;
stationary: {
interval: number | null;
max_frames: {
@@ -538,10 +512,29 @@ export interface FrigateConfig {
logs: Record<string, string>;
};
// legacy single-model block, mirrors the default entry of `models`
model: ModelConfig;
models: { [modelKey: string]: ModelConfig };
model: {
height: number;
input_pixel_format: string;
input_tensor: string;
labelmap: Record<string, unknown>;
labelmap_path: string | null;
model_type: string;
path: string | null;
width: number;
colormap: { [key: string]: [number, number, number] };
attributes_map: { [key: string]: string[] };
all_attributes: string[];
plus?: {
name: string;
id: string;
trainDate: string;
baseModel: string;
isBaseModel: boolean;
supportedDetectors: string[];
width: number;
height: number;
} | null;
};
motion: Record<string, unknown> | null;
+24 -2
View File
@@ -1,9 +1,12 @@
import { IconName } from "@/components/icons/IconPicker";
import SkunkIcon from "@/components/icons/SkunkIcon";
import { FrigateConfig } from "@/types/frigateConfig";
import { EventType } from "@/types/search";
import { BsPersonWalking } from "react-icons/bs";
import {
FaAmazon,
FaBaby,
FaBabyCarriage,
FaBicycle,
FaBus,
FaCarSide,
@@ -24,6 +27,8 @@ import {
FaUsps,
} from "react-icons/fa";
import {
GiBarbecue,
GiCow,
GiDeer,
GiFox,
GiGoat,
@@ -32,7 +37,9 @@ import {
GiPostStamp,
GiRabbit,
GiRaccoonHead,
GiRat,
GiSailboat,
GiSeatedMouse,
GiSoundWaves,
GiSquirrel,
} from "react-icons/gi";
@@ -40,6 +47,7 @@ import { LuBox, LuLassoSelect, LuScanBarcode } from "react-icons/lu";
import * as LuIcons from "react-icons/lu";
import { MdRecordVoiceOver } from "react-icons/md";
import { PiBirdFill } from "react-icons/pi";
import { HiMiniTruck } from "react-icons/hi2";
export function getAttributeLabels(config?: FrigateConfig) {
if (!config) {
@@ -74,6 +82,12 @@ export function getIconForLabel(
switch (label) {
// objects
case "baby":
return <FaBaby key={iconKey} className={className} />;
case "baby_stroller":
return <FaBabyCarriage key={iconKey} className={className} />;
case "bbq_grill":
return <GiBarbecue key={iconKey} className={className} />;
case "bear":
return <GiPolarBear key={iconKey} className={className} />;
case "bicycle":
@@ -90,6 +104,8 @@ export function getIconForLabel(
return <FaCarSide key={iconKey} className={className} />;
case "cat":
return <FaCat key={iconKey} className={className} />;
case "cow":
return <GiCow key={iconKey} className={className} />;
case "deer":
return <GiDeer key={iconKey} className={className} />;
case "animal":
@@ -98,6 +114,8 @@ export function getIconForLabel(
return <FaDog key={iconKey} className={className} />;
case "fox":
return <GiFox key={iconKey} className={className} />;
case "garbage_truck":
return <HiMiniTruck key={iconKey} className={className} />;
case "goat":
return <GiGoat key={iconKey} className={className} />;
case "horse":
@@ -114,18 +132,22 @@ export function getIconForLabel(
return <LuBox key={iconKey} className={className} />;
case "person":
return <BsPersonWalking key={iconKey} className={className} />;
case "possum":
return <GiSeatedMouse key={iconKey} className={className} />;
case "rabbit":
return <GiRabbit key={iconKey} className={className} />;
case "raccoon":
return <GiRaccoonHead key={iconKey} className={className} />;
case "robot_lawnmower":
return <FaHockeyPuck key={iconKey} className={className} />;
case "rodent":
return <GiRat key={iconKey} className={className} />;
case "sports_ball":
return <FaFootballBall key={iconKey} className={className} />;
case "skunk":
return <GiSquirrel key={iconKey} className={className} />;
return <SkunkIcon key={iconKey} className={className} />;
case "squirrel":
return <LuIcons.LuSquirrel key={iconKey} className={className} />;
return <GiSquirrel key={iconKey} className={className} />;
case "umbrella":
return <FaUmbrella key={iconKey} className={className} />;
case "waste_bin":
@@ -115,10 +115,8 @@ const STATUS_BAR_KEY = "detectors_and_model";
const EMPTY_PENDING: Record<string, ConfigSectionData> = {};
const deriveInitialState = (config: FrigateConfig): PageState => {
// this view edits the default model; other named models are untouched
const defaultModel = config.models?.default ?? config.model;
const plusModelId = defaultModel?.plus?.id;
const modelPath = defaultModel?.path;
const plusModelId = config.model?.plus?.id;
const modelPath = config.model?.path;
const plusEnabled = Boolean(config.plus?.enabled);
// The reliable signal that a Plus model is currently active is the
@@ -138,8 +136,10 @@ const deriveInitialState = (config: FrigateConfig): PageState => {
modelTab = "custom";
}
const { plus: _plus, ...modelWithoutPlus } = (defaultModel ??
{}) as unknown as Record<string, unknown>;
const { plus: _plus, ...modelWithoutPlus } = (config.model ?? {}) as Record<
string,
unknown
>;
// If a Plus model is active, the resolved `model.path` is auto-derived from
// `plus.id` — drop it so the Custom tab starts clean and doesn't silently
// re-save the same Plus model when the user thinks they switched modes.
@@ -476,7 +476,7 @@ export default function DetectorsAndModelSettingsView({
try {
await axios.put("config/set", {
requires_restart: 0,
config_data: { detectors: null, models: { default: null } },
config_data: { detectors: null, model: null },
});
preCleared = true;
} catch {
@@ -488,7 +488,7 @@ export default function DetectorsAndModelSettingsView({
requires_restart: 0,
config_data: {
detectors: sanitizedDetectors,
models: { default: modelPayload },
model: modelPayload,
},
});
@@ -541,7 +541,7 @@ export default function DetectorsAndModelSettingsView({
snapshot.detectors,
detectorHiddenFields,
),
models: { default: restoreModel },
model: restoreModel,
},
});
} catch {