mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-09-28 10:56:52 +03:00
Compare commits
143
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d96efdbf2e | ||
|
|
0d78aca388 | ||
|
|
c0b2693c5b | ||
|
|
39ab6c8a10 | ||
|
|
0dd3713af8 | ||
|
|
52460a8fbb | ||
|
|
fea9901ae5 | ||
|
|
4db703cc3d | ||
|
|
b63a3d327d | ||
|
|
5b32ec4fbd | ||
|
|
12a80f5713 | ||
|
|
598520b5c2 | ||
|
|
89e5f60fab | ||
|
|
aa7c9f441f | ||
|
|
2aaf96d043 | ||
|
|
b7d705a028 | ||
|
|
68688a6c23 | ||
|
|
1fac827dde | ||
|
|
a1048654ee | ||
|
|
f75e55ee74 | ||
|
|
3bda638678 | ||
|
|
5cf98824f5 | ||
|
|
687e118b58 | ||
|
|
95daf0ba05 | ||
|
|
213dc97c17 | ||
|
|
ee1db240d7 | ||
|
|
79655379be | ||
|
|
f29cf43f52 | ||
|
|
cd54a81150 | ||
|
|
178117183e | ||
|
|
d69916694b | ||
|
|
fc608b31d7 | ||
|
|
9ffa7f140c | ||
|
|
6563f78ab0 | ||
|
|
4339f26ded | ||
|
|
86a3e31edf | ||
|
|
7238b3ea22 | ||
|
|
ea576e7468 | ||
|
|
5593495abd | ||
|
|
fd96cd5dae | ||
|
|
e0c1fea2ac | ||
|
|
f97629433d | ||
|
|
aabd5b0077 | ||
|
|
623bc72633 | ||
|
|
f3a0d519fb | ||
|
|
cc368dd20f | ||
|
|
8a9ebe9292 | ||
|
|
4ff81d5877 | ||
|
|
fe571dc217 | ||
|
|
42cae5d9ee | ||
|
|
ce2b60a4df | ||
|
|
02f75d3b1f | ||
|
|
c935a76a45 | ||
|
|
d727adddde | ||
|
|
2d586eeeb7 | ||
|
|
25cc2f31d4 | ||
|
|
4a21b2f16d | ||
|
|
99e7533de2 | ||
|
|
03768e0050 | ||
|
|
ed43df9c13 | ||
|
|
460e291bf1 | ||
|
|
dba9206898 | ||
|
|
af5a9e7634 | ||
|
|
afaac33c60 | ||
|
|
f141b585bc | ||
|
|
9de7f80727 | ||
|
|
2101b1f91d | ||
|
|
2b5a30e23b | ||
|
|
dd6114586c | ||
|
|
d508a8b5fe | ||
|
|
feb40e9d05 | ||
|
|
2548af13b9 | ||
|
|
547c61f54c | ||
|
|
34e92ef4ae | ||
|
|
dbf440b0c7 | ||
|
|
321fd136c0 | ||
|
|
c9708102a9 | ||
|
|
85d8d7b136 | ||
|
|
b0e6a64bd0 | ||
|
|
2af1d22643 | ||
|
|
c026060ff3 | ||
|
|
8a117de87e | ||
|
|
a43f87c477 | ||
|
|
15c7a4074b | ||
|
|
ca650a29a1 | ||
|
|
0896df6500 | ||
|
|
01998dfb70 | ||
|
|
cb1cdcc814 | ||
|
|
63473b0b82 | ||
|
|
ee51326d35 | ||
|
|
2ada0d22cb | ||
|
|
81f5f362a9 | ||
|
|
27914fc3b8 | ||
|
|
c11ca42fb5 | ||
|
|
9b7d4d0a8f | ||
|
|
cbdac9ece5 | ||
|
|
948b087d3c | ||
|
|
63f9689b0e | ||
|
|
6969a7fd47 | ||
|
|
8274b733da | ||
|
|
858c1241db | ||
|
|
c16e536b46 | ||
|
|
49c6073de6 | ||
|
|
2a8b62acb1 | ||
|
|
37d40558b7 | ||
|
|
afe513336c | ||
|
|
8a143b4284 | ||
|
|
717517aeb5 | ||
|
|
f4d5ebf4db | ||
|
|
b18572a3b6 | ||
|
|
b10615aef1 | ||
|
|
5d13925d2b | ||
|
|
ebae6cb1ed | ||
|
|
2f9b373c1a | ||
|
|
f48356cbee | ||
|
|
3538a1df3d | ||
|
|
c15fbee537 | ||
|
|
7612c3ece0 | ||
|
|
d3d05fa397 | ||
|
|
77589c18f4 | ||
|
|
6a62467998 | ||
|
|
6857cc2b97 | ||
|
|
37618b0f57 | ||
|
|
e7f6e069f6 | ||
|
|
ee4767b1ce | ||
|
|
6cb5cfb0c9 | ||
|
|
7cfa818e63 | ||
|
|
0764fea159 | ||
|
|
e3ed1ab8ec | ||
|
|
b01b1faa3f | ||
|
|
efbc1f836b | ||
|
|
7c33f9c579 | ||
|
|
a9255bddb5 | ||
|
|
6d80a19518 | ||
|
|
011a2dbfaf | ||
|
|
9a54c8ca49 | ||
|
|
cc99330063 | ||
|
|
7e6a241e03 | ||
|
|
2d281855fc | ||
|
|
22cc698b4e | ||
|
|
5a5a54fc66 | ||
|
|
6536368467 | ||
|
|
dc79af2d98 |
@@ -109,6 +109,7 @@ imdecode
|
|||||||
imencode
|
imencode
|
||||||
imread
|
imread
|
||||||
imwrite
|
imwrite
|
||||||
|
inpoint
|
||||||
interp
|
interp
|
||||||
iostat
|
iostat
|
||||||
iotop
|
iotop
|
||||||
@@ -264,6 +265,7 @@ tensorrt
|
|||||||
tflite
|
tflite
|
||||||
thresholded
|
thresholded
|
||||||
timelapse
|
timelapse
|
||||||
|
titlecase
|
||||||
tmpfs
|
tmpfs
|
||||||
tobytes
|
tobytes
|
||||||
toggleable
|
toggleable
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ jobs:
|
|||||||
target: frigate
|
target: frigate
|
||||||
tags: ${{ steps.setup.outputs.image-name }}-amd64
|
tags: ${{ steps.setup.outputs.image-name }}-amd64
|
||||||
cache-from: type=registry,ref=${{ steps.setup.outputs.cache-name }}-amd64
|
cache-from: type=registry,ref=${{ steps.setup.outputs.cache-name }}-amd64
|
||||||
|
cache-to: type=registry,ref=${{ steps.setup.outputs.cache-name }}-amd64,mode=max
|
||||||
arm64_build:
|
arm64_build:
|
||||||
runs-on: ubuntu-22.04-arm
|
runs-on: ubuntu-22.04-arm
|
||||||
name: ARM Build
|
name: ARM Build
|
||||||
@@ -161,8 +162,8 @@ jobs:
|
|||||||
files: docker/tensorrt/trt.hcl
|
files: docker/tensorrt/trt.hcl
|
||||||
set: |
|
set: |
|
||||||
tensorrt.tags=${{ steps.setup.outputs.image-name }}-tensorrt
|
tensorrt.tags=${{ steps.setup.outputs.image-name }}-tensorrt
|
||||||
*.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-amd64
|
*.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-tensorrt
|
||||||
*.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-amd64,mode=max
|
*.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-tensorrt,mode=max
|
||||||
- name: AMD/ROCm general build
|
- name: AMD/ROCm general build
|
||||||
env:
|
env:
|
||||||
AMDGPU: gfx
|
AMDGPU: gfx
|
||||||
@@ -176,7 +177,7 @@ jobs:
|
|||||||
set: |
|
set: |
|
||||||
rocm.tags=${{ steps.setup.outputs.image-name }}-rocm
|
rocm.tags=${{ steps.setup.outputs.image-name }}-rocm
|
||||||
*.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-rocm,mode=max
|
*.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-rocm,mode=max
|
||||||
*.cache-from=type=gha
|
*.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-rocm
|
||||||
arm64_extra_builds:
|
arm64_extra_builds:
|
||||||
runs-on: ubuntu-22.04-arm
|
runs-on: ubuntu-22.04-arm
|
||||||
name: ARM Extra Build
|
name: ARM Extra Build
|
||||||
|
|||||||
+8
-2
@@ -39,7 +39,7 @@
|
|||||||
<img width="800" alt="实时监控面板" src="https://github.com/blakeblackshear/frigate/assets/569905/5e713cb9-9db5-41dc-947a-6937c3bc376e">
|
<img width="800" alt="实时监控面板" src="https://github.com/blakeblackshear/frigate/assets/569905/5e713cb9-9db5-41dc-947a-6937c3bc376e">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
### 简单的审查工作流程
|
### 简单的核查工作流程
|
||||||
<div>
|
<div>
|
||||||
<img width="800" alt="简单的审查工作流程" src="https://github.com/blakeblackshear/frigate/assets/569905/6fed96e8-3b18-40e5-9ddc-31e6f3c9f2ff">
|
<img width="800" alt="简单的审查工作流程" src="https://github.com/blakeblackshear/frigate/assets/569905/6fed96e8-3b18-40e5-9ddc-31e6f3c9f2ff">
|
||||||
</div>
|
</div>
|
||||||
@@ -60,5 +60,11 @@
|
|||||||
|
|
||||||
|
|
||||||
## 非官方中文讨论社区
|
## 非官方中文讨论社区
|
||||||
欢迎加入中文讨论QQ群:1043861059
|
欢迎加入中文讨论QQ群:[1043861059](https://qm.qq.com/q/7vQKsTmSz)
|
||||||
|
|
||||||
Bilibili:https://space.bilibili.com/3546894915602564
|
Bilibili:https://space.bilibili.com/3546894915602564
|
||||||
|
|
||||||
|
|
||||||
|
## 中文社区赞助商
|
||||||
|
[](https://edgeone.ai/zh?from=github)
|
||||||
|
本项目 CDN 加速及安全防护由 Tencent EdgeOne 赞助
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y build-essential cmake git wget
|
sudo apt-get install -y build-essential cmake git wget
|
||||||
|
|
||||||
hailo_version="4.20.1"
|
hailo_version="4.21.0"
|
||||||
arch=$(uname -m)
|
arch=$(uname -m)
|
||||||
|
|
||||||
if [[ $arch == "x86_64" ]]; then
|
if [[ $arch == "x86_64" ]]; then
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
|
|
||||||
hailo_version="4.20.1"
|
hailo_version="4.21.0"
|
||||||
|
|
||||||
if [[ "${TARGETARCH}" == "amd64" ]]; then
|
if [[ "${TARGETARCH}" == "amd64" ]]; then
|
||||||
arch="x86_64"
|
arch="x86_64"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
|
|
||||||
s6_version="3.1.5.0"
|
s6_version="3.2.1.0"
|
||||||
|
|
||||||
if [[ "${TARGETARCH}" == "amd64" ]]; then
|
if [[ "${TARGETARCH}" == "amd64" ]]; then
|
||||||
s6_arch="x86_64"
|
s6_arch="x86_64"
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ norfair == 2.2.*
|
|||||||
setproctitle == 1.3.*
|
setproctitle == 1.3.*
|
||||||
ws4py == 0.5.*
|
ws4py == 0.5.*
|
||||||
unidecode == 1.3.*
|
unidecode == 1.3.*
|
||||||
|
titlecase == 2.4.*
|
||||||
# Image Manipulation
|
# Image Manipulation
|
||||||
numpy == 1.26.*
|
numpy == 1.26.*
|
||||||
opencv-python-headless == 4.11.0.*
|
opencv-python-headless == 4.11.0.*
|
||||||
|
|||||||
@@ -25,7 +25,4 @@ elif [[ "${exit_code_service}" -ne 0 ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# used by the docker healthcheck
|
|
||||||
touch /dev/shm/.frigate-is-stopping
|
|
||||||
|
|
||||||
exec /run/s6/basedir/bin/halt
|
exec /run/s6/basedir/bin/halt
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ set -o errexit -o nounset -o pipefail
|
|||||||
|
|
||||||
# opt out of openvino telemetry
|
# opt out of openvino telemetry
|
||||||
if [ -e /usr/local/bin/opt_in_out ]; then
|
if [ -e /usr/local/bin/opt_in_out ]; then
|
||||||
/usr/local/bin/opt_in_out --opt_out
|
/usr/local/bin/opt_in_out --opt_out > /dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Logs should be sent to stdout so that s6 can collect them
|
# Logs should be sent to stdout so that s6 can collect them
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ COPY docker/rockchip/conv2rknn.py /opt/conv2rknn.py
|
|||||||
|
|
||||||
ADD https://github.com/MarcA711/rknn-toolkit2/releases/download/v2.3.2/librknnrt.so /usr/lib/
|
ADD https://github.com/MarcA711/rknn-toolkit2/releases/download/v2.3.2/librknnrt.so /usr/lib/
|
||||||
|
|
||||||
ADD --chmod=111 https://github.com/MarcA711/Rockchip-FFmpeg-Builds/releases/download/6.1-7/ffmpeg /usr/lib/ffmpeg/6.0/bin/
|
ADD --chmod=111 https://github.com/MarcA711/Rockchip-FFmpeg-Builds/releases/download/6.1-11/ffmpeg /usr/lib/ffmpeg/6.0/bin/
|
||||||
ADD --chmod=111 https://github.com/MarcA711/Rockchip-FFmpeg-Builds/releases/download/6.1-7/ffprobe /usr/lib/ffmpeg/6.0/bin/
|
ADD --chmod=111 https://github.com/MarcA711/Rockchip-FFmpeg-Builds/releases/download/6.1-11/ffprobe /usr/lib/ffmpeg/6.0/bin/
|
||||||
ENV DEFAULT_FFMPEG_VERSION="6.0"
|
ENV DEFAULT_FFMPEG_VERSION="6.0"
|
||||||
ENV INCLUDED_FFMPEG_VERSIONS="${DEFAULT_FFMPEG_VERSION}:${INCLUDED_FFMPEG_VERSIONS}"
|
ENV INCLUDED_FFMPEG_VERSIONS="${DEFAULT_FFMPEG_VERSION}:${INCLUDED_FFMPEG_VERSIONS}"
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ RUN apt update && \
|
|||||||
|
|
||||||
RUN mkdir -p /opt/rocm-dist/opt/rocm-$ROCM/lib
|
RUN mkdir -p /opt/rocm-dist/opt/rocm-$ROCM/lib
|
||||||
RUN cd /opt/rocm-$ROCM/lib && \
|
RUN cd /opt/rocm-$ROCM/lib && \
|
||||||
cp -dpr libMIOpen*.so* libamd*.so* libhip*.so* libhsa*.so* libmigraphx*.so* librocm*.so* librocblas*.so* libroctracer*.so* librocfft*.so* librocprofiler*.so* libroctx*.so* /opt/rocm-dist/opt/rocm-$ROCM/lib/ && \
|
cp -dpr libMIOpen*.so* libamd*.so* libhip*.so* libhsa*.so* libmigraphx*.so* librocm*.so* librocblas*.so* libroctracer*.so* librocsolver*.so* librocfft*.so* librocprofiler*.so* libroctx*.so* /opt/rocm-dist/opt/rocm-$ROCM/lib/ && \
|
||||||
mkdir -p /opt/rocm-dist/opt/rocm-$ROCM/lib/migraphx/lib && \
|
mkdir -p /opt/rocm-dist/opt/rocm-$ROCM/lib/migraphx/lib && \
|
||||||
cp -dpr migraphx/lib/* /opt/rocm-dist/opt/rocm-$ROCM/lib/migraphx/lib
|
cp -dpr migraphx/lib/* /opt/rocm-dist/opt/rocm-$ROCM/lib/migraphx/lib
|
||||||
RUN cd /opt/rocm-dist/opt/ && ln -s rocm-$ROCM rocm
|
RUN cd /opt/rocm-dist/opt/ && ln -s rocm-$ROCM rocm
|
||||||
@@ -63,6 +63,7 @@ COPY --from=rocm /opt/rocm-dist/ /
|
|||||||
FROM deps-prelim AS rocm-prelim-hsa-override0
|
FROM deps-prelim AS rocm-prelim-hsa-override0
|
||||||
ENV HSA_ENABLE_SDMA=0
|
ENV HSA_ENABLE_SDMA=0
|
||||||
ENV MIGRAPHX_ENABLE_NHWC=1
|
ENV MIGRAPHX_ENABLE_NHWC=1
|
||||||
|
ENV TF_ROCM_USE_IMMEDIATE_MODE=1
|
||||||
|
|
||||||
COPY --from=rocm-dist / /
|
COPY --from=rocm-dist / /
|
||||||
|
|
||||||
|
|||||||
@@ -6,24 +6,29 @@ ARG DEBIAN_FRONTEND=noninteractive
|
|||||||
# Globally set pip break-system-packages option to avoid having to specify it every time
|
# Globally set pip break-system-packages option to avoid having to specify it every time
|
||||||
ARG PIP_BREAK_SYSTEM_PACKAGES=1
|
ARG PIP_BREAK_SYSTEM_PACKAGES=1
|
||||||
|
|
||||||
FROM tensorrt-base AS frigate-tensorrt
|
FROM wheels AS trt-wheels
|
||||||
ARG PIP_BREAK_SYSTEM_PACKAGES
|
ARG PIP_BREAK_SYSTEM_PACKAGES
|
||||||
ENV TRT_VER=8.6.1
|
|
||||||
|
|
||||||
# Install TensorRT wheels
|
# Install TensorRT wheels
|
||||||
COPY docker/tensorrt/requirements-amd64.txt /requirements-tensorrt.txt
|
COPY docker/tensorrt/requirements-amd64.txt /requirements-tensorrt.txt
|
||||||
RUN pip3 install -U -r /requirements-tensorrt.txt && ldconfig
|
COPY docker/main/requirements-wheels.txt /requirements-wheels.txt
|
||||||
|
RUN pip3 wheel --wheel-dir=/trt-wheels -c /requirements-wheels.txt -r /requirements-tensorrt.txt
|
||||||
|
|
||||||
|
FROM deps AS frigate-tensorrt
|
||||||
|
ARG PIP_BREAK_SYSTEM_PACKAGES
|
||||||
|
|
||||||
|
RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \
|
||||||
|
pip3 uninstall -y onnxruntime-openvino tensorflow-cpu \
|
||||||
|
&& pip3 install -U /deps/trt-wheels/*.whl
|
||||||
|
|
||||||
|
COPY --from=rootfs / /
|
||||||
|
COPY docker/tensorrt/detector/rootfs/etc/ld.so.conf.d /etc/ld.so.conf.d
|
||||||
|
RUN ldconfig
|
||||||
|
|
||||||
WORKDIR /opt/frigate/
|
WORKDIR /opt/frigate/
|
||||||
COPY --from=rootfs / /
|
|
||||||
|
|
||||||
# Dev Container w/ TRT
|
# Dev Container w/ TRT
|
||||||
FROM devcontainer AS devcontainer-trt
|
FROM devcontainer AS devcontainer-trt
|
||||||
|
|
||||||
COPY --from=trt-deps /usr/local/lib/libyolo_layer.so /usr/local/lib/libyolo_layer.so
|
|
||||||
COPY --from=trt-deps /usr/local/src/tensorrt_demos /usr/local/src/tensorrt_demos
|
|
||||||
COPY --from=trt-deps /usr/local/cuda-12.1 /usr/local/cuda
|
|
||||||
COPY docker/tensorrt/detector/rootfs/ /
|
|
||||||
COPY --from=trt-deps /usr/local/lib/libyolo_layer.so /usr/local/lib/libyolo_layer.so
|
|
||||||
RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \
|
RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \
|
||||||
pip3 install -U /deps/trt-wheels/*.whl
|
pip3 install -U /deps/trt-wheels/*.whl
|
||||||
|
|||||||
@@ -1,9 +1,61 @@
|
|||||||
# syntax=docker/dockerfile:1.4
|
# syntax=docker/dockerfile:1.6
|
||||||
|
|
||||||
# https://askubuntu.com/questions/972516/debian-frontend-environment-variable
|
# https://askubuntu.com/questions/972516/debian-frontend-environment-variable
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
ARG BASE_IMAGE
|
ARG BASE_IMAGE
|
||||||
|
ARG TRT_BASE=nvcr.io/nvidia/tensorrt:23.12-py3
|
||||||
|
|
||||||
|
# Build TensorRT-specific library
|
||||||
|
FROM ${TRT_BASE} AS trt-deps
|
||||||
|
|
||||||
|
ARG TARGETARCH
|
||||||
|
ARG COMPUTE_LEVEL
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y git build-essential cuda-nvcc-* cuda-nvtx-* libnvinfer-dev libnvinfer-plugin-dev libnvparsers-dev libnvonnxparsers-dev \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
RUN --mount=type=bind,source=docker/tensorrt/detector/tensorrt_libyolo.sh,target=/tensorrt_libyolo.sh \
|
||||||
|
/tensorrt_libyolo.sh
|
||||||
|
|
||||||
|
# COPY required individual CUDA deps
|
||||||
|
RUN mkdir -p /usr/local/cuda-deps
|
||||||
|
RUN if [ "$TARGETARCH" = "amd64" ]; then \
|
||||||
|
cp /usr/local/cuda-12.3/targets/x86_64-linux/lib/libcurand.so.* /usr/local/cuda-deps/ && \
|
||||||
|
cp /usr/local/cuda-12.3/targets/x86_64-linux/lib/libnvrtc.so.* /usr/local/cuda-deps/ && \
|
||||||
|
cd /usr/local/cuda-deps/ && \
|
||||||
|
for lib in libnvrtc.so.*; do \
|
||||||
|
if [[ "$lib" =~ libnvrtc.so\.([0-9]+\.[0-9]+\.[0-9]+) ]]; then \
|
||||||
|
version="${BASH_REMATCH[1]}"; \
|
||||||
|
ln -sf "libnvrtc.so.$version" libnvrtc.so; \
|
||||||
|
fi; \
|
||||||
|
done && \
|
||||||
|
for lib in libcurand.so.*; do \
|
||||||
|
if [[ "$lib" =~ libcurand.so\.([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+) ]]; then \
|
||||||
|
version="${BASH_REMATCH[1]}"; \
|
||||||
|
ln -sf "libcurand.so.$version" libcurand.so; \
|
||||||
|
fi; \
|
||||||
|
done; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Frigate w/ TensorRT Support as separate image
|
||||||
|
FROM deps AS tensorrt-base
|
||||||
|
|
||||||
|
#Disable S6 Global timeout
|
||||||
|
ENV S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0
|
||||||
|
|
||||||
|
# COPY TensorRT Model Generation Deps
|
||||||
|
COPY --from=trt-deps /usr/local/lib/libyolo_layer.so /usr/local/lib/libyolo_layer.so
|
||||||
|
COPY --from=trt-deps /usr/local/src/tensorrt_demos /usr/local/src/tensorrt_demos
|
||||||
|
|
||||||
|
# COPY Individual CUDA deps folder
|
||||||
|
COPY --from=trt-deps /usr/local/cuda-deps /usr/local/cuda
|
||||||
|
|
||||||
|
COPY docker/tensorrt/detector/rootfs/ /
|
||||||
|
ENV YOLO_MODELS=""
|
||||||
|
|
||||||
|
HEALTHCHECK --start-period=600s --start-interval=5s --interval=15s --timeout=5s --retries=3 \
|
||||||
|
CMD curl --fail --silent --show-error http://127.0.0.1:5000/api/version || exit 1
|
||||||
|
|
||||||
FROM ${BASE_IMAGE} AS build-wheels
|
FROM ${BASE_IMAGE} AS build-wheels
|
||||||
ARG DEBIAN_FRONTEND
|
ARG DEBIAN_FRONTEND
|
||||||
|
|
||||||
@@ -47,12 +99,11 @@ RUN --mount=type=bind,source=docker/tensorrt/detector/build_python_tensorrt.sh,t
|
|||||||
&& TENSORRT_VER=$(cat /etc/TENSORRT_VER) /deps/build_python_tensorrt.sh
|
&& TENSORRT_VER=$(cat /etc/TENSORRT_VER) /deps/build_python_tensorrt.sh
|
||||||
|
|
||||||
COPY docker/tensorrt/requirements-arm64.txt /requirements-tensorrt.txt
|
COPY docker/tensorrt/requirements-arm64.txt /requirements-tensorrt.txt
|
||||||
# See https://elinux.org/Jetson_Zoo#ONNX_Runtime
|
|
||||||
ADD https://nvidia.box.com/shared/static/9yvw05k6u343qfnkhdv2x6xhygze0aq1.whl /tmp/onnxruntime_gpu-1.19.0-cp311-cp311-linux_aarch64.whl
|
|
||||||
|
|
||||||
RUN pip3 uninstall -y onnxruntime-openvino \
|
RUN pip3 wheel --wheel-dir=/trt-wheels -r /requirements-tensorrt.txt
|
||||||
&& pip3 wheel --wheel-dir=/trt-wheels -r /requirements-tensorrt.txt \
|
|
||||||
&& pip3 install --no-deps /tmp/onnxruntime_gpu-1.19.0-cp311-cp311-linux_aarch64.whl
|
# See https://elinux.org/Jetson_Zoo#ONNX_Runtime
|
||||||
|
ADD https://nvidia.box.com/shared/static/9yvw05k6u343qfnkhdv2x6xhygze0aq1.whl /trt-wheels/onnxruntime_gpu-1.19.0-cp311-cp311-linux_aarch64.whl
|
||||||
|
|
||||||
FROM build-wheels AS trt-model-wheels
|
FROM build-wheels AS trt-model-wheels
|
||||||
ARG DEBIAN_FRONTEND
|
ARG DEBIAN_FRONTEND
|
||||||
@@ -93,11 +144,12 @@ RUN mkdir -p /etc/ld.so.conf.d && echo /usr/lib/ffmpeg/jetson/lib/ > /etc/ld.so.
|
|||||||
COPY --from=trt-wheels /etc/TENSORRT_VER /etc/TENSORRT_VER
|
COPY --from=trt-wheels /etc/TENSORRT_VER /etc/TENSORRT_VER
|
||||||
RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \
|
RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \
|
||||||
--mount=type=bind,from=trt-model-wheels,source=/trt-model-wheels,target=/deps/trt-model-wheels \
|
--mount=type=bind,from=trt-model-wheels,source=/trt-model-wheels,target=/deps/trt-model-wheels \
|
||||||
pip3 install -U /deps/trt-wheels/*.whl /deps/trt-model-wheels/*.whl \
|
pip3 uninstall -y onnxruntime \
|
||||||
|
&& pip3 install -U /deps/trt-wheels/*.whl /deps/trt-model-wheels/*.whl \
|
||||||
&& ldconfig
|
&& ldconfig
|
||||||
|
|
||||||
WORKDIR /opt/frigate/
|
WORKDIR /opt/frigate/
|
||||||
COPY --from=rootfs / /
|
COPY --from=rootfs / /
|
||||||
|
|
||||||
# Fixes "Error importing detector runtime: /usr/lib/aarch64-linux-gnu/libstdc++.so.6: cannot allocate memory in static TLS block"
|
# Fixes "Error importing detector runtime: /usr/lib/aarch64-linux-gnu/libstdc++.so.6: cannot allocate memory in static TLS block"
|
||||||
ENV LD_PRELOAD /usr/lib/aarch64-linux-gnu/libstdc++.so.6
|
ENV LD_PRELOAD /usr/lib/aarch64-linux-gnu/libstdc++.so.6
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
# syntax=docker/dockerfile:1.6
|
|
||||||
|
|
||||||
# https://askubuntu.com/questions/972516/debian-frontend-environment-variable
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
|
||||||
|
|
||||||
ARG TRT_BASE=nvcr.io/nvidia/tensorrt:23.12-py3
|
|
||||||
|
|
||||||
# Build TensorRT-specific library
|
|
||||||
FROM ${TRT_BASE} AS trt-deps
|
|
||||||
|
|
||||||
ARG TARGETARCH
|
|
||||||
ARG COMPUTE_LEVEL
|
|
||||||
|
|
||||||
RUN apt-get update \
|
|
||||||
&& apt-get install -y git build-essential cuda-nvcc-* cuda-nvtx-* libnvinfer-dev libnvinfer-plugin-dev libnvparsers-dev libnvonnxparsers-dev \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
RUN --mount=type=bind,source=docker/tensorrt/detector/tensorrt_libyolo.sh,target=/tensorrt_libyolo.sh \
|
|
||||||
/tensorrt_libyolo.sh
|
|
||||||
|
|
||||||
# COPY required individual CUDA deps
|
|
||||||
RUN mkdir -p /usr/local/cuda-deps
|
|
||||||
RUN if [ "$TARGETARCH" = "amd64" ]; then \
|
|
||||||
cp /usr/local/cuda-12.3/targets/x86_64-linux/lib/libcurand.so.* /usr/local/cuda-deps/ && \
|
|
||||||
cp /usr/local/cuda-12.3/targets/x86_64-linux/lib/libnvrtc.so.* /usr/local/cuda-deps/ && \
|
|
||||||
cd /usr/local/cuda-deps/ && \
|
|
||||||
for lib in libnvrtc.so.*; do \
|
|
||||||
if [[ "$lib" =~ libnvrtc.so\.([0-9]+\.[0-9]+\.[0-9]+) ]]; then \
|
|
||||||
version="${BASH_REMATCH[1]}"; \
|
|
||||||
ln -sf "libnvrtc.so.$version" libnvrtc.so; \
|
|
||||||
fi; \
|
|
||||||
done && \
|
|
||||||
for lib in libcurand.so.*; do \
|
|
||||||
if [[ "$lib" =~ libcurand.so\.([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+) ]]; then \
|
|
||||||
version="${BASH_REMATCH[1]}"; \
|
|
||||||
ln -sf "libcurand.so.$version" libcurand.so; \
|
|
||||||
fi; \
|
|
||||||
done; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Frigate w/ TensorRT Support as separate image
|
|
||||||
FROM deps AS tensorrt-base
|
|
||||||
|
|
||||||
#Disable S6 Global timeout
|
|
||||||
ENV S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0
|
|
||||||
|
|
||||||
# COPY TensorRT Model Generation Deps
|
|
||||||
COPY --from=trt-deps /usr/local/lib/libyolo_layer.so /usr/local/lib/libyolo_layer.so
|
|
||||||
COPY --from=trt-deps /usr/local/src/tensorrt_demos /usr/local/src/tensorrt_demos
|
|
||||||
|
|
||||||
# COPY Individual CUDA deps folder
|
|
||||||
COPY --from=trt-deps /usr/local/cuda-deps /usr/local/cuda
|
|
||||||
|
|
||||||
COPY docker/tensorrt/detector/rootfs/ /
|
|
||||||
ENV YOLO_MODELS=""
|
|
||||||
|
|
||||||
HEALTHCHECK --start-period=600s --start-interval=5s --interval=15s --timeout=5s --retries=3 \
|
|
||||||
CMD curl --fail --silent --show-error http://127.0.0.1:5000/api/version || exit 1
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
/usr/local/lib
|
|
||||||
/usr/local/cuda
|
|
||||||
/usr/local/lib/python3.11/dist-packages/tensorrt
|
|
||||||
/usr/local/lib/python3.11/dist-packages/nvidia/cudnn/lib
|
/usr/local/lib/python3.11/dist-packages/nvidia/cudnn/lib
|
||||||
/usr/local/lib/python3.11/dist-packages/nvidia/cuda_runtime/lib
|
/usr/local/lib/python3.11/dist-packages/nvidia/cuda_runtime/lib
|
||||||
/usr/local/lib/python3.11/dist-packages/nvidia/cublas/lib
|
/usr/local/lib/python3.11/dist-packages/nvidia/cublas/lib
|
||||||
/usr/local/lib/python3.11/dist-packages/nvidia/cufft/lib
|
/usr/local/lib/python3.11/dist-packages/nvidia/cufft/lib
|
||||||
|
/usr/local/lib/python3.11/dist-packages/nvidia/curand/lib/
|
||||||
|
/usr/local/lib/python3.11/dist-packages/nvidia/cuda_nvrtc/lib/
|
||||||
@@ -1,17 +1,18 @@
|
|||||||
# NVidia TensorRT Support (amd64 only)
|
# NVidia TensorRT Support (amd64 only)
|
||||||
--extra-index-url 'https://pypi.nvidia.com'
|
--extra-index-url 'https://pypi.nvidia.com'
|
||||||
numpy < 1.24; platform_machine == 'x86_64'
|
cython==3.0.*; platform_machine == 'x86_64'
|
||||||
tensorrt == 8.6.1; platform_machine == 'x86_64'
|
nvidia_cuda_cupti_cu12==12.5.82; platform_machine == 'x86_64'
|
||||||
tensorrt_bindings == 8.6.1; platform_machine == 'x86_64'
|
nvidia-cublas-cu12==12.5.3.*; platform_machine == 'x86_64'
|
||||||
cuda-python == 11.8.*; platform_machine == 'x86_64'
|
nvidia-cudnn-cu12==9.3.0.*; platform_machine == 'x86_64'
|
||||||
cython == 3.0.*; platform_machine == 'x86_64'
|
nvidia-cufft-cu12==11.2.3.*; platform_machine == 'x86_64'
|
||||||
nvidia-cuda-runtime-cu12 == 12.1.*; platform_machine == 'x86_64'
|
nvidia-curand-cu12==10.3.6.*; platform_machine == 'x86_64'
|
||||||
nvidia-cuda-runtime-cu11 == 11.8.*; platform_machine == 'x86_64'
|
nvidia_cuda_nvcc_cu12==12.5.82; platform_machine == 'x86_64'
|
||||||
nvidia-cublas-cu11 == 11.11.3.6; platform_machine == 'x86_64'
|
nvidia-cuda-nvrtc-cu12==12.5.82; platform_machine == 'x86_64'
|
||||||
nvidia-cudnn-cu11 == 8.6.0.*; platform_machine == 'x86_64'
|
nvidia_cuda_runtime_cu12==12.5.82; platform_machine == 'x86_64'
|
||||||
nvidia-cudnn-cu12 == 9.5.0.*; platform_machine == 'x86_64'
|
nvidia_cusolver_cu12==11.6.3.*; platform_machine == 'x86_64'
|
||||||
nvidia-cufft-cu11==10.*; platform_machine == 'x86_64'
|
nvidia_cusparse_cu12==12.5.1.*; platform_machine == 'x86_64'
|
||||||
nvidia-cufft-cu12==11.*; platform_machine == 'x86_64'
|
nvidia_nccl_cu12==2.23.4; platform_machine == 'x86_64'
|
||||||
|
nvidia_nvjitlink_cu12==12.5.82; platform_machine == 'x86_64'
|
||||||
onnx==1.16.*; platform_machine == 'x86_64'
|
onnx==1.16.*; platform_machine == 'x86_64'
|
||||||
onnxruntime-gpu==1.20.*; platform_machine == 'x86_64'
|
onnxruntime-gpu==1.22.*; platform_machine == 'x86_64'
|
||||||
protobuf==3.20.3; platform_machine == 'x86_64'
|
protobuf==3.20.3; platform_machine == 'x86_64'
|
||||||
|
|||||||
+2
-10
@@ -79,21 +79,13 @@ target "trt-deps" {
|
|||||||
inherits = ["_build_args"]
|
inherits = ["_build_args"]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "tensorrt-base" {
|
|
||||||
dockerfile = "docker/tensorrt/Dockerfile.base"
|
|
||||||
context = "."
|
|
||||||
contexts = {
|
|
||||||
deps = "target:deps",
|
|
||||||
}
|
|
||||||
inherits = ["_build_args"]
|
|
||||||
}
|
|
||||||
|
|
||||||
target "tensorrt" {
|
target "tensorrt" {
|
||||||
dockerfile = "docker/tensorrt/Dockerfile.${ARCH}"
|
dockerfile = "docker/tensorrt/Dockerfile.${ARCH}"
|
||||||
context = "."
|
context = "."
|
||||||
contexts = {
|
contexts = {
|
||||||
wget = "target:wget",
|
wget = "target:wget",
|
||||||
tensorrt-base = "target:tensorrt-base",
|
wheels = "target:wheels",
|
||||||
|
deps = "target:deps",
|
||||||
rootfs = "target:rootfs"
|
rootfs = "target:rootfs"
|
||||||
}
|
}
|
||||||
target = "frigate-tensorrt"
|
target = "frigate-tensorrt"
|
||||||
|
|||||||
@@ -52,6 +52,21 @@ auth:
|
|||||||
- 172.18.0.0/16 # <---- this is the subnet for the internal Docker Compose network
|
- 172.18.0.0/16 # <---- this is the subnet for the internal Docker Compose network
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Session Length
|
||||||
|
|
||||||
|
The default session length for user authentication in Frigate is 24 hours. This setting determines how long a user's authenticated session remains active before a token refresh is required — otherwise, the user will need to log in again.
|
||||||
|
|
||||||
|
While the default provides a balance of security and convenience, you can customize this duration to suit your specific security requirements and user experience preferences. The session length is configured in seconds.
|
||||||
|
|
||||||
|
The default value of `86400` will expire the authentication session after 24 hours. Some other examples:
|
||||||
|
- `0`: Setting the session length to 0 will require a user to log in every time they access the application or after a very short, immediate timeout.
|
||||||
|
- `604800`: Setting the session length to 604800 will require a user to log in if the token is not refreshed for 7 days.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
auth:
|
||||||
|
session_length: 86400
|
||||||
|
```
|
||||||
|
|
||||||
## JWT Token Secret
|
## JWT Token Secret
|
||||||
|
|
||||||
The JWT token secret needs to be kept secure. Anyone with this secret can generate valid JWT tokens to authenticate with Frigate. This should be a cryptographically random string of at least 64 characters.
|
The JWT token secret needs to be kept secure. Anyone with this secret can generate valid JWT tokens to authenticate with Frigate. This should be a cryptographically random string of at least 64 characters.
|
||||||
@@ -97,11 +112,12 @@ python3 -c 'import secrets; print(secrets.token_hex(64))'
|
|||||||
|
|
||||||
### Header mapping
|
### Header mapping
|
||||||
|
|
||||||
If you have disabled Frigate's authentication and your proxy supports passing a header with authenticated usernames and/or roles, you can use the `header_map` config to specify the header name so it is passed to Frigate. For example, the following will map the `X-Forwarded-User` and `X-Forwarded-Role` values. Header names are not case sensitive.
|
If you have disabled Frigate's authentication and your proxy supports passing a header with authenticated usernames and/or roles, you can use the `header_map` config to specify the header name so it is passed to Frigate. For example, the following will map the `X-Forwarded-User` and `X-Forwarded-Role` values. Header names are not case sensitive. Multiple values can be included in the role header. Frigate expects that the character separating the roles is a comma, but this can be specified using the `separator` config entry.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
proxy:
|
proxy:
|
||||||
...
|
...
|
||||||
|
separator: "|" # This value defaults to a comma, but Authentik uses a pipe, for example.
|
||||||
header_map:
|
header_map:
|
||||||
user: x-forwarded-user
|
user: x-forwarded-user
|
||||||
role: x-forwarded-role
|
role: x-forwarded-role
|
||||||
|
|||||||
@@ -243,3 +243,38 @@ ffmpeg:
|
|||||||
### TP-Link VIGI Cameras
|
### TP-Link VIGI Cameras
|
||||||
|
|
||||||
TP-Link VIGI cameras need some adjustments to the main stream settings on the camera itself to avoid issues. The stream needs to be configured as `H264` with `Smart Coding` set to `off`. Without these settings you may have problems when trying to watch recorded footage. For example Firefox will stop playback after a few seconds and show the following error message: `The media playback was aborted due to a corruption problem or because the media used features your browser did not support.`.
|
TP-Link VIGI cameras need some adjustments to the main stream settings on the camera itself to avoid issues. The stream needs to be configured as `H264` with `Smart Coding` set to `off`. Without these settings you may have problems when trying to watch recorded footage. For example Firefox will stop playback after a few seconds and show the following error message: `The media playback was aborted due to a corruption problem or because the media used features your browser did not support.`.
|
||||||
|
|
||||||
|
## USB Cameras (aka Webcams)
|
||||||
|
|
||||||
|
To use a USB camera (webcam) with Frigate, the recommendation is to use go2rtc's [FFmpeg Device](https://github.com/AlexxIT/go2rtc?tab=readme-ov-file#source-ffmpeg-device) support:
|
||||||
|
|
||||||
|
- Preparation outside of Frigate:
|
||||||
|
- Get USB camera path. Run `v4l2-ctl --list-devices` to get a listing of locally-connected cameras available. (You may need to install `v4l-utils` in a way appropriate for your Linux distribution). In the sample configuration below, we use `video=0` to correlate with a detected device path of `/dev/video0`
|
||||||
|
- Get USB camera formats & resolutions. Run `ffmpeg -f v4l2 -list_formats all -i /dev/video0` to get an idea of what formats and resolutions the USB Camera supports. In the sample configuration below, we use a width of 1024 and height of 576 in the stream and detection settings based on what was reported back.
|
||||||
|
- If using Frigate in a container (e.g. Docker on TrueNAS), ensure you have USB Passthrough support enabled, along with a specific Host Device (`/dev/video0`) + Container Device (`/dev/video0`) listed.
|
||||||
|
|
||||||
|
- In your Frigate Configuration File, add the go2rtc stream and roles as appropriate:
|
||||||
|
|
||||||
|
```
|
||||||
|
go2rtc:
|
||||||
|
streams:
|
||||||
|
usb_camera:
|
||||||
|
- "ffmpeg:device?video=0&video_size=1024x576#video=h264"
|
||||||
|
|
||||||
|
cameras:
|
||||||
|
usb_camera:
|
||||||
|
enabled: true
|
||||||
|
ffmpeg:
|
||||||
|
inputs:
|
||||||
|
- path: rtsp://127.0.0.1:8554/usb_camera
|
||||||
|
input_args: preset-rtsp-restream
|
||||||
|
roles:
|
||||||
|
- detect
|
||||||
|
- record
|
||||||
|
detect:
|
||||||
|
enabled: false # <---- disable detection until you have a working camera feed
|
||||||
|
width: 1024
|
||||||
|
height: 576
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -97,9 +97,12 @@ This list of working and non-working PTZ cameras is based on user feedback.
|
|||||||
| Amcrest ASH21 | ✅ | ❌ | ONVIF service port: 80 |
|
| Amcrest ASH21 | ✅ | ❌ | ONVIF service port: 80 |
|
||||||
| Amcrest IP4M-S2112EW-AI | ✅ | ❌ | FOV relative movement not supported. |
|
| Amcrest IP4M-S2112EW-AI | ✅ | ❌ | FOV relative movement not supported. |
|
||||||
| Amcrest IP5M-1190EW | ✅ | ❌ | ONVIF Port: 80. FOV relative movement not supported. |
|
| Amcrest IP5M-1190EW | ✅ | ❌ | ONVIF Port: 80. FOV relative movement not supported. |
|
||||||
|
| Annke CZ504 | ✅ | ✅ | Annke support provide specific firmware ([V5.7.1 build 250227](https://github.com/pierrepinon/annke_cz504/raw/refs/heads/main/digicap_V5-7-1_build_250227.dav)) to fix issue with ONVIF "TranslationSpaceFov" |
|
||||||
| Ctronics PTZ | ✅ | ❌ | |
|
| Ctronics PTZ | ✅ | ❌ | |
|
||||||
| Dahua | ✅ | ✅ | |
|
| Dahua | ✅ | ✅ | Some low-end Dahuas (lite series, among others) have been reported to not support autotracking |
|
||||||
| Dahua DH-SD2A500HB | ✅ | ❌ | |
|
| Dahua DH-SD2A500HB | ✅ | ❌ | |
|
||||||
|
| Dahua DH-SD49825GB-HNR | ✅ | ✅ | |
|
||||||
|
| Dahua DH-P5AE-PV | ❌ | ❌ | |
|
||||||
| Foscam R5 | ✅ | ❌ | |
|
| Foscam R5 | ✅ | ❌ | |
|
||||||
| Hanwha XNP-6550RH | ✅ | ❌ | |
|
| Hanwha XNP-6550RH | ✅ | ❌ | |
|
||||||
| Hikvision | ✅ | ❌ | Incomplete ONVIF support (MoveStatus won't update even on latest firmware) - reported with HWP-N4215IH-DE and DS-2DE3304W-DE, but likely others |
|
| Hikvision | ✅ | ❌ | Incomplete ONVIF support (MoveStatus won't update even on latest firmware) - reported with HWP-N4215IH-DE and DS-2DE3304W-DE, but likely others |
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ face_recognition:
|
|||||||
enabled: true
|
enabled: true
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Like the other real-time processors in Frigate, face recognition runs on the camera stream defined by the `detect` role in your config. To ensure optimal performance, select a suitable resolution for this stream in your camera's firmware that fits your specific scene and requirements.
|
||||||
|
|
||||||
## Advanced Configuration
|
## Advanced Configuration
|
||||||
|
|
||||||
Fine-tune face recognition with these optional parameters at the global level of your config. The only optional parameters that can be set at the camera level are `enabled` and `min_area`.
|
Fine-tune face recognition with these optional parameters at the global level of your config. The only optional parameters that can be set at the camera level are `enabled` and `min_area`.
|
||||||
@@ -65,6 +67,8 @@ Fine-tune face recognition with these optional parameters at the global level of
|
|||||||
- Default: `0.8`.
|
- Default: `0.8`.
|
||||||
- `recognition_threshold`: Recognition confidence score required to add the face to the object as a sub label.
|
- `recognition_threshold`: Recognition confidence score required to add the face to the object as a sub label.
|
||||||
- Default: `0.9`.
|
- Default: `0.9`.
|
||||||
|
- `min_faces`: Min face recognitions for the sub label to be applied to the person object.
|
||||||
|
- Default: `1`
|
||||||
- `save_attempts`: Number of images of recognized faces to save for training.
|
- `save_attempts`: Number of images of recognized faces to save for training.
|
||||||
- Default: `100`.
|
- Default: `100`.
|
||||||
- `blur_confidence_filter`: Enables a filter that calculates how blurry the face is and adjusts the confidence based on this.
|
- `blur_confidence_filter`: Enables a filter that calculates how blurry the face is and adjusts the confidence based on this.
|
||||||
@@ -72,8 +76,10 @@ Fine-tune face recognition with these optional parameters at the global level of
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
Follow these steps to begin:
|
||||||
|
|
||||||
1. **Enable face recognition** in your configuration file and restart Frigate.
|
1. **Enable face recognition** in your configuration file and restart Frigate.
|
||||||
2. **Upload your face** using the **Add Face** button's wizard in the Face Library section of the Frigate UI.
|
2. **Upload one face** using the **Add Face** button's wizard in the Face Library section of the Frigate UI. Read below for the best practices on expanding your training set.
|
||||||
3. When Frigate detects and attempts to recognize a face, it will appear in the **Train** tab of the Face Library, along with its associated recognition confidence.
|
3. When Frigate detects and attempts to recognize a face, it will appear in the **Train** tab of the Face Library, along with its associated recognition confidence.
|
||||||
4. From the **Train** tab, you can **assign the face** to a new or existing person to improve recognition accuracy for the future.
|
4. From the **Train** tab, you can **assign the face** to a new or existing person to improve recognition accuracy for the future.
|
||||||
|
|
||||||
@@ -105,22 +111,53 @@ When choosing images to include in the face training set it is recommended to al
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
### Understanding the Train Tab
|
||||||
|
|
||||||
|
The Train tab in the face library displays recent face recognition attempts. Detected face images are grouped according to the person they were identified as potentially matching.
|
||||||
|
|
||||||
|
Each face image is labeled with a name (or `Unknown`) along with the confidence score of the recognition attempt. While each image can be used to train the system for a specific person, not all images are suitable for training.
|
||||||
|
|
||||||
|
Refer to the guidelines below for best practices on selecting images for training.
|
||||||
|
|
||||||
### Step 1 - Building a Strong Foundation
|
### Step 1 - Building a Strong Foundation
|
||||||
|
|
||||||
When first enabling face recognition it is important to build a foundation of strong images. It is recommended to start by uploading 1-5 photos containing just this person's face. It is important that the person's face in the photo is front-facing and not turned, this will ensure a good starting point.
|
When first enabling face recognition it is important to build a foundation of strong images. It is recommended to start by uploading 1-5 photos containing just this person's face. It is important that the person's face in the photo is front-facing and not turned, this will ensure a good starting point.
|
||||||
|
|
||||||
Then it is recommended to use the `Face Library` tab in Frigate to select and train images for each person as they are detected. When building a strong foundation it is strongly recommended to only train on images that are front-facing. Ignore images from cameras that recognize faces from an angle.
|
Then it is recommended to use the `Face Library` tab in Frigate to select and train images for each person as they are detected. When building a strong foundation it is strongly recommended to only train on images that are front-facing. Ignore images from cameras that recognize faces from an angle. Aim to strike a balance between the quality of images while also having a range of conditions (day / night, different weather conditions, different times of day, etc.) in order to have diversity in the images used for each person and not have over-fitting.
|
||||||
|
|
||||||
Aim to strike a balance between the quality of images while also having a range of conditions (day / night, different weather conditions, different times of day, etc.) in order to have diversity in the images used for each person and not have over-fitting.
|
You do not want to train images that are 90%+ as these are already being confidently recognized. In this step the goal is to train on clear, lower scoring front-facing images until the majority of front-facing images for a given person are consistently recognized correctly. Then it is time to move on to step 2.
|
||||||
|
|
||||||
Once a person starts to be consistently recognized correctly on images that are front-facing, it is time to move on to the next step.
|
|
||||||
|
|
||||||
### Step 2 - Expanding The Dataset
|
### Step 2 - Expanding The Dataset
|
||||||
|
|
||||||
Once front-facing images are performing well, start choosing slightly off-angle images to include for training. It is important to still choose images where enough face detail is visible to recognize someone.
|
Once front-facing images are performing well, start choosing slightly off-angle images to include for training. It is important to still choose images where enough face detail is visible to recognize someone, and you still only want to train on images that score lower.
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
|
### How do I debug Face Recognition issues?
|
||||||
|
|
||||||
|
Start with the [Usage](#usage) section and re-read the [Model Requirements](#model-requirements) above.
|
||||||
|
|
||||||
|
1. Ensure `person` is being _detected_. A `person` will automatically be scanned by Frigate for a face. Any detected faces will appear in the Train tab in the Frigate UI's Face Library.
|
||||||
|
|
||||||
|
If you are using a Frigate+ or `face` detecting model:
|
||||||
|
|
||||||
|
- Watch the debug view (Settings --> Debug) to ensure that `face` is being detected along with `person`.
|
||||||
|
- You may need to adjust the `min_score` for the `face` object if faces are not being detected.
|
||||||
|
|
||||||
|
If you are **not** using a Frigate+ or `face` detecting model:
|
||||||
|
|
||||||
|
- Check your `detect` stream resolution and ensure it is sufficiently high enough to capture face details on `person` objects.
|
||||||
|
- You may need to lower your `detection_threshold` if faces are not being detected.
|
||||||
|
|
||||||
|
2. Any detected faces will then be _recognized_.
|
||||||
|
|
||||||
|
- Make sure you have trained at least one face per the recommendations above.
|
||||||
|
- Adjust `recognition_threshold` settings per the suggestions [above](#advanced-configuration).
|
||||||
|
|
||||||
|
### Detection does not work well with blurry images?
|
||||||
|
|
||||||
|
Accuracy is definitely a going to be improved with higher quality cameras / streams. It is important to look at the DORI (Detection Observation Recognition Identification) range of your camera, if that specification is posted. This specification explains the distance from the camera that a person can be detected, observed, recognized, and identified. The identification range is the most relevant here, and the distance listed by the camera is the furthest that face recognition will realistically work.
|
||||||
|
|
||||||
### Why can't I bulk upload photos?
|
### Why can't I bulk upload photos?
|
||||||
|
|
||||||
It is important to methodically add photos to the library, bulk importing photos (especially from a general photo library) will lead to over-fitting in that particular scenario and hurt recognition performance.
|
It is important to methodically add photos to the library, bulk importing photos (especially from a general photo library) will lead to over-fitting in that particular scenario and hurt recognition performance.
|
||||||
@@ -166,6 +203,6 @@ Face recognition does not run on the recording stream, this would be suboptimal
|
|||||||
|
|
||||||
By default iOS devices will use HEIC (High Efficiency Image Container) for images, but this format is not supported for uploads. Choosing `large` as the format instead of `original` will use JPG which will work correctly.
|
By default iOS devices will use HEIC (High Efficiency Image Container) for images, but this format is not supported for uploads. Choosing `large` as the format instead of `original` will use JPG which will work correctly.
|
||||||
|
|
||||||
## How can I delete the face database and start over?
|
### How can I delete the face database and start over?
|
||||||
|
|
||||||
Frigate does not store anything in its database related to face recognition. You can simply delete all of your faces through the Frigate UI or remove the contents of the `/media/frigate/clips/faces` directory.
|
Frigate does not store anything in its database related to face recognition. You can simply delete all of your faces through the Frigate UI or remove the contents of the `/media/frigate/clips/faces` directory.
|
||||||
|
|||||||
@@ -71,11 +71,11 @@ cameras:
|
|||||||
|
|
||||||
Output args presets help make the config more readable and handle use cases for different types of streams to ensure consistent recordings.
|
Output args presets help make the config more readable and handle use cases for different types of streams to ensure consistent recordings.
|
||||||
|
|
||||||
| Preset | Usage | Other Notes |
|
| Preset | Usage | Other Notes |
|
||||||
| -------------------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
| -------------------------------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| preset-record-generic | Record WITHOUT audio | This is the default when nothing is specified |
|
| preset-record-generic | Record WITHOUT audio | If your camera doesn’t have audio, or if you don’t want to record audio, use this option |
|
||||||
| preset-record-generic-audio-copy | Record WITH original audio | Use this to enable audio in recordings |
|
| preset-record-generic-audio-copy | Record WITH original audio | Use this to enable audio in recordings |
|
||||||
| preset-record-generic-audio-aac | Record WITH transcoded aac audio | Use this to transcode to aac audio. If your source is already aac, use preset-record-generic-audio-copy instead to avoid re-encoding |
|
| preset-record-generic-audio-aac | Record WITH transcoded aac audio | This is the default when no option is specified. Use it to transcode audio to AAC. If the source is already in AAC format, use preset-record-generic-audio-copy instead to avoid unnecessary re-encoding |
|
||||||
| preset-record-mjpeg | Record an mjpeg stream | Recommend restreaming mjpeg stream instead |
|
| preset-record-mjpeg | Record an mjpeg stream | Recommend restreaming mjpeg stream instead |
|
||||||
| preset-record-jpeg | Record live jpeg | Recommend restreaming live jpeg instead |
|
| preset-record-jpeg | Record live jpeg | Recommend restreaming live jpeg instead |
|
||||||
| preset-record-ubiquiti | Record ubiquiti stream with audio | Recordings with ubiquiti non-standard audio |
|
| preset-record-ubiquiti | Record ubiquiti stream with audio | Recordings with ubiquiti non-standard audio |
|
||||||
|
|||||||
@@ -21,12 +21,23 @@ genai:
|
|||||||
model: gemini-1.5-flash
|
model: gemini-1.5-flash
|
||||||
|
|
||||||
cameras:
|
cameras:
|
||||||
front_camera: ...
|
front_camera:
|
||||||
|
genai:
|
||||||
|
enabled: True # <- enable GenAI for your front camera
|
||||||
|
use_snapshot: True
|
||||||
|
objects:
|
||||||
|
- person
|
||||||
|
required_zones:
|
||||||
|
- steps
|
||||||
indoor_camera:
|
indoor_camera:
|
||||||
genai: # <- disable GenAI for your indoor camera
|
genai:
|
||||||
enabled: False
|
enabled: False # <- disable GenAI for your indoor camera
|
||||||
```
|
```
|
||||||
|
|
||||||
|
By default, descriptions will be generated for all tracked objects and all zones. But you can also optionally specify `objects` and `required_zones` to only generate descriptions for certain tracked objects or zones.
|
||||||
|
|
||||||
|
Optionally, you can generate the description using a snapshot (if enabled) by setting `use_snapshot` to `True`. By default, this is set to `False`, which sends the uncompressed images from the `detect` stream collected over the object's lifetime to the model. Once the object lifecycle ends, only a single compressed and cropped thumbnail is saved with the tracked object. Using a snapshot might be useful when you want to _regenerate_ a tracked object's description as it will provide the AI with a higher-quality image (typically downscaled by the AI itself) than the cropped/compressed thumbnail. Using a snapshot otherwise has a trade-off in that only a single image is sent to your provider, which will limit the model's ability to determine object movement or direction.
|
||||||
|
|
||||||
## Ollama
|
## Ollama
|
||||||
|
|
||||||
:::warning
|
:::warning
|
||||||
@@ -167,7 +178,7 @@ Analyze the sequence of images containing the {label}. Focus on the likely inten
|
|||||||
|
|
||||||
:::tip
|
:::tip
|
||||||
|
|
||||||
Prompts can use variable replacements like `{label}`, `{sub_label}`, and `{camera}` to substitute information from the tracked object as part of the prompt.
|
Prompts can use variable replacements `{label}`, `{sub_label}`, and `{camera}` to substitute information from the tracked object as part of the prompt.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
@@ -185,9 +196,7 @@ genai:
|
|||||||
car: "Observe the primary vehicle in these images. Focus on its movement, direction, or purpose (e.g., parking, approaching, circling). If it's a delivery vehicle, mention the company."
|
car: "Observe the primary vehicle in these images. Focus on its movement, direction, or purpose (e.g., parking, approaching, circling). If it's a delivery vehicle, mention the company."
|
||||||
```
|
```
|
||||||
|
|
||||||
Prompts can also be overriden at the camera level to provide a more detailed prompt to the model about your specific camera, if you desire. By default, descriptions will be generated for all tracked objects and all zones. But you can also optionally specify `objects` and `required_zones` to only generate descriptions for certain tracked objects or zones.
|
Prompts can also be overriden at the camera level to provide a more detailed prompt to the model about your specific camera, if you desire.
|
||||||
|
|
||||||
Optionally, you can generate the description using a snapshot (if enabled) by setting `use_snapshot` to `True`. By default, this is set to `False`, which sends the uncompressed images from the `detect` stream collected over the object's lifetime to the model. Once the object lifecycle ends, only a single compressed and cropped thumbnail is saved with the tracked object. Using a snapshot might be useful when you want to _regenerate_ a tracked object's description as it will provide the AI with a higher-quality image (typically downscaled by the AI itself) than the cropped/compressed thumbnail. Using a snapshot otherwise has a trade-off in that only a single image is sent to your provider, which will limit the model's ability to determine object movement or direction.
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
cameras:
|
cameras:
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ Object detection and enrichments (like Semantic Search, Face Recognition, and Li
|
|||||||
- Nvidia GPUs will automatically be detected and used for enrichments in the `-tensorrt` Frigate image.
|
- Nvidia GPUs will automatically be detected and used for enrichments in the `-tensorrt` Frigate image.
|
||||||
- Jetson devices will automatically be detected and used for enrichments in the `-tensorrt-jp6` Frigate image.
|
- Jetson devices will automatically be detected and used for enrichments in the `-tensorrt-jp6` Frigate image.
|
||||||
|
|
||||||
Utilizing a GPU for enrichments does not require you to use the same GPU for object detection. For example, you can run the `tensorrt` Docker image for enrichments and still use other dedicated hardware for object detection.
|
Utilizing a GPU for enrichments does not require you to use the same GPU for object detection. For example, you can run the `tensorrt` Docker image for enrichments and still use other dedicated hardware like a Coral or Hailo for object detection. However, one combination that is not supported is TensorRT for object detection and OpenVINO for enrichments.
|
||||||
|
|
||||||
:::note
|
:::note
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,8 @@ Or map in all the `/dev/video*` devices.
|
|||||||
|
|
||||||
| CPU Generation | Intel Driver | Recommended Preset | Notes |
|
| CPU Generation | Intel Driver | Recommended Preset | Notes |
|
||||||
| -------------- | ------------ | ------------------- | ------------------------------------ |
|
| -------------- | ------------ | ------------------- | ------------------------------------ |
|
||||||
| gen1 - gen7 | i965 | preset-vaapi | qsv is not supported |
|
| gen1 - gen5 | i965 | preset-vaapi | qsv is not supported |
|
||||||
|
| gen6 - gen7 | iHD | preset-vaapi | qsv is not supported |
|
||||||
| gen8 - gen12 | iHD | preset-vaapi | preset-intel-qsv-\* can also be used |
|
| gen8 - gen12 | iHD | preset-vaapi | preset-intel-qsv-\* can also be used |
|
||||||
| gen13+ | iHD / Xe | preset-intel-qsv-\* | |
|
| gen13+ | iHD / Xe | preset-intel-qsv-\* | |
|
||||||
| Intel Arc GPU | iHD / Xe | preset-intel-qsv-\* | |
|
| Intel Arc GPU | iHD / Xe | preset-intel-qsv-\* | |
|
||||||
|
|||||||
@@ -164,11 +164,17 @@ Dedicated LPR cameras are single-purpose cameras with powerful optical zoom to c
|
|||||||
|
|
||||||
To mark a camera as a dedicated LPR camera, add `type: "lpr"` the camera configuration.
|
To mark a camera as a dedicated LPR camera, add `type: "lpr"` the camera configuration.
|
||||||
|
|
||||||
|
:::note
|
||||||
|
|
||||||
|
Frigate's dedicated LPR mode is optimized for cameras with a narrow field of view, specifically positioned and zoomed to capture license plates exclusively. If your camera provides a general overview of a scene rather than a tightly focused view, this mode is not recommended.
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
Users can configure Frigate's dedicated LPR mode in two different ways depending on whether a Frigate+ (or native `license_plate` detecting) model is used:
|
Users can configure Frigate's dedicated LPR mode in two different ways depending on whether a Frigate+ (or native `license_plate` detecting) model is used:
|
||||||
|
|
||||||
### Using a Frigate+ (or Native `license_plate` Detecting) Model
|
### Using a Frigate+ (or Native `license_plate` Detecting) Model
|
||||||
|
|
||||||
Users running a Frigate+ model (or any model that natively detects `license_plate`) can take advantage of `license_plate` detection. This allows license plates to be treated as standard objects in dedicated LPR mode, meaning that alerts, detections, snapshots, zones, and other Frigate features work as usual, and plates are detected efficiently through your configured object detector.
|
Users running a Frigate+ model (or any model that natively detects `license_plate`) can take advantage of `license_plate` detection. This allows license plates to be treated as standard objects in dedicated LPR mode, meaning that alerts, detections, snapshots, and other Frigate features work as usual, and plates are detected efficiently through your configured object detector.
|
||||||
|
|
||||||
An example configuration for a dedicated LPR camera using a `license_plate`-detecting model:
|
An example configuration for a dedicated LPR camera using a `license_plate`-detecting model:
|
||||||
|
|
||||||
@@ -213,7 +219,7 @@ cameras:
|
|||||||
With this setup:
|
With this setup:
|
||||||
|
|
||||||
- License plates are treated as normal objects in Frigate.
|
- License plates are treated as normal objects in Frigate.
|
||||||
- Scores, alerts, detections, snapshots, zones, and object masks work as expected.
|
- Scores, alerts, detections, and snapshots work as expected.
|
||||||
- Snapshots will have license plate bounding boxes on them.
|
- Snapshots will have license plate bounding boxes on them.
|
||||||
- The `frigate/events` MQTT topic will publish tracked object updates.
|
- The `frigate/events` MQTT topic will publish tracked object updates.
|
||||||
- Debug view will display `license_plate` bounding boxes.
|
- Debug view will display `license_plate` bounding boxes.
|
||||||
@@ -279,7 +285,6 @@ With this setup:
|
|||||||
| License Plate Detection | Uses `license_plate` as a tracked object | Runs a dedicated LPR pipeline |
|
| License Plate Detection | Uses `license_plate` as a tracked object | Runs a dedicated LPR pipeline |
|
||||||
| FPS Setting | 5 (increase for fast-moving cars) | 5 (increase for fast-moving cars, but it may use much more CPU) |
|
| FPS Setting | 5 (increase for fast-moving cars) | 5 (increase for fast-moving cars, but it may use much more CPU) |
|
||||||
| Object Detection | Standard Frigate+ detection applies | Bypasses standard object detection |
|
| Object Detection | Standard Frigate+ detection applies | Bypasses standard object detection |
|
||||||
| Zones & Object Masks | Supported | Not supported |
|
|
||||||
| Debug View | May show `license_plate` bounding boxes | May **not** show `license_plate` bounding boxes |
|
| Debug View | May show `license_plate` bounding boxes | May **not** show `license_plate` bounding boxes |
|
||||||
| MQTT `frigate/events` | Publishes tracked object updates | Publishes limited updates |
|
| MQTT `frigate/events` | Publishes tracked object updates | Publishes limited updates |
|
||||||
| Explore | Recognized plates available in More Filters | Recognized plates available in More Filters |
|
| Explore | Recognized plates available in More Filters | Recognized plates available in More Filters |
|
||||||
@@ -335,19 +340,37 @@ Use `match_distance` to allow small character mismatches. Alternatively, define
|
|||||||
|
|
||||||
### How do I debug LPR issues?
|
### How do I debug LPR issues?
|
||||||
|
|
||||||
- View MQTT messages for `frigate/events` to verify detected plates.
|
Start with ["Why isn't my license plate being detected and recognized?"](#why-isnt-my-license-plate-being-detected-and-recognized). If you are still having issues, work through these steps.
|
||||||
- If you are using a Frigate+ model or a model that detects license plates, watch the debug view (Settings --> Debug) to ensure that `license_plate` is being detected with a `car` or `motorcycle`.
|
|
||||||
- Watch the debug view to see plates recognized in real-time. For non-dedicated LPR cameras, the `car` or `motorcycle` label will change to the recognized plate when LPR is enabled and working.
|
|
||||||
- Adjust `detection_threshold` and `recognition_threshold` settings per the suggestions [above](#advanced-configuration).
|
|
||||||
- Enable `debug_save_plates` to save images of detected text on plates to the clips directory (`/media/frigate/clips/lpr`). Ensure these images are readable and the text is clear.
|
|
||||||
- Enable debug logs for LPR by adding `frigate.data_processing.common.license_plate: debug` to your `logger` configuration. These logs are _very_ verbose, so only enable this when necessary.
|
|
||||||
|
|
||||||
```yaml
|
1. Enable debug logs to see exactly what Frigate is doing.
|
||||||
logger:
|
|
||||||
default: info
|
- Enable debug logs for LPR by adding `frigate.data_processing.common.license_plate: debug` to your `logger` configuration. These logs are _very_ verbose, so only keep this enabled when necessary.
|
||||||
logs:
|
|
||||||
frigate.data_processing.common.license_plate: debug
|
```yaml
|
||||||
```
|
logger:
|
||||||
|
default: info
|
||||||
|
logs:
|
||||||
|
frigate.data_processing.common.license_plate: debug
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Ensure your plates are being _detected_.
|
||||||
|
|
||||||
|
If you are using a Frigate+ or `license_plate` detecting model:
|
||||||
|
|
||||||
|
- Watch the debug view (Settings --> Debug) to ensure that `license_plate` is being detected.
|
||||||
|
- View MQTT messages for `frigate/events` to verify detected plates.
|
||||||
|
- You may need to adjust your `min_score` and/or `threshold` for the `license_plate` object if your plates are not being detected.
|
||||||
|
|
||||||
|
If you are **not** using a Frigate+ or `license_plate` detecting model:
|
||||||
|
|
||||||
|
- Watch the debug logs for messages from the YOLOv9 plate detector.
|
||||||
|
- You may need to adjust your `detection_threshold` if your plates are not being detected.
|
||||||
|
|
||||||
|
3. Ensure the characters on detected plates are being _recognized_.
|
||||||
|
|
||||||
|
- Enable `debug_save_plates` to save images of detected text on plates to the clips directory (`/media/frigate/clips/lpr`). Ensure these images are readable and the text is clear.
|
||||||
|
- Watch the debug view to see plates recognized in real-time. For non-dedicated LPR cameras, the `car` or `motorcycle` label will change to the recognized plate when LPR is enabled and working.
|
||||||
|
- Adjust `recognition_threshold` settings per the suggestions [above](#advanced-configuration).
|
||||||
|
|
||||||
### Will LPR slow down my system?
|
### Will LPR slow down my system?
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,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).
|
- 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.
|
- 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 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://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.
|
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.
|
||||||
|
|
||||||
@@ -172,7 +172,7 @@ For devices that support two way talk, Frigate can be configured to use the feat
|
|||||||
|
|
||||||
- Set up go2rtc with [WebRTC](#webrtc-extra-configuration).
|
- Set up go2rtc with [WebRTC](#webrtc-extra-configuration).
|
||||||
- Ensure you access Frigate via https (may require [opening port 8971](/frigate/installation/#ports)).
|
- Ensure you access Frigate via https (may require [opening port 8971](/frigate/installation/#ports)).
|
||||||
- For the Home Assistant Frigate card, [follow the docs](https://github.com/dermotduffy/frigate-hass-card?tab=readme-ov-file#using-2-way-audio) for the correct source.
|
- For the Home Assistant Frigate card, [follow the docs](http://card.camera/#/usage/2-way-audio) for the correct source.
|
||||||
|
|
||||||
To use the Reolink Doorbell with two way talk, you should use the [recommended Reolink configuration](/configuration/camera_specific#reolink-doorbell)
|
To use the Reolink Doorbell with two way talk, you should use the [recommended Reolink configuration](/configuration/camera_specific#reolink-doorbell)
|
||||||
|
|
||||||
@@ -189,7 +189,12 @@ Frigate provides a dialog in the Camera Group Edit pane with several options for
|
|||||||
|
|
||||||
:::note
|
:::note
|
||||||
|
|
||||||
The default dashboard ("All Cameras") will always use Smart Streaming and the first entry set in your `streams` configuration, if defined. Use a camera group if you want to change any of these settings from the defaults.
|
The default dashboard ("All Cameras") will always use:
|
||||||
|
|
||||||
|
- Smart Streaming, unless you've disabled the global Automatic Live View in Settings.
|
||||||
|
- The first entry set in your `streams` configuration, if defined.
|
||||||
|
|
||||||
|
Use a camera group if you want to change any of these settings from the defaults.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
@@ -197,6 +202,12 @@ The default dashboard ("All Cameras") will always use Smart Streaming and the fi
|
|||||||
|
|
||||||
Cameras can be temporarily disabled through the Frigate UI and through [MQTT](/integrations/mqtt#frigatecamera_nameenabledset) to conserve system resources. When disabled, Frigate's ffmpeg processes are terminated — recording stops, object detection is paused, and the Live dashboard displays a blank image with a disabled message. Review items, tracked objects, and historical footage for disabled cameras can still be accessed via the UI.
|
Cameras can be temporarily disabled through the Frigate UI and through [MQTT](/integrations/mqtt#frigatecamera_nameenabledset) to conserve system resources. When disabled, Frigate's ffmpeg processes are terminated — recording stops, object detection is paused, and the Live dashboard displays a blank image with a disabled message. Review items, tracked objects, and historical footage for disabled cameras can still be accessed via the UI.
|
||||||
|
|
||||||
|
:::note
|
||||||
|
|
||||||
|
Disabling a camera via the Frigate UI or MQTT is temporary and does not persist through restarts of Frigate.
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
For restreamed cameras, go2rtc remains active but does not use system resources for decoding or processing unless there are active external consumers (such as the Advanced Camera Card in Home Assistant using a go2rtc source).
|
For restreamed cameras, go2rtc remains active but does not use system resources for decoding or processing unless there are active external consumers (such as the Advanced Camera Card in Home Assistant using a go2rtc source).
|
||||||
|
|
||||||
Note that disabling a camera through the config file (`enabled: False`) removes all related UI elements, including historical footage access. To retain access while disabling the camera, keep it enabled in the config and use the UI or MQTT to disable it temporarily.
|
Note that disabling a camera through the config file (`enabled: False`) removes all related UI elements, including historical footage access. To retain access while disabling the camera, keep it enabled in the config and use the UI or MQTT to disable it temporarily.
|
||||||
|
|||||||
@@ -104,4 +104,4 @@ Lightning threshold does not stop motion based recordings from being saved.
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
Large changes in motion like PTZ moves and camera switches between Color and IR mode should result in no motion detection. This is done via the `lightning_threshold` configuration. It is defined as the percentage of the image used to detect lightning or other substantial changes where motion detection needs to recalibrate. Increasing this value will make motion detection more likely to consider lightning or IR mode changes as valid motion. Decreasing this value will make motion detection more likely to ignore large amounts of motion such as a person approaching a doorbell camera.
|
Large changes in motion like PTZ moves and camera switches between Color and IR mode should result in a pause in object detection. This is done via the `lightning_threshold` configuration. It is defined as the percentage of the image used to detect lightning or other substantial changes where motion detection needs to recalibrate. Increasing this value will make motion detection more likely to consider lightning or IR mode changes as valid motion. Decreasing this value will make motion detection more likely to ignore large amounts of motion such as a person approaching a doorbell camera.
|
||||||
|
|||||||
@@ -24,10 +24,13 @@ Frigate supports multiple different detectors that work on different types of ha
|
|||||||
- [OpenVino](#openvino-detector): OpenVino can run on Intel Arc GPUs, Intel integrated GPUs, and Intel CPUs to provide efficient object detection.
|
- [OpenVino](#openvino-detector): OpenVino can run on Intel Arc GPUs, Intel integrated GPUs, and Intel CPUs to provide efficient object detection.
|
||||||
- [ONNX](#onnx): OpenVINO will automatically be detected and used as a detector in the default Frigate image when a supported ONNX model is configured.
|
- [ONNX](#onnx): OpenVINO will automatically be detected and used as a detector in the default Frigate image when a supported ONNX model is configured.
|
||||||
|
|
||||||
**Nvidia**
|
**Nvidia GPU**
|
||||||
|
|
||||||
- [TensortRT](#nvidia-tensorrt-detector): TensorRT can run on Nvidia GPUs and Jetson devices, using one of many default models.
|
- [ONNX](#onnx): TensorRT will automatically be detected and used as a detector in the `-tensorrt` Frigate image when a supported ONNX model is configured.
|
||||||
- [ONNX](#onnx): TensorRT will automatically be detected and used as a detector in the `-tensorrt` or `-tensorrt-jp6` Frigate images when a supported ONNX model is configured.
|
|
||||||
|
**Nvidia Jetson**
|
||||||
|
- [TensortRT](#nvidia-tensorrt-detector): TensorRT can run on Jetson devices, using one of many default models.
|
||||||
|
- [ONNX](#onnx): TensorRT will automatically be detected and used as a detector in the `-tensorrt-jp6` Frigate image when a supported ONNX model is configured.
|
||||||
|
|
||||||
**Rockchip**
|
**Rockchip**
|
||||||
|
|
||||||
@@ -399,111 +402,6 @@ model:
|
|||||||
|
|
||||||
Note that the labelmap uses a subset of the complete COCO label set that has only 80 objects.
|
Note that the labelmap uses a subset of the complete COCO label set that has only 80 objects.
|
||||||
|
|
||||||
## NVidia TensorRT Detector
|
|
||||||
|
|
||||||
Nvidia GPUs may be used for object detection using the TensorRT libraries. Due to the size of the additional libraries, this detector is only provided in images with the `-tensorrt` tag suffix, e.g. `ghcr.io/blakeblackshear/frigate:stable-tensorrt`. This detector is designed to work with Yolo models for object detection.
|
|
||||||
|
|
||||||
### Minimum Hardware Support
|
|
||||||
|
|
||||||
The TensorRT detector uses the 12.x series of CUDA libraries which have minor version compatibility. The minimum driver version on the host system must be `>=545`. Also the GPU must support a Compute Capability of `5.0` or greater. This generally correlates to a Maxwell-era GPU or newer, check the NVIDIA GPU Compute Capability table linked below.
|
|
||||||
|
|
||||||
To use the TensorRT detector, make sure your host system has the [nvidia-container-runtime](https://docs.docker.com/config/containers/resource_constraints/#access-an-nvidia-gpu) installed to pass through the GPU to the container and the host system has a compatible driver installed for your GPU.
|
|
||||||
|
|
||||||
There are improved capabilities in newer GPU architectures that TensorRT can benefit from, such as INT8 operations and Tensor cores. The features compatible with your hardware will be optimized when the model is converted to a trt file. Currently the script provided for generating the model provides a switch to enable/disable FP16 operations. If you wish to use newer features such as INT8 optimization, more work is required.
|
|
||||||
|
|
||||||
#### Compatibility References:
|
|
||||||
|
|
||||||
[NVIDIA TensorRT Support Matrix](https://docs.nvidia.com/deeplearning/tensorrt/archives/tensorrt-841/support-matrix/index.html)
|
|
||||||
|
|
||||||
[NVIDIA CUDA Compatibility](https://docs.nvidia.com/deploy/cuda-compatibility/index.html)
|
|
||||||
|
|
||||||
[NVIDIA GPU Compute Capability](https://developer.nvidia.com/cuda-gpus)
|
|
||||||
|
|
||||||
### Generate Models
|
|
||||||
|
|
||||||
The model used for TensorRT must be preprocessed on the same hardware platform that they will run on. This means that each user must run additional setup to generate a model file for the TensorRT library. A script is included that will build several common models.
|
|
||||||
|
|
||||||
The Frigate image will generate model files during startup if the specified model is not found. Processed models are stored in the `/config/model_cache` folder. Typically the `/config` path is mapped to a directory on the host already and the `model_cache` does not need to be mapped separately unless the user wants to store it in a different location on the host.
|
|
||||||
|
|
||||||
By default, no models will be generated, but this can be overridden by specifying the `YOLO_MODELS` environment variable in Docker. One or more models may be listed in a comma-separated format, and each one will be generated. Models will only be generated if the corresponding `{model}.trt` file is not present in the `model_cache` folder, so you can force a model to be regenerated by deleting it from your Frigate data folder.
|
|
||||||
|
|
||||||
If you have a Jetson device with DLAs (Xavier or Orin), you can generate a model that will run on the DLA by appending `-dla` to your model name, e.g. specify `YOLO_MODELS=yolov7-320-dla`. The model will run on DLA0 (Frigate does not currently support DLA1). DLA-incompatible layers will fall back to running on the GPU.
|
|
||||||
|
|
||||||
If your GPU does not support FP16 operations, you can pass the environment variable `USE_FP16=False` to disable it.
|
|
||||||
|
|
||||||
Specific models can be selected by passing an environment variable to the `docker run` command or in your `docker-compose.yml` file. Use the form `-e YOLO_MODELS=yolov4-416,yolov4-tiny-416` to select one or more model names. The models available are shown below.
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>Available Models</summary>
|
|
||||||
```
|
|
||||||
yolov3-288
|
|
||||||
yolov3-416
|
|
||||||
yolov3-608
|
|
||||||
yolov3-spp-288
|
|
||||||
yolov3-spp-416
|
|
||||||
yolov3-spp-608
|
|
||||||
yolov3-tiny-288
|
|
||||||
yolov3-tiny-416
|
|
||||||
yolov4-288
|
|
||||||
yolov4-416
|
|
||||||
yolov4-608
|
|
||||||
yolov4-csp-256
|
|
||||||
yolov4-csp-512
|
|
||||||
yolov4-p5-448
|
|
||||||
yolov4-p5-896
|
|
||||||
yolov4-tiny-288
|
|
||||||
yolov4-tiny-416
|
|
||||||
yolov4x-mish-320
|
|
||||||
yolov4x-mish-640
|
|
||||||
yolov7-tiny-288
|
|
||||||
yolov7-tiny-416
|
|
||||||
yolov7-640
|
|
||||||
yolov7-416
|
|
||||||
yolov7-320
|
|
||||||
yolov7x-640
|
|
||||||
yolov7x-320
|
|
||||||
```
|
|
||||||
</details>
|
|
||||||
|
|
||||||
An example `docker-compose.yml` fragment that converts the `yolov4-608` and `yolov7x-640` models for a Pascal card would look something like this:
|
|
||||||
|
|
||||||
```yml
|
|
||||||
frigate:
|
|
||||||
environment:
|
|
||||||
- YOLO_MODELS=yolov7-320,yolov7x-640
|
|
||||||
- USE_FP16=false
|
|
||||||
```
|
|
||||||
|
|
||||||
If you have multiple GPUs passed through to Frigate, you can specify which one to use for the model conversion. The conversion script will use the first visible GPU, however in systems with mixed GPU models you may not want to use the default index for object detection. Add the `TRT_MODEL_PREP_DEVICE` environment variable to select a specific GPU.
|
|
||||||
|
|
||||||
```yml
|
|
||||||
frigate:
|
|
||||||
environment:
|
|
||||||
- TRT_MODEL_PREP_DEVICE=0 # Optionally, select which GPU is used for model optimization
|
|
||||||
```
|
|
||||||
|
|
||||||
### Configuration Parameters
|
|
||||||
|
|
||||||
The TensorRT detector can be selected by specifying `tensorrt` as the model type. The GPU will need to be passed through to the docker container using the same methods described in the [Hardware Acceleration](hardware_acceleration_video.md#nvidia-gpus) section. If you pass through multiple GPUs, you can select which GPU is used for a detector with the `device` configuration parameter. The `device` parameter is an integer value of the GPU index, as shown by `nvidia-smi` within the container.
|
|
||||||
|
|
||||||
The TensorRT detector uses `.trt` model files that are located in `/config/model_cache/tensorrt` by default. These model path and dimensions used will depend on which model you have generated.
|
|
||||||
|
|
||||||
Use the config below to work with generated TRT models:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
detectors:
|
|
||||||
tensorrt:
|
|
||||||
type: tensorrt
|
|
||||||
device: 0 #This is the default, select the first GPU
|
|
||||||
|
|
||||||
model:
|
|
||||||
path: /config/model_cache/tensorrt/yolov7-320.trt
|
|
||||||
input_tensor: nchw
|
|
||||||
input_pixel_format: rgb
|
|
||||||
width: 320
|
|
||||||
height: 320
|
|
||||||
```
|
|
||||||
|
|
||||||
## AMD/ROCm GPU detector
|
## AMD/ROCm GPU detector
|
||||||
|
|
||||||
### Setup
|
### Setup
|
||||||
@@ -801,6 +699,88 @@ To verify that the integration is working correctly, start Frigate and observe t
|
|||||||
|
|
||||||
# Community Supported Detectors
|
# Community Supported Detectors
|
||||||
|
|
||||||
|
## NVidia TensorRT Detector
|
||||||
|
|
||||||
|
Nvidia Jetson devices may be used for object detection using the TensorRT libraries. Due to the size of the additional libraries, this detector is only provided in images with the `-tensorrt-jp6` tag suffix, e.g. `ghcr.io/blakeblackshear/frigate:stable-tensorrt-jp6`. This detector is designed to work with Yolo models for object detection.
|
||||||
|
|
||||||
|
### Generate Models
|
||||||
|
|
||||||
|
The model used for TensorRT must be preprocessed on the same hardware platform that they will run on. This means that each user must run additional setup to generate a model file for the TensorRT library. A script is included that will build several common models.
|
||||||
|
|
||||||
|
The Frigate image will generate model files during startup if the specified model is not found. Processed models are stored in the `/config/model_cache` folder. Typically the `/config` path is mapped to a directory on the host already and the `model_cache` does not need to be mapped separately unless the user wants to store it in a different location on the host.
|
||||||
|
|
||||||
|
By default, no models will be generated, but this can be overridden by specifying the `YOLO_MODELS` environment variable in Docker. One or more models may be listed in a comma-separated format, and each one will be generated. Models will only be generated if the corresponding `{model}.trt` file is not present in the `model_cache` folder, so you can force a model to be regenerated by deleting it from your Frigate data folder.
|
||||||
|
|
||||||
|
If you have a Jetson device with DLAs (Xavier or Orin), you can generate a model that will run on the DLA by appending `-dla` to your model name, e.g. specify `YOLO_MODELS=yolov7-320-dla`. The model will run on DLA0 (Frigate does not currently support DLA1). DLA-incompatible layers will fall back to running on the GPU.
|
||||||
|
|
||||||
|
If your GPU does not support FP16 operations, you can pass the environment variable `USE_FP16=False` to disable it.
|
||||||
|
|
||||||
|
Specific models can be selected by passing an environment variable to the `docker run` command or in your `docker-compose.yml` file. Use the form `-e YOLO_MODELS=yolov4-416,yolov4-tiny-416` to select one or more model names. The models available are shown below.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Available Models</summary>
|
||||||
|
```
|
||||||
|
yolov3-288
|
||||||
|
yolov3-416
|
||||||
|
yolov3-608
|
||||||
|
yolov3-spp-288
|
||||||
|
yolov3-spp-416
|
||||||
|
yolov3-spp-608
|
||||||
|
yolov3-tiny-288
|
||||||
|
yolov3-tiny-416
|
||||||
|
yolov4-288
|
||||||
|
yolov4-416
|
||||||
|
yolov4-608
|
||||||
|
yolov4-csp-256
|
||||||
|
yolov4-csp-512
|
||||||
|
yolov4-p5-448
|
||||||
|
yolov4-p5-896
|
||||||
|
yolov4-tiny-288
|
||||||
|
yolov4-tiny-416
|
||||||
|
yolov4x-mish-320
|
||||||
|
yolov4x-mish-640
|
||||||
|
yolov7-tiny-288
|
||||||
|
yolov7-tiny-416
|
||||||
|
yolov7-640
|
||||||
|
yolov7-416
|
||||||
|
yolov7-320
|
||||||
|
yolov7x-640
|
||||||
|
yolov7x-320
|
||||||
|
```
|
||||||
|
</details>
|
||||||
|
|
||||||
|
An example `docker-compose.yml` fragment that converts the `yolov4-608` and `yolov7x-640` models would look something like this:
|
||||||
|
|
||||||
|
```yml
|
||||||
|
frigate:
|
||||||
|
environment:
|
||||||
|
- YOLO_MODELS=yolov7-320,yolov7x-640
|
||||||
|
- USE_FP16=false
|
||||||
|
```
|
||||||
|
|
||||||
|
### Configuration Parameters
|
||||||
|
|
||||||
|
The TensorRT detector can be selected by specifying `tensorrt` as the model type. The GPU will need to be passed through to the docker container using the same methods described in the [Hardware Acceleration](hardware_acceleration_video.md#nvidia-gpus) section. If you pass through multiple GPUs, you can select which GPU is used for a detector with the `device` configuration parameter. The `device` parameter is an integer value of the GPU index, as shown by `nvidia-smi` within the container.
|
||||||
|
|
||||||
|
The TensorRT detector uses `.trt` model files that are located in `/config/model_cache/tensorrt` by default. These model path and dimensions used will depend on which model you have generated.
|
||||||
|
|
||||||
|
Use the config below to work with generated TRT models:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
detectors:
|
||||||
|
tensorrt:
|
||||||
|
type: tensorrt
|
||||||
|
device: 0 #This is the default, select the first GPU
|
||||||
|
|
||||||
|
model:
|
||||||
|
path: /config/model_cache/tensorrt/yolov7-320.trt
|
||||||
|
labelmap_path: /labelmap/coco-80.txt
|
||||||
|
input_tensor: nchw
|
||||||
|
input_pixel_format: rgb
|
||||||
|
width: 320
|
||||||
|
height: 320
|
||||||
|
```
|
||||||
|
|
||||||
## Rockchip platform
|
## Rockchip platform
|
||||||
|
|
||||||
Hardware accelerated object detection is supported on the following SoCs:
|
Hardware accelerated object detection is supported on the following SoCs:
|
||||||
@@ -1024,7 +1004,7 @@ x.export()
|
|||||||
|
|
||||||
### Downloading YOLO-NAS Model
|
### Downloading YOLO-NAS Model
|
||||||
|
|
||||||
You can build and download a compatible model with pre-trained weights using [this notebook](https://github.com/blakeblackshear/frigate/blob/dev/notebooks/YOLO_NAS_Pretrained_Export.ipynb) [](https://colab.research.google.com/github/blakeblackshear/frigate/blob/dev/notebooks/YOLO_NAS_Pretrained_Export.ipynb).
|
You can build and download a compatible model with pre-trained weights using [this notebook](https://github.com/blakeblackshear/frigate/blob/dev/notebooks/YOLO_NAS_Pretrained_Export.ipynb) [](https://colab.research.google.com/github/blakeblackshear/frigate/blob/dev/notebooks/YOLO_NAS_Pretrained_Export.ipynb) which can be run directly in [Google Colab](https://colab.research.google.com/github/blakeblackshear/frigate/blob/dev/notebooks/YOLO_NAS_Pretrained_Export.ipynb).
|
||||||
|
|
||||||
:::warning
|
:::warning
|
||||||
|
|
||||||
@@ -1053,13 +1033,14 @@ python3 yolo_to_onnx.py -m yolov7-320
|
|||||||
|
|
||||||
#### YOLOv9
|
#### YOLOv9
|
||||||
|
|
||||||
YOLOv9 models can be exported using the below code or they [can be downloaded from hugging face](https://huggingface.co/Xenova/yolov9-onnx/tree/main)
|
YOLOv9 models can be exported using the below code
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git clone https://github.com/WongKinYiu/yolov9
|
git clone https://github.com/WongKinYiu/yolov9
|
||||||
cd yolov9
|
cd yolov9
|
||||||
|
|
||||||
# setup the virtual environment so installation doesn't affect main system
|
# setup the virtual environment so installation doesn't affect main system
|
||||||
|
# NOTE: Virtual environment must be using Python 3.11 or older.
|
||||||
python3 -m venv ./
|
python3 -m venv ./
|
||||||
bin/pip install -r requirements.txt
|
bin/pip install -r requirements.txt
|
||||||
bin/pip install onnx onnxruntime onnx-simplifier>=0.4.1
|
bin/pip install onnx onnxruntime onnx-simplifier>=0.4.1
|
||||||
|
|||||||
@@ -20,5 +20,5 @@ In order to install Frigate as a PWA, the following requirements must be met:
|
|||||||
Installation varies slightly based on the device that is being used:
|
Installation varies slightly based on the device that is being used:
|
||||||
|
|
||||||
- Desktop: Use the install button typically found in right edge of the address bar
|
- Desktop: Use the install button typically found in right edge of the address bar
|
||||||
- Android: Use the `Install as App` button in the more options menu
|
- Android: Use the `Install as App` button in the more options menu for Chrome, and the `Add app to Home screen` button for Firefox
|
||||||
- iOS: Use the `Add to Homescreen` button in the share menu
|
- iOS: Use the `Add to Homescreen` button in the share menu
|
||||||
|
|||||||
@@ -91,6 +91,8 @@ proxy:
|
|||||||
auth_secret: None
|
auth_secret: None
|
||||||
# Optional: The default role to use for proxy auth. Must be "admin" or "viewer"
|
# Optional: The default role to use for proxy auth. Must be "admin" or "viewer"
|
||||||
default_role: viewer
|
default_role: viewer
|
||||||
|
# Optional: The character used to separate multiple values in the proxy headers. (default: shown below)
|
||||||
|
separator: ","
|
||||||
|
|
||||||
# Optional: Authentication configuration
|
# Optional: Authentication configuration
|
||||||
auth:
|
auth:
|
||||||
@@ -559,6 +561,8 @@ face_recognition:
|
|||||||
recognition_threshold: 0.9
|
recognition_threshold: 0.9
|
||||||
# Optional: Min area of detected face box to consider running face recognition (default: shown below)
|
# Optional: Min area of detected face box to consider running face recognition (default: shown below)
|
||||||
min_area: 500
|
min_area: 500
|
||||||
|
# Optional: Min face recognitions for the sub label to be applied to the person object (default: shown below)
|
||||||
|
min_faces: 1
|
||||||
# Optional: Number of images of recognized faces to save for training (default: shown below)
|
# Optional: Number of images of recognized faces to save for training (default: shown below)
|
||||||
save_attempts: 100
|
save_attempts: 100
|
||||||
# Optional: Apply a blur quality filter to adjust confidence based on the blur level of the image (default: shown below)
|
# Optional: Apply a blur quality filter to adjust confidence based on the blur level of the image (default: shown below)
|
||||||
|
|||||||
@@ -21,6 +21,21 @@ In 0.14 and later, all of that is bundled into a single review item which starts
|
|||||||
|
|
||||||
Not every segment of video captured by Frigate may be of the same level of interest to you. Video of people who enter your property may be a different priority than those walking by on the sidewalk. For this reason, Frigate 0.14 categorizes review items as _alerts_ and _detections_. By default, all person and car objects are considered alerts. You can refine categorization of your review items by configuring required zones for them.
|
Not every segment of video captured by Frigate may be of the same level of interest to you. Video of people who enter your property may be a different priority than those walking by on the sidewalk. For this reason, Frigate 0.14 categorizes review items as _alerts_ and _detections_. By default, all person and car objects are considered alerts. You can refine categorization of your review items by configuring required zones for them.
|
||||||
|
|
||||||
|
:::note
|
||||||
|
|
||||||
|
Alerts and detections categorize the tracked objects in review items, but Frigate must first detect those objects with your configured object detector (Coral, OpenVINO, etc). By default, the object tracker only detects `person`. Setting `labels` for `alerts` and `detections` does not automatically enable detection of new objects. To detect more than `person`, you should add the following to your config:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
objects:
|
||||||
|
track:
|
||||||
|
- person
|
||||||
|
- car
|
||||||
|
- ...
|
||||||
|
```
|
||||||
|
|
||||||
|
See the [objects documentation](objects.md) for the list of objects that Frigate's default model tracks.
|
||||||
|
:::
|
||||||
|
|
||||||
## Restricting alerts to specific labels
|
## Restricting alerts to specific labels
|
||||||
|
|
||||||
By default a review item will only be marked as an alert if a person or car is detected. This can be configured to include any object or audio label using the following config:
|
By default a review item will only be marked as an alert if a person or car is detected. This can be configured to include any object or audio label using the following config:
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ For best performance, 16GB or more of RAM and a dedicated GPU are recommended.
|
|||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
Semantic Search is disabled by default, and must be enabled in your config file or in the UI's Classification Settings page before it can be used. Semantic Search is a global configuration setting.
|
Semantic Search is disabled by default, and must be enabled in your config file or in the UI's Enrichments Settings page before it can be used. Semantic Search is a global configuration setting.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
semantic_search:
|
semantic_search:
|
||||||
@@ -29,7 +29,7 @@ semantic_search:
|
|||||||
|
|
||||||
:::tip
|
:::tip
|
||||||
|
|
||||||
The embeddings database can be re-indexed from the existing tracked objects in your database by pressing the "Reindex" button in the Classification Settings in the UI or by adding `reindex: True` to your `semantic_search` configuration and restarting Frigate. Depending on the number of tracked objects you have, it can take a long while to complete and may max out your CPU while indexing.
|
The embeddings database can be re-indexed from the existing tracked objects in your database by pressing the "Reindex" button in the Enrichments Settings in the UI or by adding `reindex: True` to your `semantic_search` configuration and restarting Frigate. Depending on the number of tracked objects you have, it can take a long while to complete and may max out your CPU while indexing.
|
||||||
|
|
||||||
If you are enabling Semantic Search for the first time, be advised that Frigate does not automatically index older tracked objects. You will need to reindex as described above.
|
If you are enabling Semantic Search for the first time, be advised that Frigate does not automatically index older tracked objects. You will need to reindex as described above.
|
||||||
|
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ Note that certbot uses symlinks, and those can't be followed by the container un
|
|||||||
frigate:
|
frigate:
|
||||||
...
|
...
|
||||||
volumes:
|
volumes:
|
||||||
- /etc/letsencrypt/live/frigate:/etc/letsencrypt/live/frigate:ro
|
- /etc/letsencrypt/live/your.fqdn.net:/etc/letsencrypt/live/frigate:ro
|
||||||
- /etc/letsencrypt/archive/frigate:/etc/letsencrypt/archive/frigate:ro
|
- /etc/letsencrypt/archive/your.fqdn.net:/etc/letsencrypt/archive/your.fqdn.net:ro
|
||||||
...
|
...
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ Your zone must be defined with exactly 4 points and should be aligned to the gro
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
Speed estimation requires a minimum number of frames for your object to be tracked before a valid estimate can be calculated, so create your zone away from places where objects enter and exit for the best results. _Your zone should not take up the full frame._ An object's speed is tracked while it is in the zone and then saved to Frigate's database.
|
Speed estimation requires a minimum number of frames for your object to be tracked before a valid estimate can be calculated, so create your zone away from places where objects enter and exit for the best results. The object's bounding box must be stable and remain a constant size as it enters and exits the zone. _Your zone should not take up the full frame, and the zone does **not** need to be the same size or larger than the objects passing through it._ An object's speed is tracked while it passes through the zone and then saved to Frigate's database.
|
||||||
|
|
||||||
Accurate real-world distance measurements are required to estimate speeds. These distances can be specified in your zone config through the `distances` field.
|
Accurate real-world distance measurements are required to estimate speeds. These distances can be specified in your zone config through the `distances` field.
|
||||||
|
|
||||||
@@ -165,8 +165,9 @@ These speed values are output as a number in miles per hour (mph) or kilometers
|
|||||||
|
|
||||||
#### Best practices and caveats
|
#### Best practices and caveats
|
||||||
|
|
||||||
- Speed estimation works best with a straight road or path when your object travels in a straight line across that path. Avoid creating your zone near intersections or anywhere that objects would make a turn. If the bounding box changes shape (either because the object made a turn or became partially obscured, for example), speed estimation will not be accurate.
|
- Speed estimation works best with a straight road or path when your object travels in a straight line across that path. Avoid creating your zone near intersections or anywhere that objects would make a turn.
|
||||||
- Create a zone where the bottom center of your object's bounding box travels directly through it and does not become obscured at any time. See the photo example above.
|
- Create a zone where the bottom center of your object's bounding box travels directly through it and does not become obscured at any time.
|
||||||
|
- A large zone can be used (as in the photo example above), but it may cause inaccurate estimation if the object's bounding box changes shape (such as when it turns or becomes partially hidden). Generally it's best to make your zone large enough to capture a few frames, but small enough so that the bounding box doesn't change size as it enters, travels through, and exits the zone.
|
||||||
- Depending on the size and location of your zone, you may want to decrease the zone's `inertia` value from the default of 3.
|
- Depending on the size and location of your zone, you may want to decrease the zone's `inertia` value from the default of 3.
|
||||||
- The more accurate your real-world dimensions can be measured, the more accurate speed estimation will be. However, due to the way Frigate's tracking algorithm works, you may need to tweak the real-world distance values so that estimated speeds better match real-world speeds.
|
- The more accurate your real-world dimensions can be measured, the more accurate speed estimation will be. However, due to the way Frigate's tracking algorithm works, you may need to tweak the real-world distance values so that estimated speeds better match real-world speeds.
|
||||||
- Once an object leaves the zone, speed accuracy will likely decrease due to perspective distortion and misalignment with the calibrated area. Therefore, speed values will show as a zero through MQTT and will not be visible on the debug view when an object is outside of a speed tracking zone.
|
- Once an object leaves the zone, speed accuracy will likely decrease due to perspective distortion and misalignment with the calibrated area. Therefore, speed values will show as a zero through MQTT and will not be visible on the debug view when an object is outside of a speed tracking zone.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ id: camera_setup
|
|||||||
title: Camera setup
|
title: Camera setup
|
||||||
---
|
---
|
||||||
|
|
||||||
Cameras configured to output H.264 video and AAC audio will offer the most compatibility with all features of Frigate and Home Assistant. H.265 has better compression, but less compatibility. Chrome 108+, Safari and Edge are the only browsers able to play H.265 and only support a limited number of H.265 profiles. Ideally, cameras should be configured directly for the desired resolutions and frame rates you want to use in Frigate. Reducing frame rates within Frigate will waste CPU resources decoding extra frames that are discarded. There are three different goals that you want to tune your stream configurations around.
|
Cameras configured to output H.264 video and AAC audio will offer the most compatibility with all features of Frigate and Home Assistant. H.265 has better compression, but less compatibility. Firefox 134+/136+/137+ (Windows/Mac/Linux & Android), Chrome 108+, Safari and Edge are the only browsers able to play H.265 and only support a limited number of H.265 profiles. Ideally, cameras should be configured directly for the desired resolutions and frame rates you want to use in Frigate. Reducing frame rates within Frigate will waste CPU resources decoding extra frames that are discarded. There are three different goals that you want to tune your stream configurations around.
|
||||||
|
|
||||||
- **Detection**: This is the only stream that Frigate will decode for processing. Also, this is the stream where snapshots will be generated from. The resolution for detection should be tuned for the size of the objects you want to detect. See [Choosing a detect resolution](#choosing-a-detect-resolution) for more details. The recommended frame rate is 5fps, but may need to be higher (10fps is the recommended maximum for most users) for very fast moving objects. Higher resolutions and frame rates will drive higher CPU usage on your server.
|
- **Detection**: This is the only stream that Frigate will decode for processing. Also, this is the stream where snapshots will be generated from. The resolution for detection should be tuned for the size of the objects you want to detect. See [Choosing a detect resolution](#choosing-a-detect-resolution) for more details. The recommended frame rate is 5fps, but may need to be higher (10fps is the recommended maximum for most users) for very fast moving objects. Higher resolutions and frame rates will drive higher CPU usage on your server.
|
||||||
|
|
||||||
|
|||||||
@@ -66,4 +66,4 @@ The time period starting when a tracked object entered the frame and ending when
|
|||||||
|
|
||||||
## Zone
|
## Zone
|
||||||
|
|
||||||
Zones are areas of interest, zones can be used for notifications and for limiting the areas where Frigate will create an [event](#event). [See the zone docs for more info](/configuration/zones)
|
Zones are areas of interest, zones can be used for notifications and for limiting the areas where Frigate will create a [review item](#review-item). [See the zone docs for more info](/configuration/zones)
|
||||||
|
|||||||
@@ -9,23 +9,36 @@ Cameras that output H.264 video and AAC audio will offer the most compatibility
|
|||||||
|
|
||||||
I recommend Dahua, Hikvision, and Amcrest in that order. Dahua edges out Hikvision because they are easier to find and order, not because they are better cameras. I personally use Dahua cameras because they are easier to purchase directly. In my experience Dahua and Hikvision both have multiple streams with configurable resolutions and frame rates and rock solid streams. They also both have models with large sensors well known for excellent image quality at night. Not all the models are equal. Larger sensors are better than higher resolutions; especially at night. Amcrest is the fallback recommendation because they are rebranded Dahuas. They are rebranding the lower end models with smaller sensors or less configuration options.
|
I recommend Dahua, Hikvision, and Amcrest in that order. Dahua edges out Hikvision because they are easier to find and order, not because they are better cameras. I personally use Dahua cameras because they are easier to purchase directly. In my experience Dahua and Hikvision both have multiple streams with configurable resolutions and frame rates and rock solid streams. They also both have models with large sensors well known for excellent image quality at night. Not all the models are equal. Larger sensors are better than higher resolutions; especially at night. Amcrest is the fallback recommendation because they are rebranded Dahuas. They are rebranding the lower end models with smaller sensors or less configuration options.
|
||||||
|
|
||||||
Many users have reported various issues with Reolink cameras, so I do not recommend them. If you are using Reolink, I suggest the [Reolink specific configuration](../configuration/camera_specific.md#reolink-cameras). Wifi cameras are also not recommended. Their streams are less reliable and cause connection loss and/or lost video data.
|
WiFi cameras are not recommended as [their streams are less reliable and cause connection loss and/or lost video data](https://ipcamtalk.com/threads/camera-conflicts.68142/#post-738821), especially when more than a few WiFi cameras will be used at the same time.
|
||||||
|
|
||||||
Here are some of the camera's I recommend:
|
Many users have reported various issues with 4K-plus Reolink cameras, it is best to stick with 5MP and lower for Reolink cameras. If you are using Reolink, I suggest the [Reolink specific configuration](../configuration/camera_specific.md#reolink-cameras).
|
||||||
|
|
||||||
|
Here are some of the cameras I recommend:
|
||||||
|
|
||||||
- <a href="https://amzn.to/4fwoNWA" target="_blank" rel="nofollow noopener sponsored">Loryta(Dahua) IPC-T549M-ALED-S3</a> (affiliate link)
|
- <a href="https://amzn.to/4fwoNWA" target="_blank" rel="nofollow noopener sponsored">Loryta(Dahua) IPC-T549M-ALED-S3</a> (affiliate link)
|
||||||
- <a href="https://amzn.to/3YXpcMw" target="_blank" rel="nofollow noopener sponsored">Loryta(Dahua) IPC-T54IR-AS</a> (affiliate link)
|
- <a href="https://amzn.to/3YXpcMw" target="_blank" rel="nofollow noopener sponsored">Loryta(Dahua) IPC-T54IR-AS</a> (affiliate link)
|
||||||
- <a href="https://amzn.to/3AvBHoY" target="_blank" rel="nofollow noopener sponsored">Amcrest IP5M-T1179EW-AI-V3</a> (affiliate link)
|
- <a href="https://amzn.to/3AvBHoY" target="_blank" rel="nofollow noopener sponsored">Amcrest IP5M-T1179EW-AI-V3</a> (affiliate link)
|
||||||
|
- <a href="https://amzn.to/4ltOpaC" target="_blank" rel="nofollow noopener sponsored">HIKVISION DS-2CD2387G2P-LSU/SL ColorVu 8MP Panoramic Turret IP Camera</a> (affiliate link)
|
||||||
|
|
||||||
I may earn a small commission for my endorsement, recommendation, testimonial, or link to any products or services from this website.
|
I may earn a small commission for my endorsement, recommendation, testimonial, or link to any products or services from this website.
|
||||||
|
|
||||||
## Server
|
## Server
|
||||||
|
|
||||||
My current favorite is the Beelink EQ13 because of the efficient N100 CPU and dual NICs that allow you to setup a dedicated private network for your cameras where they can be blocked from accessing the internet. There are many used workstation options on eBay that work very well. Anything with an Intel CPU and capable of running Debian should work fine. As a bonus, you may want to look for devices with a M.2 or PCIe express slot that is compatible with the Hailo8 or Google Coral. I may earn a small commission for my endorsement, recommendation, testimonial, or link to any products or services from this website.
|
My current favorite is the Beelink EQ13 because of the efficient N100 CPU and dual NICs that allow you to setup a dedicated private network for your cameras where they can be blocked from accessing the internet. There are many used workstation options on eBay that work very well. Anything with an Intel CPU and capable of running Debian should work fine. As a bonus, you may want to look for devices with a M.2 or PCIe express slot that is compatible with the Google Coral, Hailo, or other AI accelerators.
|
||||||
|
|
||||||
| Name | Notes |
|
Note that many of these mini PCs come with Windows pre-installed, and you will need to install Linux according to the [getting started guide](../guides/getting_started.md).
|
||||||
| ------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
|
||||||
| Beelink EQ13 (<a href="https://amzn.to/4iQaBKu" target="_blank" rel="nofollow noopener sponsored">Amazon</a>) | Dual gigabit NICs for easy isolated camera network. Easily handles several 1080p cameras. |
|
I may earn a small commission for my endorsement, recommendation, testimonial, or link to any products or services from this website.
|
||||||
|
|
||||||
|
:::warning
|
||||||
|
|
||||||
|
If the EQ13 is out of stock, the link below may take you to a suggested alternative on Amazon. The Beelink EQ14 has some known compatibility issues, so you should avoid that model for now.
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
|
| Name | Coral Inference Speed | Coral Compatibility | Notes |
|
||||||
|
| ------------------------------------------------------------------------------------------------------------- | --------------------- | ------------------- | ----------------------------------------------------------------------------------------- |
|
||||||
|
| Beelink EQ13 (<a href="https://amzn.to/4jn2qVr" target="_blank" rel="nofollow noopener sponsored">Amazon</a>) | 5-10ms | USB | Dual gigabit NICs for easy isolated camera network. Easily handles several 1080p cameras. |
|
||||||
|
|
||||||
## Detectors
|
## Detectors
|
||||||
|
|
||||||
@@ -116,14 +129,30 @@ Inference speeds vary greatly depending on the CPU or GPU used, some known examp
|
|||||||
| Intel HD 630 | ~ 15 ms | 320: ~ 30 ms | | |
|
| Intel HD 630 | ~ 15 ms | 320: ~ 30 ms | | |
|
||||||
| Intel UHD 730 | ~ 10 ms | 320: ~ 19 ms 640: ~ 54 ms | | |
|
| Intel UHD 730 | ~ 10 ms | 320: ~ 19 ms 640: ~ 54 ms | | |
|
||||||
| Intel UHD 770 | ~ 15 ms | 320: ~ 20 ms 640: ~ 46 ms | | |
|
| Intel UHD 770 | ~ 15 ms | 320: ~ 20 ms 640: ~ 46 ms | | |
|
||||||
| Intel N100 | ~ 15 ms | 320: ~ 20 ms | | |
|
| Intel N100 | ~ 15 ms | 320: ~ 25 ms | | Can only run one detector instance |
|
||||||
| Intel Iris XE | ~ 10 ms | 320: ~ 18 ms 640: ~ 50 ms | | |
|
| Intel Iris XE | ~ 10 ms | 320: ~ 18 ms 640: ~ 50 ms | | |
|
||||||
| Intel Arc A380 | ~ 6 ms | 320: ~ 10 ms 640: ~ 22 ms | 336: 20 ms 448: 27 ms | |
|
| Intel Arc A380 | ~ 6 ms | 320: ~ 10 ms 640: ~ 22 ms | 336: 20 ms 448: 27 ms | |
|
||||||
| Intel Arc A750 | ~ 4 ms | 320: ~ 8 ms | | |
|
| Intel Arc A750 | ~ 4 ms | 320: ~ 8 ms | | |
|
||||||
|
|
||||||
### TensorRT - Nvidia GPU
|
### TensorRT - Nvidia GPU
|
||||||
|
|
||||||
The TensortRT detector is able to run on x86 hosts that have an Nvidia GPU which supports the 12.x series of CUDA libraries. The minimum driver version on the host system must be `>=525.60.13`. Also the GPU must support a Compute Capability of `5.0` or greater. This generally correlates to a Maxwell-era GPU or newer, check the [TensorRT docs for more info](/configuration/object_detectors#nvidia-tensorrt-detector).
|
Frigate is able to utilize an Nvidia GPU which supports the 12.x series of CUDA libraries.
|
||||||
|
|
||||||
|
### Minimum Hardware Support
|
||||||
|
|
||||||
|
12.x series of CUDA libraries are used which have minor version compatibility. The minimum driver version on the host system must be `>=545`. Also the GPU must support a Compute Capability of `5.0` or greater. This generally correlates to a Maxwell-era GPU or newer, check the NVIDIA GPU Compute Capability table linked below.
|
||||||
|
|
||||||
|
Make sure your host system has the [nvidia-container-runtime](https://docs.docker.com/config/containers/resource_constraints/#access-an-nvidia-gpu) installed to pass through the GPU to the container and the host system has a compatible driver installed for your GPU.
|
||||||
|
|
||||||
|
There are improved capabilities in newer GPU architectures that TensorRT can benefit from, such as INT8 operations and Tensor cores. The features compatible with your hardware will be optimized when the model is converted to a trt file. Currently the script provided for generating the model provides a switch to enable/disable FP16 operations. If you wish to use newer features such as INT8 optimization, more work is required.
|
||||||
|
|
||||||
|
#### Compatibility References:
|
||||||
|
|
||||||
|
[NVIDIA TensorRT Support Matrix](https://docs.nvidia.com/deeplearning/tensorrt/archives/tensorrt-841/support-matrix/index.html)
|
||||||
|
|
||||||
|
[NVIDIA CUDA Compatibility](https://docs.nvidia.com/deploy/cuda-compatibility/index.html)
|
||||||
|
|
||||||
|
[NVIDIA GPU Compute Capability](https://developer.nvidia.com/cuda-gpus)
|
||||||
|
|
||||||
Inference speeds will vary greatly depending on the GPU and the model used.
|
Inference speeds will vary greatly depending on the GPU and the model used.
|
||||||
`tiny` variants are faster than the equivalent non-tiny model, some known examples are below:
|
`tiny` variants are faster than the equivalent non-tiny model, some known examples are below:
|
||||||
@@ -145,7 +174,7 @@ With the [rocm](../configuration/object_detectors.md#amdrocm-gpu-detector) detec
|
|||||||
|
|
||||||
| Name | YOLOv9 Inference Time | YOLO-NAS Inference Time |
|
| Name | YOLOv9 Inference Time | YOLO-NAS Inference Time |
|
||||||
| --------- | --------------------- | ------------------------- |
|
| --------- | --------------------- | ------------------------- |
|
||||||
| AMD 780M | ~ 14 ms | 320: ~ 30 ms 640: ~ 60 ms |
|
| AMD 780M | ~ 14 ms | 320: ~ 25 ms 640: ~ 50 ms |
|
||||||
| AMD 8700G | | 320: ~ 20 ms 640: ~ 40 ms |
|
| AMD 8700G | | 320: ~ 20 ms 640: ~ 40 ms |
|
||||||
|
|
||||||
## Community Supported Detectors
|
## Community Supported Detectors
|
||||||
@@ -193,4 +222,4 @@ Basically - When you increase the resolution and/or the frame rate of the stream
|
|||||||
|
|
||||||
YES! The Coral does not help with decoding video streams.
|
YES! The Coral does not help with decoding video streams.
|
||||||
|
|
||||||
Decompressing video streams takes a significant amount of CPU power. Video compression uses key frames (also known as I-frames) to send a full frame in the video stream. The following frames only include the difference from the key frame, and the CPU has to compile each frame by merging the differences with the key frame. [More detailed explanation](https://blog.video.ibm.com/streaming-video-tips/keyframes-interframe-video-compression/). Higher resolutions and frame rates mean more processing power is needed to decode the video stream, so try and set them on the camera to avoid unnecessary decoding work.
|
Decompressing video streams takes a significant amount of CPU power. Video compression uses key frames (also known as I-frames) to send a full frame in the video stream. The following frames only include the difference from the key frame, and the CPU has to compile each frame by merging the differences with the key frame. [More detailed explanation](https://support.video.ibm.com/hc/en-us/articles/18106203580316-Keyframes-InterFrame-Video-Compression). Higher resolutions and frame rates mean more processing power is needed to decode the video stream, so try and set them on the camera to avoid unnecessary decoding work.
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ $ sudo cat /sys/kernel/debug/rknpu/version
|
|||||||
RKNPU driver: v0.9.2 # or later version
|
RKNPU driver: v0.9.2 # or later version
|
||||||
```
|
```
|
||||||
|
|
||||||
I recommend [Joshua Riek's Ubuntu for Rockchip](https://github.com/Joshua-Riek/ubuntu-rockchip), if your board is supported.
|
I recommend [Armbian](https://www.armbian.com/download/?arch=aarch64), if your board is supported.
|
||||||
|
|
||||||
#### Setup
|
#### Setup
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,119 @@
|
|||||||
|
---
|
||||||
|
id: updating
|
||||||
|
title: Updating
|
||||||
|
---
|
||||||
|
|
||||||
|
# Updating Frigate
|
||||||
|
|
||||||
|
The current stable version of Frigate is **0.15.0**. The release notes and any breaking changes for this version can be found on the [Frigate GitHub releases page](https://github.com/blakeblackshear/frigate/releases/tag/v0.15.0).
|
||||||
|
|
||||||
|
Keeping Frigate up to date ensures you benefit from the latest features, performance improvements, and bug fixes. The update process varies slightly depending on your installation method (Docker, Home Assistant Addon, etc.). Below are instructions for the most common setups.
|
||||||
|
|
||||||
|
## Before You Begin
|
||||||
|
|
||||||
|
- **Stop Frigate**: For most methods, you’ll need to stop the running Frigate instance before backing up and updating.
|
||||||
|
- **Backup Your Configuration**: Always back up your `/config` directory (e.g., `config.yml` and `frigate.db`, the SQLite database) before updating. This ensures you can roll back if something goes wrong.
|
||||||
|
- **Check Release Notes**: Carefully review the [Frigate GitHub releases page](https://github.com/blakeblackshear/frigate/releases) for breaking changes or configuration updates that might affect your setup.
|
||||||
|
|
||||||
|
## Updating with Docker
|
||||||
|
|
||||||
|
If you’re running Frigate via Docker (recommended method), follow these steps:
|
||||||
|
|
||||||
|
1. **Stop the Container**:
|
||||||
|
|
||||||
|
- If using Docker Compose:
|
||||||
|
```bash
|
||||||
|
docker compose down frigate
|
||||||
|
```
|
||||||
|
- If using `docker run`:
|
||||||
|
```bash
|
||||||
|
docker stop frigate
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Update and Pull the Latest Image**:
|
||||||
|
|
||||||
|
- If using Docker Compose:
|
||||||
|
- Edit your `docker-compose.yml` file to specify the desired version tag (e.g., `0.15.0` instead of `0.14.1`). For example:
|
||||||
|
```yaml
|
||||||
|
services:
|
||||||
|
frigate:
|
||||||
|
image: ghcr.io/blakeblackshear/frigate:0.15.0
|
||||||
|
```
|
||||||
|
- Then pull the image:
|
||||||
|
```bash
|
||||||
|
docker pull ghcr.io/blakeblackshear/frigate:0.15.0
|
||||||
|
```
|
||||||
|
- **Note for `stable` Tag Users**: If your `docker-compose.yml` uses the `stable` tag (e.g., `ghcr.io/blakeblackshear/frigate:stable`), you don’t need to update the tag manually. The `stable` tag always points to the latest stable release after pulling.
|
||||||
|
- If using `docker run`:
|
||||||
|
- Pull the image with the appropriate tag (e.g., `0.15.0`, `0.15.0-tensorrt`, or `stable`):
|
||||||
|
```bash
|
||||||
|
docker pull ghcr.io/blakeblackshear/frigate:0.15.0
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Start the Container**:
|
||||||
|
|
||||||
|
- If using Docker Compose:
|
||||||
|
```bash
|
||||||
|
docker compose up -d
|
||||||
|
```
|
||||||
|
- If using `docker run`, re-run your original command (e.g., from the [Installation](./installation.md#docker) section) with the updated image tag.
|
||||||
|
|
||||||
|
4. **Verify the Update**:
|
||||||
|
- Check the container logs to ensure Frigate starts successfully:
|
||||||
|
```bash
|
||||||
|
docker logs frigate
|
||||||
|
```
|
||||||
|
- Visit the Frigate Web UI (default: `http://<your-ip>:5000`) to confirm the new version is running. The version number is displayed at the top of the System Metrics page.
|
||||||
|
|
||||||
|
### Notes
|
||||||
|
|
||||||
|
- If you’ve customized other settings (e.g., `shm-size`), ensure they’re still appropriate after the update.
|
||||||
|
- Docker will automatically use the updated image when you restart the container, as long as you pulled the correct version.
|
||||||
|
|
||||||
|
## Updating the Home Assistant Addon
|
||||||
|
|
||||||
|
For users running Frigate as a Home Assistant Addon:
|
||||||
|
|
||||||
|
1. **Check for Updates**:
|
||||||
|
|
||||||
|
- Navigate to **Settings > Add-ons** in Home Assistant.
|
||||||
|
- Find your installed Frigate addon (e.g., "Frigate NVR" or "Frigate NVR (Full Access)").
|
||||||
|
- If an update is available, you’ll see an "Update" button.
|
||||||
|
|
||||||
|
2. **Update the Addon**:
|
||||||
|
|
||||||
|
- Click the "Update" button next to the Frigate addon.
|
||||||
|
- Wait for the process to complete. Home Assistant will handle downloading and installing the new version.
|
||||||
|
|
||||||
|
3. **Restart the Addon**:
|
||||||
|
|
||||||
|
- After updating, go to the addon’s page and click "Restart" to apply the changes.
|
||||||
|
|
||||||
|
4. **Verify the Update**:
|
||||||
|
- Check the addon logs (under the "Log" tab) to ensure Frigate starts without errors.
|
||||||
|
- Access the Frigate Web UI to confirm the new version is running.
|
||||||
|
|
||||||
|
### Notes
|
||||||
|
|
||||||
|
- Ensure your `/config/frigate.yml` is compatible with the new version by reviewing the [Release notes](https://github.com/blakeblackshear/frigate/releases).
|
||||||
|
- If using custom hardware (e.g., Coral or GPU), verify that configurations still work, as addon updates don’t modify your hardware settings.
|
||||||
|
|
||||||
|
## Rolling Back
|
||||||
|
|
||||||
|
If an update causes issues:
|
||||||
|
|
||||||
|
1. Stop Frigate.
|
||||||
|
2. Restore your backed-up config file and database.
|
||||||
|
3. Revert to the previous image version:
|
||||||
|
- For Docker: Specify an older tag (e.g., `ghcr.io/blakeblackshear/frigate:0.14.1`) in your `docker run` command.
|
||||||
|
- For Docker Compose: Edit your `docker-compose.yml`, specify the older version tag (e.g., `ghcr.io/blakeblackshear/frigate:0.14.1`), and re-run `docker compose up -d`.
|
||||||
|
- For Home Assistant: Reinstall the previous addon version manually via the repository if needed and restart the addon.
|
||||||
|
4. Verify the old version is running again.
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
- **Container Fails to Start**: Check logs (`docker logs frigate`) for errors.
|
||||||
|
- **UI Not Loading**: Ensure ports (e.g., 5000, 8971) are still mapped correctly and the service is running.
|
||||||
|
- **Hardware Issues**: Revisit hardware-specific setup (e.g., Coral, GPU) if detection or decoding fails post-update.
|
||||||
|
|
||||||
|
Common questions are often answered in the [FAQ](https://github.com/blakeblackshear/frigate/discussions), pinned at the top of the support discussions.
|
||||||
@@ -35,6 +35,7 @@ There are many solutions available to implement reverse proxies and the communit
|
|||||||
* [Apache2](#apache2-reverse-proxy)
|
* [Apache2](#apache2-reverse-proxy)
|
||||||
* [Nginx](#nginx-reverse-proxy)
|
* [Nginx](#nginx-reverse-proxy)
|
||||||
* [Traefik](#traefik-reverse-proxy)
|
* [Traefik](#traefik-reverse-proxy)
|
||||||
|
* [Caddy](#caddy-reverse-proxy)
|
||||||
|
|
||||||
## Apache2 Reverse Proxy
|
## Apache2 Reverse Proxy
|
||||||
|
|
||||||
@@ -117,7 +118,8 @@ server {
|
|||||||
set $port 8971;
|
set $port 8971;
|
||||||
|
|
||||||
listen 80;
|
listen 80;
|
||||||
listen 443 ssl http2;
|
listen 443 ssl;
|
||||||
|
http2 on;
|
||||||
|
|
||||||
server_name frigate.domain.com;
|
server_name frigate.domain.com;
|
||||||
}
|
}
|
||||||
@@ -177,3 +179,33 @@ The above configuration will create a "service" in Traefik, automatically adding
|
|||||||
It will also add a router, routing requests to "traefik.example.com" to your local container.
|
It will also add a router, routing requests to "traefik.example.com" to your local container.
|
||||||
|
|
||||||
Note that with this approach, you don't need to expose any ports for the Frigate instance since all traffic will be routed over the internal Docker network.
|
Note that with this approach, you don't need to expose any ports for the Frigate instance since all traffic will be routed over the internal Docker network.
|
||||||
|
|
||||||
|
## Caddy Reverse Proxy
|
||||||
|
|
||||||
|
This example shows Frigate running under a subdomain with logging and a tls cert (in this case a wildcard domain cert obtained independently of caddy) handled via imports
|
||||||
|
|
||||||
|
```caddy
|
||||||
|
(logging) {
|
||||||
|
log {
|
||||||
|
output file /var/log/caddy/{args[0]}.log {
|
||||||
|
roll_size 10MiB
|
||||||
|
roll_keep 5
|
||||||
|
roll_keep_for 10d
|
||||||
|
}
|
||||||
|
format json
|
||||||
|
level INFO
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
(tls) {
|
||||||
|
tls /var/lib/caddy/wildcard.YOUR_DOMAIN.TLD.fullchain.pem /var/lib/caddy/wildcard.YOUR_DOMAIN.TLD.privkey.pem
|
||||||
|
}
|
||||||
|
|
||||||
|
frigate.YOUR_DOMAIN.TLD {
|
||||||
|
reverse_proxy http://localhost:8971
|
||||||
|
import tls
|
||||||
|
import logging frigate.YOUR_DOMAIN.TLD
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|||||||
@@ -110,6 +110,14 @@ If you run Frigate on a separate device within your local network, Home Assistan
|
|||||||
|
|
||||||
Use `http://<frigate_device_ip>:8971` as the URL for the integration so that authentication is required.
|
Use `http://<frigate_device_ip>:8971` as the URL for the integration so that authentication is required.
|
||||||
|
|
||||||
|
:::tip
|
||||||
|
|
||||||
|
The above URL assumes you have [disabled TLS](../configuration/tls).
|
||||||
|
By default, TLS is enabled and Frigate will be using a self-signed certificate. HomeAssistant will fail to connect HTTPS to port 8971 since it fails to verify the self-signed certificate.
|
||||||
|
Either disable TLS and use HTTP from HomeAssistant, or configure Frigate to be acessible with a valid certificate.
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
frigate:
|
frigate:
|
||||||
|
|||||||
@@ -28,7 +28,14 @@ Message published for each changed tracked object. The first message is publishe
|
|||||||
"id": "1607123955.475377-mxklsc",
|
"id": "1607123955.475377-mxklsc",
|
||||||
"camera": "front_door",
|
"camera": "front_door",
|
||||||
"frame_time": 1607123961.837752,
|
"frame_time": 1607123961.837752,
|
||||||
"snapshot_time": 1607123961.837752,
|
"snapshot": {
|
||||||
|
"frame_time": 1607123965.975463,
|
||||||
|
"box": [415, 489, 528, 700],
|
||||||
|
"area": 12728,
|
||||||
|
"region": [260, 446, 660, 846],
|
||||||
|
"score": 0.77546,
|
||||||
|
"attributes": [],
|
||||||
|
},
|
||||||
"label": "person",
|
"label": "person",
|
||||||
"sub_label": null,
|
"sub_label": null,
|
||||||
"top_score": 0.958984375,
|
"top_score": 0.958984375,
|
||||||
@@ -62,7 +69,14 @@ Message published for each changed tracked object. The first message is publishe
|
|||||||
"id": "1607123955.475377-mxklsc",
|
"id": "1607123955.475377-mxklsc",
|
||||||
"camera": "front_door",
|
"camera": "front_door",
|
||||||
"frame_time": 1607123962.082975,
|
"frame_time": 1607123962.082975,
|
||||||
"snapshot_time": 1607123961.837752,
|
"snapshot": {
|
||||||
|
"frame_time": 1607123965.975463,
|
||||||
|
"box": [415, 489, 528, 700],
|
||||||
|
"area": 12728,
|
||||||
|
"region": [260, 446, 660, 846],
|
||||||
|
"score": 0.77546,
|
||||||
|
"attributes": [],
|
||||||
|
},
|
||||||
"label": "person",
|
"label": "person",
|
||||||
"sub_label": ["John Smith", 0.79],
|
"sub_label": ["John Smith", 0.79],
|
||||||
"top_score": 0.958984375,
|
"top_score": 0.958984375,
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ Snapshots must be enabled to be able to submit examples to Frigate+
|
|||||||
|
|
||||||
### Annotate and verify
|
### Annotate and verify
|
||||||
|
|
||||||
You can view all of your submitted images at [https://plus.frigate.video](https://plus.frigate.video). Annotations can be added by clicking an image. For more detailed information about labeling, see the documentation on [improving your model](../plus/improving_model.md).
|
You can view all of your submitted images at [https://plus.frigate.video](https://plus.frigate.video). Annotations can be added by clicking an image. For more detailed information about labeling, see the documentation on [annotating](../plus/annotating.md).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,10 @@ Please use your own knowledge to assess and vet them before you install anything
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
## [Advanced Camera Card (formerly known as Frigate Card](https://card.camera/#/README)
|
||||||
|
|
||||||
|
The [Advanced Camera Card](https://card.camera/#/README) is a Home Assistant dashboard card with deep Frigate integration.
|
||||||
|
|
||||||
## [Double Take](https://github.com/skrashevich/double-take)
|
## [Double Take](https://github.com/skrashevich/double-take)
|
||||||
|
|
||||||
[Double Take](https://github.com/skrashevich/double-take) provides an unified UI and API for processing and training images for facial recognition.
|
[Double Take](https://github.com/skrashevich/double-take) provides an unified UI and API for processing and training images for facial recognition.
|
||||||
@@ -23,6 +27,14 @@ This is a fork (with fixed errors and new features) of [original Double Take](ht
|
|||||||
|
|
||||||
[Frigate Notify](https://github.com/0x2142/frigate-notify) is a simple app designed to send notifications from Frigate to your favorite platforms. Intended to be used with standalone Frigate installations - Home Assistant not required, MQTT is optional but recommended.
|
[Frigate Notify](https://github.com/0x2142/frigate-notify) is a simple app designed to send notifications from Frigate to your favorite platforms. Intended to be used with standalone Frigate installations - Home Assistant not required, MQTT is optional but recommended.
|
||||||
|
|
||||||
|
## [Frigate Snap-Sync](https://github.com/thequantumphysicist/frigate-snap-sync/)
|
||||||
|
|
||||||
|
[Frigate Snap-Sync](https://github.com/thequantumphysicist/frigate-snap-sync/) is a program that works in tandem with Frigate. It responds to Frigate when a snapshot or a review is made (and more can be added), and uploads them to one or more remote server(s) of your choice.
|
||||||
|
|
||||||
## [Frigate telegram](https://github.com/OldTyT/frigate-telegram)
|
## [Frigate telegram](https://github.com/OldTyT/frigate-telegram)
|
||||||
|
|
||||||
[Frigate telegram](https://github.com/OldTyT/frigate-telegram) makes it possible to send events from Frigate to Telegram. Events are sent as a message with a text description, video, and thumbnail.
|
[Frigate telegram](https://github.com/OldTyT/frigate-telegram) makes it possible to send events from Frigate to Telegram. Events are sent as a message with a text description, video, and thumbnail.
|
||||||
|
|
||||||
|
## [Periscope](https://github.com/maksz42/periscope)
|
||||||
|
|
||||||
|
[Periscope](https://github.com/maksz42/periscope) is a lightweight Android app that turns old devices into live viewers for Frigate. It works on Android 2.2 and above, including Android TV. It supports authentication and HTTPS.
|
||||||
|
|||||||
@@ -1,17 +1,9 @@
|
|||||||
---
|
---
|
||||||
id: improving_model
|
id: annotating
|
||||||
title: Improving your model
|
title: Annotating your images
|
||||||
---
|
---
|
||||||
|
|
||||||
You may find that Frigate+ models result in more false positives initially, but by submitting true and false positives, the model will improve. With all the new images now being submitted by subscribers, future base models will improve as more and more examples are incorporated. Note that only images with at least one verified label will be used when training your model. Submitting an image from Frigate as a true or false positive will not verify the image. You still must verify the image in Frigate+ in order for it to be used in training.
|
For the best results, follow these guidelines. You may also want to review the documentation on [improving your model](./index.md#improving-your-model).
|
||||||
|
|
||||||
- **Submit both true positives and false positives**. This will help the model differentiate between what is and isn't correct. You should aim for a target of 80% true positive submissions and 20% false positives across all of your images. If you are experiencing false positives in a specific area, submitting true positives for any object type near that area in similar lighting conditions will help teach the model what that area looks like when no objects are present.
|
|
||||||
- **Lower your thresholds a little in order to generate more false/true positives near the threshold value**. For example, if you have some false positives that are scoring at 68% and some true positives scoring at 72%, you can try lowering your threshold to 65% and submitting both true and false positives within that range. This will help the model learn and widen the gap between true and false positive scores.
|
|
||||||
- **Submit diverse images**. For the best results, you should provide at least 100 verified images per camera. Keep in mind that varying conditions should be included. You will want images from cloudy days, sunny days, dawn, dusk, and night. As circumstances change, you may need to submit new examples to address new types of false positives. For example, the change from summer days to snowy winter days or other changes such as a new grill or patio furniture may require additional examples and training.
|
|
||||||
|
|
||||||
## Properly labeling images
|
|
||||||
|
|
||||||
For the best results, follow the following guidelines.
|
|
||||||
|
|
||||||
**Label every object in the image**: It is important that you label all objects in each image before verifying. If you don't label a car for example, the model will be taught that part of the image is _not_ a car and it will start to get confused. You can exclude labels that you don't want detected on any of your cameras.
|
**Label every object in the image**: It is important that you label all objects in each image before verifying. If you don't label a car for example, the model will be taught that part of the image is _not_ a car and it will start to get confused. You can exclude labels that you don't want detected on any of your cameras.
|
||||||
|
|
||||||
@@ -25,9 +17,17 @@ For the best results, follow the following guidelines.
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
## AI suggested labels
|
||||||
|
|
||||||
|
If you have an active Frigate+ subscription, new uploads will be scanned for the objects configured for you camera and you will see suggested labels as light blue boxes when annotating in Frigate+. These suggestions are processed via a queue and typically complete within a minute after uploading, but processing times can be longer.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Suggestions are converted to labels when saving, so you should remove any errant suggestions. There is already some logic designed to avoid duplicate labels, but you may still occasionally see some duplicate suggestions. You should keep the most accurate bounding box and delete any duplicates so that you have just one label per object remaining.
|
||||||
|
|
||||||
## False positive labels
|
## False positive labels
|
||||||
|
|
||||||
False positives will be shown with a read box and the label will have a strike through.
|
False positives will be shown with a read box and the label will have a strike through. These can't be adjusted, but they can be deleted if you accidentally submit a true positive as a false positive from Frigate.
|
||||||

|

|
||||||
|
|
||||||
Misidentified objects should have a correct label added. For example, if a person was mistakenly detected as a cat, you should submit it as a false positive in Frigate and add a label for the person. The boxes will overlap.
|
Misidentified objects should have a correct label added. For example, if a person was mistakenly detected as a cat, you should submit it as a false positive in Frigate and add a label for the person. The boxes will overlap.
|
||||||
@@ -9,11 +9,11 @@ Before requesting your first model, you will need to upload and verify at least
|
|||||||
|
|
||||||
It is recommended to submit **both** true positives and false positives. This will help the model differentiate between what is and isn't correct. You should aim for a target of 80% true positive submissions and 20% false positives across all of your images. If you are experiencing false positives in a specific area, submitting true positives for any object type near that area in similar lighting conditions will help teach the model what that area looks like when no objects are present.
|
It is recommended to submit **both** true positives and false positives. This will help the model differentiate between what is and isn't correct. You should aim for a target of 80% true positive submissions and 20% false positives across all of your images. If you are experiencing false positives in a specific area, submitting true positives for any object type near that area in similar lighting conditions will help teach the model what that area looks like when no objects are present.
|
||||||
|
|
||||||
For more detailed recommendations, you can refer to the docs on [improving your model](./improving_model.md).
|
For more detailed recommendations, you can refer to the docs on [annotating](./annotating.md).
|
||||||
|
|
||||||
## Step 2: Submit a model request
|
## Step 2: Submit a model request
|
||||||
|
|
||||||
Once you have an initial set of verified images, you can request a model on the Models page. For guidance on choosing a model type, refer to [this part of the documentation](./index.md#available-model-types). Each model request requires 1 of the 12 trainings that you receive with your annual subscription. This model will support all [label types available](./index.md#available-label-types) even if you do not submit any examples for those labels. Model creation can take up to 36 hours.
|
Once you have an initial set of verified images, you can request a model on the Models page. For guidance on choosing a model type, refer to [this part of the documentation](./index.md#available-model-types). If you are unsure which type to request, you can test the base model for each version from the "Base Models" tab. Each model request requires 1 of the 12 trainings that you receive with your annual subscription. This model will support all [label types available](./index.md#available-label-types) even if you do not submit any examples for those labels. Model creation can take up to 36 hours.
|
||||||

|

|
||||||
|
|
||||||
## Step 3: Set your model id in the config
|
## Step 3: Set your model id in the config
|
||||||
|
|||||||
+29
-17
@@ -3,15 +3,9 @@ id: index
|
|||||||
title: Models
|
title: Models
|
||||||
---
|
---
|
||||||
|
|
||||||
<a href="https://frigate.video/plus" target="_blank" rel="nofollow">Frigate+</a> offers models trained on images submitted by Frigate+ users from their security cameras and is specifically designed for the way Frigate analyzes video footage. These models offer higher accuracy with less resources. The images you upload are used to fine tune a baseline model trained from images uploaded by all Frigate+ users. This fine tuning process results in a model that is optimized for accuracy in your specific conditions.
|
<a href="https://frigate.video/plus" target="_blank" rel="nofollow">Frigate+</a> offers models trained on images submitted by Frigate+ users from their security cameras and is specifically designed for the way Frigate NVR analyzes video footage. These models offer higher accuracy with less resources. The images you upload are used to fine tune a base model trained from images uploaded by all Frigate+ users. This fine tuning process results in a model that is optimized for accuracy in your specific conditions.
|
||||||
|
|
||||||
:::info
|
With a subscription, 12 model trainings to fine tune your model per year are included. In addition, you will have access to any base models published while your subscription is active. If you cancel your subscription, you will retain access to any trained and base models in your account. An active subscription is required to submit model requests or purchase additional trainings. New base models are published quarterly with target dates of January 15th, April 15th, July 15th, and October 15th.
|
||||||
|
|
||||||
The baseline model isn't directly available after subscribing. This may change in the future, but for now you will need to submit a model request with the minimum number of images.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
With a subscription, 12 model trainings per year are included. If you cancel your subscription, you will retain access to any trained models. An active subscription is required to submit model requests or purchase additional trainings.
|
|
||||||
|
|
||||||
Information on how to integrate Frigate+ with Frigate can be found in the [integration docs](../integrations/plus.md).
|
Information on how to integrate Frigate+ with Frigate can be found in the [integration docs](../integrations/plus.md).
|
||||||
|
|
||||||
@@ -19,7 +13,7 @@ Information on how to integrate Frigate+ with Frigate can be found in the [integ
|
|||||||
|
|
||||||
There are two model types offered in Frigate+, `mobiledet` and `yolonas`. Both of these models are object detection models and are trained to detect the same set of labels [listed below](#available-label-types).
|
There are two model types offered in Frigate+, `mobiledet` and `yolonas`. Both of these models are object detection models and are trained to detect the same set of labels [listed below](#available-label-types).
|
||||||
|
|
||||||
Not all model types are supported by all detectors, so it's important to choose a model type to match your detector as shown in the table under [supported detector types](#supported-detector-types).
|
Not all model types are supported by all detectors, so it's important to choose a model type to match your detector as shown in the table under [supported detector types](#supported-detector-types). You can test model types for compatibility and speed on your hardware by using the base models.
|
||||||
|
|
||||||
| Model Type | Description |
|
| Model Type | Description |
|
||||||
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
@@ -36,19 +30,27 @@ Using Frigate+ models with `onnx` is only available with Frigate 0.15 and later.
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
| Hardware | Recommended Detector Type | Recommended Model Type |
|
| Hardware | Recommended Detector Type | Recommended Model Type |
|
||||||
| ---------------------------------------------------------------------------------------------------------------------------- | ------------------------- | ---------------------- |
|
| -------------------------------------------------------------------------------- | ------------------------- | ---------------------- |
|
||||||
| [CPU](/configuration/object_detectors.md#cpu-detector-not-recommended) | `cpu` | `mobiledet` |
|
| [CPU](/configuration/object_detectors.md#cpu-detector-not-recommended) | `cpu` | `mobiledet` |
|
||||||
| [Coral (all form factors)](/configuration/object_detectors.md#edge-tpu-detector) | `edgetpu` | `mobiledet` |
|
| [Coral (all form factors)](/configuration/object_detectors.md#edge-tpu-detector) | `edgetpu` | `mobiledet` |
|
||||||
| [Intel](/configuration/object_detectors.md#openvino-detector) | `openvino` | `yolonas` |
|
| [Intel](/configuration/object_detectors.md#openvino-detector) | `openvino` | `yolonas` |
|
||||||
| [NVidia GPU](https://deploy-preview-13787--frigate-docs.netlify.app/configuration/object_detectors#onnx)\* | `onnx` | `yolonas` |
|
| [NVidia GPU](/configuration/object_detectors#onnx)\* | `onnx` | `yolonas` |
|
||||||
| [AMD ROCm GPU](https://deploy-preview-13787--frigate-docs.netlify.app/configuration/object_detectors#amdrocm-gpu-detector)\* | `onnx` | `yolonas` |
|
| [AMD ROCm GPU](/configuration/object_detectors#amdrocm-gpu-detector)\* | `rocm` | `yolonas` |
|
||||||
|
|
||||||
_\* Requires Frigate 0.15_
|
_\* Requires Frigate 0.15_
|
||||||
|
|
||||||
|
## Improving your model
|
||||||
|
|
||||||
|
Some users may find that Frigate+ models result in more false positives initially, but by submitting true and false positives, the model will improve. With all the new images now being submitted by subscribers, future base models will improve as more and more examples are incorporated. Note that only images with at least one verified label will be used when training your model. Submitting an image from Frigate as a true or false positive will not verify the image. You still must verify the image in Frigate+ in order for it to be used in training.
|
||||||
|
|
||||||
|
- **Submit both true positives and false positives**. This will help the model differentiate between what is and isn't correct. You should aim for a target of 80% true positive submissions and 20% false positives across all of your images. If you are experiencing false positives in a specific area, submitting true positives for any object type near that area in similar lighting conditions will help teach the model what that area looks like when no objects are present.
|
||||||
|
- **Lower your thresholds a little in order to generate more false/true positives near the threshold value**. For example, if you have some false positives that are scoring at 68% and some true positives scoring at 72%, you can try lowering your threshold to 65% and submitting both true and false positives within that range. This will help the model learn and widen the gap between true and false positive scores.
|
||||||
|
- **Submit diverse images**. For the best results, you should provide at least 100 verified images per camera. Keep in mind that varying conditions should be included. You will want images from cloudy days, sunny days, dawn, dusk, and night. As circumstances change, you may need to submit new examples to address new types of false positives. For example, the change from summer days to snowy winter days or other changes such as a new grill or patio furniture may require additional examples and training.
|
||||||
|
|
||||||
## Available label types
|
## Available label types
|
||||||
|
|
||||||
Frigate+ models support a more relevant set of objects for security cameras. Currently, the following objects are supported:
|
Frigate+ models support a more relevant set of objects for security cameras. The labels for annotation in Frigate+ are configurable by editing the camera in the Cameras section of Frigate+. Currently, the following objects are supported:
|
||||||
|
|
||||||
- **People**: `person`, `face`
|
- **People**: `person`, `face`
|
||||||
- **Vehicles**: `car`, `motorcycle`, `bicycle`, `boat`, `license_plate`
|
- **Vehicles**: `car`, `motorcycle`, `bicycle`, `boat`, `license_plate`
|
||||||
@@ -58,6 +60,16 @@ Frigate+ models support a more relevant set of objects for security cameras. Cur
|
|||||||
|
|
||||||
Other object types available in the default Frigate model are not available. Additional object types will be added in future releases.
|
Other object types available in the default Frigate model are not available. Additional object types will be added in future releases.
|
||||||
|
|
||||||
|
### Candidate labels
|
||||||
|
|
||||||
|
Candidate labels are also available for annotation. These labels don't have enough data to be included in the model yet, but using them will help add support sooner. You can enable these labels by editing the camera settings.
|
||||||
|
|
||||||
|
Where possible, these labels are mapped to existing labels during training. For example, any `baby` labels are mapped to `person` until support for new labels is added.
|
||||||
|
|
||||||
|
The candidate labels are: `baby`, `royal mail`, `canada post`, `bpost`, `skunk`, `badger`, `possum`, `rodent`, `kangaroo`, `chicken`, `groundhog`, `boar`, `hedgehog`, `school bus`, `tractor`, `golf cart`, `garbage truck`, `bus`, `sports ball`
|
||||||
|
|
||||||
|
Candidate labels are not available for automatic suggestions.
|
||||||
|
|
||||||
### Label attributes
|
### Label attributes
|
||||||
|
|
||||||
Frigate has special handling for some labels when using Frigate+ models. `face`, `license_plate`, and delivery logos such as `amazon`, `ups`, and `fedex` are considered attribute labels which are not tracked like regular objects and do not generate review items directly. In addition, the `threshold` filter will have no effect on these labels. You should adjust the `min_score` and other filter values as needed.
|
Frigate has special handling for some labels when using Frigate+ models. `face`, `license_plate`, and delivery logos such as `amazon`, `ups`, and `fedex` are considered attribute labels which are not tracked like regular objects and do not generate review items directly. In addition, the `threshold` filter will have no effect on these labels. You should adjust the `min_score` and other filter values as needed.
|
||||||
|
|||||||
@@ -46,6 +46,17 @@ Some users have reported that this older device runs an older kernel causing iss
|
|||||||
6. Open the control panel - info scree. The coral TPU will now be recognised as a USB Device - google inc
|
6. Open the control panel - info scree. The coral TPU will now be recognised as a USB Device - google inc
|
||||||
7. Start the frigate container. Everything should work now!
|
7. Start the frigate container. Everything should work now!
|
||||||
|
|
||||||
|
### QNAP NAS
|
||||||
|
|
||||||
|
QNAP NAS devices, such as the TS-253A, may use connected Coral TPU devices if [QuMagie](https://www.qnap.com/en/software/qumagie) is installed along with its QNAP AI Core extension. If any of the features—`facial recognition`, `object recognition`, or `similar photo recognition`—are enabled, Container Station applications such as `Frigate` or `CodeProject.AI Server` will be unable to initialize the TPU device in use.
|
||||||
|
To allow the Coral TPU device to be discovered, the you must either:
|
||||||
|
|
||||||
|
1. [Disable the AI recognition features in QuMagie](https://docs.qnap.com/application/qumagie/2.x/en-us/configuring-qnap-ai-core-settings-FB13CE03.html),
|
||||||
|
2. Remove the QNAP AI Core extension or
|
||||||
|
3. Manually start the QNAP AI Core extension after Frigate has fully started (not recommended).
|
||||||
|
|
||||||
|
It is also recommended to restart the NAS once the changes have been made.
|
||||||
|
|
||||||
## USB Coral Detection Appears to be Stuck
|
## USB Coral Detection Appears to be Stuck
|
||||||
|
|
||||||
The USB Coral can become stuck and need to be restarted, this can happen for a number of reasons depending on hardware and software setup. Some common reasons are:
|
The USB Coral can become stuck and need to be restarted, this can happen for a number of reasons depending on hardware and software setup. Some common reasons are:
|
||||||
@@ -55,10 +66,10 @@ The USB Coral can become stuck and need to be restarted, this can happen for a n
|
|||||||
|
|
||||||
## PCIe Coral Not Detected
|
## PCIe Coral Not Detected
|
||||||
|
|
||||||
The most common reason for the PCIe Coral not being detected is that the driver has not been installed. This process varies based on what OS and kernel that is being run.
|
The most common reason for the PCIe Coral not being detected is that the driver has not been installed. This process varies based on what OS and kernel that is being run.
|
||||||
|
|
||||||
- In most cases [the Coral docs](https://coral.ai/docs/m2/get-started/#2-install-the-pcie-driver-and-edge-tpu-runtime) show how to install the driver for the PCIe based Coral.
|
- In most cases [the Coral docs](https://coral.ai/docs/m2/get-started/#2-install-the-pcie-driver-and-edge-tpu-runtime) show how to install the driver for the PCIe based Coral.
|
||||||
- For Ubuntu 22.04+ https://github.com/jnicolson/gasket-builder can be used to build and install the latest version of the driver.
|
- For some newer Linux distros (for example, Ubuntu 22.04+), https://github.com/jnicolson/gasket-builder can be used to build and install the latest version of the driver.
|
||||||
|
|
||||||
## Attempting to load TPU as pci & Fatal Python error: Illegal instruction
|
## Attempting to load TPU as pci & Fatal Python error: Illegal instruction
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
id: gpu
|
||||||
|
title: Troubleshooting GPU
|
||||||
|
---
|
||||||
|
|
||||||
|
## OpenVINO
|
||||||
|
|
||||||
|
### Can't get OPTIMIZATION_CAPABILITIES property as no supported devices found.
|
||||||
|
|
||||||
|
Some users have reported issues using some Intel iGPUs with OpenVINO, where the GPU would not be detected. This error can be caused by various problems, so it is important to ensure the configuration is setup correctly. Some solutions users have noted:
|
||||||
|
|
||||||
|
- In some cases users have noted that an HDMI dummy plug was necessary to be plugged into the motherboard's HDMI port.
|
||||||
|
- When mixing an Intel iGPU with Nvidia GPU, the devices can be mixed up between `/dev/dri/renderD128` and `/dev/dri/renderD129` so it is important to confirm the correct device, or map the entire `/dev/dri` directory into the Frigate container.
|
||||||
+112
-66
@@ -1,19 +1,24 @@
|
|||||||
import type * as Preset from '@docusaurus/preset-classic';
|
import type * as Preset from "@docusaurus/preset-classic";
|
||||||
import * as path from 'node:path';
|
import * as path from "node:path";
|
||||||
import type { Config, PluginConfig } from '@docusaurus/types';
|
import type { Config, PluginConfig } from "@docusaurus/types";
|
||||||
import type * as OpenApiPlugin from 'docusaurus-plugin-openapi-docs';
|
import type * as OpenApiPlugin from "docusaurus-plugin-openapi-docs";
|
||||||
|
|
||||||
const config: Config = {
|
const config: Config = {
|
||||||
title: 'Frigate',
|
title: "Frigate",
|
||||||
tagline: 'NVR With Realtime Object Detection for IP Cameras',
|
tagline: "NVR With Realtime Object Detection for IP Cameras",
|
||||||
url: 'https://docs.frigate.video',
|
url: "https://docs.frigate.video",
|
||||||
baseUrl: '/',
|
baseUrl: "/",
|
||||||
onBrokenLinks: 'throw',
|
onBrokenLinks: "throw",
|
||||||
onBrokenMarkdownLinks: 'warn',
|
onBrokenMarkdownLinks: "warn",
|
||||||
favicon: 'img/favicon.ico',
|
favicon: "img/favicon.ico",
|
||||||
organizationName: 'blakeblackshear',
|
organizationName: "blakeblackshear",
|
||||||
projectName: 'frigate',
|
projectName: "frigate",
|
||||||
themes: ['@docusaurus/theme-mermaid', 'docusaurus-theme-openapi-docs'],
|
themes: [
|
||||||
|
"@docusaurus/theme-mermaid",
|
||||||
|
"docusaurus-theme-openapi-docs",
|
||||||
|
"@inkeep/docusaurus/chatButton",
|
||||||
|
"@inkeep/docusaurus/searchBar",
|
||||||
|
],
|
||||||
markdown: {
|
markdown: {
|
||||||
mermaid: true,
|
mermaid: true,
|
||||||
},
|
},
|
||||||
@@ -27,39 +32,79 @@ const config: Config = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
themeConfig: {
|
themeConfig: {
|
||||||
algolia: {
|
announcementBar: {
|
||||||
appId: 'WIURGBNBPY',
|
id: 'frigate_plus',
|
||||||
apiKey: 'd02cc0a6a61178b25da550212925226b',
|
content: `
|
||||||
indexName: 'frigate',
|
<span style="margin-right: 8px; display: inline-block; animation: pulse 2s infinite;">🚀</span>
|
||||||
|
Get more relevant and accurate detections with Frigate+ models.
|
||||||
|
<a style="margin-left: 12px; padding: 3px 10px; background: #94d2bd; color: #001219; text-decoration: none; border-radius: 4px; font-weight: 500; " target="_blank" rel="noopener noreferrer" href="https://frigate.video/plus/">Learn more</a>
|
||||||
|
<span style="margin-left: 8px; display: inline-block; animation: pulse 2s infinite;">✨</span>
|
||||||
|
<style>
|
||||||
|
@keyframes pulse {
|
||||||
|
0%, 100% { transform: scale(1); }
|
||||||
|
50% { transform: scale(1.1); }
|
||||||
|
}
|
||||||
|
</style>`,
|
||||||
|
backgroundColor: '#005f73',
|
||||||
|
textColor: '#e0fbfc',
|
||||||
|
isCloseable: false,
|
||||||
},
|
},
|
||||||
docs: {
|
docs: {
|
||||||
sidebar: {
|
sidebar: {
|
||||||
hideable: true,
|
hideable: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
inkeepConfig: {
|
||||||
|
baseSettings: {
|
||||||
|
apiKey: "b1a4c4d73c9b48aa5b3cdae6e4c81f0bb3d1134eeb5a7100",
|
||||||
|
integrationId: "cm6xmhn9h000gs601495fkkdx",
|
||||||
|
organizationId: "org_map2JQEOco8U1ZYY",
|
||||||
|
primaryBrandColor: "#010101",
|
||||||
|
},
|
||||||
|
aiChatSettings: {
|
||||||
|
chatSubjectName: "Frigate",
|
||||||
|
botAvatarSrcUrl: "https://frigate.video/images/favicon.png",
|
||||||
|
getHelpCallToActions: [
|
||||||
|
{
|
||||||
|
name: "GitHub",
|
||||||
|
url: "https://github.com/blakeblackshear/frigate",
|
||||||
|
icon: {
|
||||||
|
builtIn: "FaGithub",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
quickQuestions: [
|
||||||
|
"How to configure and setup camera settings?",
|
||||||
|
"How to setup notifications?",
|
||||||
|
"Supported builtin detectors?",
|
||||||
|
"How to restream video feed?",
|
||||||
|
"How can I get sound or audio in my recordings?",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
prism: {
|
prism: {
|
||||||
additionalLanguages: ['bash', 'json'],
|
additionalLanguages: ["bash", "json"],
|
||||||
},
|
},
|
||||||
languageTabs: [
|
languageTabs: [
|
||||||
{
|
{
|
||||||
highlight: 'python',
|
highlight: "python",
|
||||||
language: 'python',
|
language: "python",
|
||||||
logoClass: 'python',
|
logoClass: "python",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
highlight: 'javascript',
|
highlight: "javascript",
|
||||||
language: 'nodejs',
|
language: "nodejs",
|
||||||
logoClass: 'nodejs',
|
logoClass: "nodejs",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
highlight: 'javascript',
|
highlight: "javascript",
|
||||||
language: 'javascript',
|
language: "javascript",
|
||||||
logoClass: 'javascript',
|
logoClass: "javascript",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
highlight: 'bash',
|
highlight: "bash",
|
||||||
language: 'curl',
|
language: "curl",
|
||||||
logoClass: 'curl',
|
logoClass: "curl",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
highlight: "rust",
|
highlight: "rust",
|
||||||
@@ -68,28 +113,28 @@ const config: Config = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
navbar: {
|
navbar: {
|
||||||
title: 'Frigate',
|
title: "Frigate",
|
||||||
logo: {
|
logo: {
|
||||||
alt: 'Frigate',
|
alt: "Frigate",
|
||||||
src: 'img/logo.svg',
|
src: "img/logo.svg",
|
||||||
srcDark: 'img/logo-dark.svg',
|
srcDark: "img/logo-dark.svg",
|
||||||
},
|
},
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
to: '/',
|
to: "/",
|
||||||
activeBasePath: 'docs',
|
activeBasePath: "docs",
|
||||||
label: 'Docs',
|
label: "Docs",
|
||||||
position: 'left',
|
position: "left",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
href: 'https://frigate.video',
|
href: "https://frigate.video",
|
||||||
label: 'Website',
|
label: "Website",
|
||||||
position: 'right',
|
position: "right",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
href: 'http://demo.frigate.video',
|
href: "http://demo.frigate.video",
|
||||||
label: 'Demo',
|
label: "Demo",
|
||||||
position: 'right',
|
position: "right",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'localeDropdown',
|
type: 'localeDropdown',
|
||||||
@@ -109,18 +154,18 @@ const config: Config = {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
style: 'dark',
|
style: "dark",
|
||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
title: 'Community',
|
title: "Community",
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
label: 'GitHub',
|
label: "GitHub",
|
||||||
href: 'https://github.com/blakeblackshear/frigate',
|
href: "https://github.com/blakeblackshear/frigate",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Discussions',
|
label: "Discussions",
|
||||||
href: 'https://github.com/blakeblackshear/frigate/discussions',
|
href: "https://github.com/blakeblackshear/frigate/discussions",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -129,19 +174,19 @@ const config: Config = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
path.resolve(__dirname, 'plugins', 'raw-loader'),
|
path.resolve(__dirname, "plugins", "raw-loader"),
|
||||||
[
|
[
|
||||||
'docusaurus-plugin-openapi-docs',
|
"docusaurus-plugin-openapi-docs",
|
||||||
{
|
{
|
||||||
id: 'openapi',
|
id: "openapi",
|
||||||
docsPluginId: 'classic', // configured for preset-classic
|
docsPluginId: "classic", // configured for preset-classic
|
||||||
config: {
|
config: {
|
||||||
frigateApi: {
|
frigateApi: {
|
||||||
specPath: 'static/frigate-api.yaml',
|
specPath: "static/frigate-api.yaml",
|
||||||
outputDir: 'docs/integrations/api',
|
outputDir: "docs/integrations/api",
|
||||||
sidebarOptions: {
|
sidebarOptions: {
|
||||||
groupPathsBy: 'tag',
|
groupPathsBy: "tag",
|
||||||
categoryLinkSource: 'tag',
|
categoryLinkSource: "tag",
|
||||||
sidebarCollapsible: true,
|
sidebarCollapsible: true,
|
||||||
sidebarCollapsed: true,
|
sidebarCollapsed: true,
|
||||||
},
|
},
|
||||||
@@ -149,23 +194,24 @@ const config: Config = {
|
|||||||
} satisfies OpenApiPlugin.Options,
|
} satisfies OpenApiPlugin.Options,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
] as PluginConfig[],
|
] as PluginConfig[],
|
||||||
presets: [
|
presets: [
|
||||||
[
|
[
|
||||||
'classic',
|
"classic",
|
||||||
{
|
{
|
||||||
docs: {
|
docs: {
|
||||||
routeBasePath: '/',
|
routeBasePath: "/",
|
||||||
sidebarPath: './sidebars.ts',
|
sidebarPath: "./sidebars.ts",
|
||||||
// Please change this to your repo.
|
// Please change this to your repo.
|
||||||
editUrl: 'https://github.com/blakeblackshear/frigate/edit/master/docs/',
|
editUrl:
|
||||||
|
"https://github.com/blakeblackshear/frigate/edit/master/docs/",
|
||||||
sidebarCollapsible: false,
|
sidebarCollapsible: false,
|
||||||
docItemComponent: '@theme/ApiItem', // Derived from docusaurus-theme-openapi
|
docItemComponent: "@theme/ApiItem", // Derived from docusaurus-theme-openapi
|
||||||
},
|
},
|
||||||
|
|
||||||
theme: {
|
theme: {
|
||||||
customCss: './src/css/custom.css',
|
customCss: "./src/css/custom.css",
|
||||||
},
|
},
|
||||||
} satisfies Preset.Options,
|
} satisfies Preset.Options,
|
||||||
],
|
],
|
||||||
|
|||||||
Generated
+7
@@ -12,6 +12,7 @@
|
|||||||
"@docusaurus/plugin-content-docs": "^3.6.3",
|
"@docusaurus/plugin-content-docs": "^3.6.3",
|
||||||
"@docusaurus/preset-classic": "^3.7.0",
|
"@docusaurus/preset-classic": "^3.7.0",
|
||||||
"@docusaurus/theme-mermaid": "^3.6.3",
|
"@docusaurus/theme-mermaid": "^3.6.3",
|
||||||
|
"@inkeep/docusaurus": "^2.0.16",
|
||||||
"@mdx-js/react": "^3.1.0",
|
"@mdx-js/react": "^3.1.0",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"docusaurus-plugin-openapi-docs": "^4.3.1",
|
"docusaurus-plugin-openapi-docs": "^4.3.1",
|
||||||
@@ -3954,6 +3955,12 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@inkeep/docusaurus": {
|
||||||
|
"version": "2.0.16",
|
||||||
|
"resolved": "https://registry.npmjs.org/@inkeep/docusaurus/-/docusaurus-2.0.16.tgz",
|
||||||
|
"integrity": "sha512-dQhjlvFnl3CVr0gWeJ/V/qLnDy1XYrCfkdVSa2D3gJTxI9/vOf9639Y1aPxTxO88DiXuW9CertLrZLB6SoJ2yg==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/@isaacs/cliui": {
|
"node_modules/@isaacs/cliui": {
|
||||||
"version": "8.0.2",
|
"version": "8.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
"@docusaurus/plugin-content-docs": "^3.6.3",
|
"@docusaurus/plugin-content-docs": "^3.6.3",
|
||||||
"@docusaurus/preset-classic": "^3.7.0",
|
"@docusaurus/preset-classic": "^3.7.0",
|
||||||
"@docusaurus/theme-mermaid": "^3.6.3",
|
"@docusaurus/theme-mermaid": "^3.6.3",
|
||||||
|
"@inkeep/docusaurus": "^2.0.16",
|
||||||
"@mdx-js/react": "^3.1.0",
|
"@mdx-js/react": "^3.1.0",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"docusaurus-plugin-openapi-docs": "^4.3.1",
|
"docusaurus-plugin-openapi-docs": "^4.3.1",
|
||||||
|
|||||||
+13
-11
@@ -5,12 +5,13 @@ import frigateHttpApiSidebar from "./docs/integrations/api/sidebar";
|
|||||||
const sidebars: SidebarsConfig = {
|
const sidebars: SidebarsConfig = {
|
||||||
docs: {
|
docs: {
|
||||||
Frigate: [
|
Frigate: [
|
||||||
"frigate/index",
|
'frigate/index',
|
||||||
"frigate/hardware",
|
'frigate/hardware',
|
||||||
"frigate/installation",
|
'frigate/installation',
|
||||||
"frigate/camera_setup",
|
'frigate/updating',
|
||||||
"frigate/video_pipeline",
|
'frigate/camera_setup',
|
||||||
"frigate/glossary",
|
'frigate/video_pipeline',
|
||||||
|
'frigate/glossary',
|
||||||
],
|
],
|
||||||
Guides: [
|
Guides: [
|
||||||
"guides/getting_started",
|
"guides/getting_started",
|
||||||
@@ -91,15 +92,16 @@ const sidebars: SidebarsConfig = {
|
|||||||
"configuration/metrics",
|
"configuration/metrics",
|
||||||
"integrations/third_party_extensions",
|
"integrations/third_party_extensions",
|
||||||
],
|
],
|
||||||
"Frigate+": [
|
'Frigate+': [
|
||||||
"plus/index",
|
'plus/index',
|
||||||
"plus/first_model",
|
'plus/annotating',
|
||||||
"plus/improving_model",
|
'plus/first_model',
|
||||||
"plus/faq",
|
'plus/faq',
|
||||||
],
|
],
|
||||||
Troubleshooting: [
|
Troubleshooting: [
|
||||||
"troubleshooting/faqs",
|
"troubleshooting/faqs",
|
||||||
"troubleshooting/recordings",
|
"troubleshooting/recordings",
|
||||||
|
"troubleshooting/gpu",
|
||||||
"troubleshooting/edgetpu",
|
"troubleshooting/edgetpu",
|
||||||
],
|
],
|
||||||
Development: [
|
Development: [
|
||||||
|
|||||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 71 KiB |
+18
-9
@@ -33,6 +33,7 @@ from frigate.models import User
|
|||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
router = APIRouter(tags=[Tags.auth])
|
router = APIRouter(tags=[Tags.auth])
|
||||||
|
VALID_ROLES = ["admin", "viewer"]
|
||||||
|
|
||||||
|
|
||||||
class RateLimiter:
|
class RateLimiter:
|
||||||
@@ -202,9 +203,15 @@ async def get_current_user(request: Request):
|
|||||||
|
|
||||||
def require_role(required_roles: List[str]):
|
def require_role(required_roles: List[str]):
|
||||||
async def role_checker(request: Request):
|
async def role_checker(request: Request):
|
||||||
|
proxy_config: ProxyConfig = request.app.frigate_config.proxy
|
||||||
|
|
||||||
# Get role from header (could be comma-separated)
|
# Get role from header (could be comma-separated)
|
||||||
role_header = request.headers.get("remote-role")
|
role_header = request.headers.get("remote-role")
|
||||||
roles = [r.strip() for r in role_header.split(",")] if role_header else []
|
roles = (
|
||||||
|
[r.strip() for r in role_header.split(proxy_config.separator)]
|
||||||
|
if role_header
|
||||||
|
else []
|
||||||
|
)
|
||||||
|
|
||||||
# Check if we have any roles
|
# Check if we have any roles
|
||||||
if not roles:
|
if not roles:
|
||||||
@@ -266,11 +273,13 @@ def auth(request: Request):
|
|||||||
else proxy_config.default_role
|
else proxy_config.default_role
|
||||||
)
|
)
|
||||||
|
|
||||||
# if comma-separated with "admin", use "admin", else use default role
|
# if comma-separated with "admin", use "admin",
|
||||||
success_response.headers["remote-role"] = (
|
# if comma-separated with "viewer", use "viewer",
|
||||||
"admin"
|
# else use default role
|
||||||
if role and "admin" in [r.strip() for r in role.split(",")]
|
|
||||||
else proxy_config.default_role
|
roles = [r.strip() for r in role.split(proxy_config.separator)] if role else []
|
||||||
|
success_response.headers["remote-role"] = next(
|
||||||
|
(r for r in VALID_ROLES if r in roles), proxy_config.default_role
|
||||||
)
|
)
|
||||||
|
|
||||||
return success_response
|
return success_response
|
||||||
@@ -395,7 +404,7 @@ def login(request: Request, body: AppPostLoginBody):
|
|||||||
password_hash = db_user.password_hash
|
password_hash = db_user.password_hash
|
||||||
if verify_password(password, password_hash):
|
if verify_password(password, password_hash):
|
||||||
role = getattr(db_user, "role", "viewer")
|
role = getattr(db_user, "role", "viewer")
|
||||||
if role not in ["admin", "viewer"]:
|
if role not in VALID_ROLES:
|
||||||
role = "viewer" # Enforce valid roles
|
role = "viewer" # Enforce valid roles
|
||||||
expiration = int(time.time()) + JWT_SESSION_LENGTH
|
expiration = int(time.time()) + JWT_SESSION_LENGTH
|
||||||
encoded_jwt = create_encoded_jwt(user, role, expiration, request.app.jwt_token)
|
encoded_jwt = create_encoded_jwt(user, role, expiration, request.app.jwt_token)
|
||||||
@@ -425,7 +434,7 @@ def create_user(
|
|||||||
if not re.match("^[A-Za-z0-9._]+$", body.username):
|
if not re.match("^[A-Za-z0-9._]+$", body.username):
|
||||||
return JSONResponse(content={"message": "Invalid username"}, status_code=400)
|
return JSONResponse(content={"message": "Invalid username"}, status_code=400)
|
||||||
|
|
||||||
role = body.role if body.role in ["admin", "viewer"] else "viewer"
|
role = body.role if body.role in VALID_ROLES else "viewer"
|
||||||
password_hash = hash_password(body.password, iterations=HASH_ITERATIONS)
|
password_hash = hash_password(body.password, iterations=HASH_ITERATIONS)
|
||||||
User.insert(
|
User.insert(
|
||||||
{
|
{
|
||||||
@@ -496,7 +505,7 @@ async def update_role(
|
|||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
content={"message": "Cannot modify admin user's role"}, status_code=403
|
content={"message": "Cannot modify admin user's role"}, status_code=403
|
||||||
)
|
)
|
||||||
if body.role not in ["admin", "viewer"]:
|
if body.role not in VALID_ROLES:
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
content={"message": "Role must be 'admin' or 'viewer'"}, status_code=400
|
content={"message": "Role must be 'admin' or 'viewer'"}, status_code=400
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -154,7 +154,25 @@ def train_face(request: Request, name: str, body: dict = None):
|
|||||||
x2 = x1 + int(face_box[2] * detect_config.width) - 4
|
x2 = x1 + int(face_box[2] * detect_config.width) - 4
|
||||||
y2 = y1 + int(face_box[3] * detect_config.height) - 4
|
y2 = y1 + int(face_box[3] * detect_config.height) - 4
|
||||||
face = snapshot[y1:y2, x1:x2]
|
face = snapshot[y1:y2, x1:x2]
|
||||||
cv2.imwrite(os.path.join(new_file_folder, new_name), face)
|
success = True
|
||||||
|
|
||||||
|
if face.size > 0:
|
||||||
|
try:
|
||||||
|
cv2.imwrite(os.path.join(new_file_folder, new_name), face)
|
||||||
|
success = True
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
if not success:
|
||||||
|
return JSONResponse(
|
||||||
|
content=(
|
||||||
|
{
|
||||||
|
"success": False,
|
||||||
|
"message": "Invalid face box or no face exists",
|
||||||
|
}
|
||||||
|
),
|
||||||
|
status_code=404,
|
||||||
|
)
|
||||||
|
|
||||||
context: EmbeddingsContext = request.app.embeddings
|
context: EmbeddingsContext = request.app.embeddings
|
||||||
context.clear_face_classifier()
|
context.clear_face_classifier()
|
||||||
|
|||||||
+34
-10
@@ -593,9 +593,11 @@ def recording_clip(
|
|||||||
clip: Recordings
|
clip: Recordings
|
||||||
for clip in recordings:
|
for clip in recordings:
|
||||||
file.write(f"file '{clip.path}'\n")
|
file.write(f"file '{clip.path}'\n")
|
||||||
|
|
||||||
# if this is the starting clip, add an inpoint
|
# if this is the starting clip, add an inpoint
|
||||||
if clip.start_time < start_ts:
|
if clip.start_time < start_ts:
|
||||||
file.write(f"inpoint {int(start_ts - clip.start_time)}\n")
|
file.write(f"inpoint {int(start_ts - clip.start_time)}\n")
|
||||||
|
|
||||||
# if this is the ending clip, add an outpoint
|
# if this is the ending clip, add an outpoint
|
||||||
if clip.end_time > end_ts:
|
if clip.end_time > end_ts:
|
||||||
file.write(f"outpoint {int(end_ts - clip.start_time)}\n")
|
file.write(f"outpoint {int(end_ts - clip.start_time)}\n")
|
||||||
@@ -638,10 +640,18 @@ def recording_clip(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@router.get("/vod/{camera_name}/start/{start_ts}/end/{end_ts}")
|
@router.get(
|
||||||
|
"/vod/{camera_name}/start/{start_ts}/end/{end_ts}",
|
||||||
|
description="Returns an HLS playlist for the specified timestamp-range on the specified camera. Append /master.m3u8 or /index.m3u8 for HLS playback.",
|
||||||
|
)
|
||||||
def vod_ts(camera_name: str, start_ts: float, end_ts: float):
|
def vod_ts(camera_name: str, start_ts: float, end_ts: float):
|
||||||
recordings = (
|
recordings = (
|
||||||
Recordings.select(Recordings.path, Recordings.duration, Recordings.end_time)
|
Recordings.select(
|
||||||
|
Recordings.path,
|
||||||
|
Recordings.duration,
|
||||||
|
Recordings.end_time,
|
||||||
|
Recordings.start_time,
|
||||||
|
)
|
||||||
.where(
|
.where(
|
||||||
Recordings.start_time.between(start_ts, end_ts)
|
Recordings.start_time.between(start_ts, end_ts)
|
||||||
| Recordings.end_time.between(start_ts, end_ts)
|
| Recordings.end_time.between(start_ts, end_ts)
|
||||||
@@ -661,14 +671,19 @@ def vod_ts(camera_name: str, start_ts: float, end_ts: float):
|
|||||||
clip = {"type": "source", "path": recording.path}
|
clip = {"type": "source", "path": recording.path}
|
||||||
duration = int(recording.duration * 1000)
|
duration = int(recording.duration * 1000)
|
||||||
|
|
||||||
# Determine if we need to end the last clip early
|
# adjust start offset if start_ts is after recording.start_time
|
||||||
|
if start_ts > recording.start_time:
|
||||||
|
inpoint = int((start_ts - recording.start_time) * 1000)
|
||||||
|
clip["clipFrom"] = inpoint
|
||||||
|
duration -= inpoint
|
||||||
|
|
||||||
|
# adjust end if recording.end_time is after end_ts
|
||||||
if recording.end_time > end_ts:
|
if recording.end_time > end_ts:
|
||||||
duration -= int((recording.end_time - end_ts) * 1000)
|
duration -= int((recording.end_time - end_ts) * 1000)
|
||||||
|
|
||||||
if duration == 0:
|
if duration <= 0:
|
||||||
# this means the segment starts right at the end of the requested time range
|
# skip if the clip has no valid duration
|
||||||
# and it does not need to be included
|
continue
|
||||||
continue
|
|
||||||
|
|
||||||
if 0 < duration < max_duration_ms:
|
if 0 < duration < max_duration_ms:
|
||||||
clip["keyFrameDurations"] = [duration]
|
clip["keyFrameDurations"] = [duration]
|
||||||
@@ -702,7 +717,10 @@ def vod_ts(camera_name: str, start_ts: float, end_ts: float):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@router.get("/vod/{year_month}/{day}/{hour}/{camera_name}")
|
@router.get(
|
||||||
|
"/vod/{year_month}/{day}/{hour}/{camera_name}",
|
||||||
|
description="Returns an HLS playlist for the specified date-time on the specified camera. Append /master.m3u8 or /index.m3u8 for HLS playback.",
|
||||||
|
)
|
||||||
def vod_hour_no_timezone(year_month: str, day: int, hour: int, camera_name: str):
|
def vod_hour_no_timezone(year_month: str, day: int, hour: int, camera_name: str):
|
||||||
"""VOD for specific hour. Uses the default timezone (UTC)."""
|
"""VOD for specific hour. Uses the default timezone (UTC)."""
|
||||||
return vod_hour(
|
return vod_hour(
|
||||||
@@ -710,7 +728,10 @@ def vod_hour_no_timezone(year_month: str, day: int, hour: int, camera_name: str)
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@router.get("/vod/{year_month}/{day}/{hour}/{camera_name}/{tz_name}")
|
@router.get(
|
||||||
|
"/vod/{year_month}/{day}/{hour}/{camera_name}/{tz_name}",
|
||||||
|
description="Returns an HLS playlist for the specified date-time (with timezone) on the specified camera. Append /master.m3u8 or /index.m3u8 for HLS playback.",
|
||||||
|
)
|
||||||
def vod_hour(year_month: str, day: int, hour: int, camera_name: str, tz_name: str):
|
def vod_hour(year_month: str, day: int, hour: int, camera_name: str, tz_name: str):
|
||||||
parts = year_month.split("-")
|
parts = year_month.split("-")
|
||||||
start_date = (
|
start_date = (
|
||||||
@@ -724,7 +745,10 @@ def vod_hour(year_month: str, day: int, hour: int, camera_name: str, tz_name: st
|
|||||||
return vod_ts(camera_name, start_ts, end_ts)
|
return vod_ts(camera_name, start_ts, end_ts)
|
||||||
|
|
||||||
|
|
||||||
@router.get("/vod/event/{event_id}")
|
@router.get(
|
||||||
|
"/vod/event/{event_id}",
|
||||||
|
description="Returns an HLS playlist for the specified object. Append /master.m3u8 or /index.m3u8 for HLS playback.",
|
||||||
|
)
|
||||||
def vod_event(event_id: str):
|
def vod_event(event_id: str):
|
||||||
try:
|
try:
|
||||||
event: Event = Event.get(Event.id == event_id)
|
event: Event = Event.get(Event.id == event_id)
|
||||||
|
|||||||
@@ -58,9 +58,8 @@ async def review(
|
|||||||
)
|
)
|
||||||
|
|
||||||
clauses = [
|
clauses = [
|
||||||
(ReviewSegment.start_time > after)
|
(ReviewSegment.start_time < before)
|
||||||
& (ReviewSegment.start_time < before)
|
& ((ReviewSegment.end_time.is_null(True)) | (ReviewSegment.end_time > after))
|
||||||
& ((ReviewSegment.end_time.is_null(True)) | (ReviewSegment.end_time < before))
|
|
||||||
]
|
]
|
||||||
|
|
||||||
if cameras != "all":
|
if cameras != "all":
|
||||||
|
|||||||
+14
-2
@@ -6,6 +6,7 @@ import secrets
|
|||||||
import shutil
|
import shutil
|
||||||
from multiprocessing import Queue
|
from multiprocessing import Queue
|
||||||
from multiprocessing.synchronize import Event as MpEvent
|
from multiprocessing.synchronize import Event as MpEvent
|
||||||
|
from pathlib import Path
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
import psutil
|
import psutil
|
||||||
@@ -44,6 +45,7 @@ from frigate.embeddings import EmbeddingsContext, manage_embeddings
|
|||||||
from frigate.events.audio import AudioProcessor
|
from frigate.events.audio import AudioProcessor
|
||||||
from frigate.events.cleanup import EventCleanup
|
from frigate.events.cleanup import EventCleanup
|
||||||
from frigate.events.maintainer import EventProcessor
|
from frigate.events.maintainer import EventProcessor
|
||||||
|
from frigate.log import _stop_logging
|
||||||
from frigate.models import (
|
from frigate.models import (
|
||||||
Event,
|
Event,
|
||||||
Export,
|
Export,
|
||||||
@@ -71,6 +73,7 @@ from frigate.track.object_processing import TrackedObjectProcessor
|
|||||||
from frigate.util.builtin import empty_and_close_queue
|
from frigate.util.builtin import empty_and_close_queue
|
||||||
from frigate.util.image import SharedMemoryFrameManager, UntrackedSharedMemory
|
from frigate.util.image import SharedMemoryFrameManager, UntrackedSharedMemory
|
||||||
from frigate.util.object import get_camera_regions_grid
|
from frigate.util.object import get_camera_regions_grid
|
||||||
|
from frigate.util.services import set_file_limit
|
||||||
from frigate.version import VERSION
|
from frigate.version import VERSION
|
||||||
from frigate.video import capture_camera, track_camera
|
from frigate.video import capture_camera, track_camera
|
||||||
from frigate.watchdog import FrigateWatchdog
|
from frigate.watchdog import FrigateWatchdog
|
||||||
@@ -438,7 +441,7 @@ class FrigateApp:
|
|||||||
|
|
||||||
def start_camera_processors(self) -> None:
|
def start_camera_processors(self) -> None:
|
||||||
for name, config in self.config.cameras.items():
|
for name, config in self.config.cameras.items():
|
||||||
if not self.config.cameras[name].enabled:
|
if not self.config.cameras[name].enabled_in_config:
|
||||||
logger.info(f"Camera processor not started for disabled camera {name}")
|
logger.info(f"Camera processor not started for disabled camera {name}")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@@ -467,7 +470,7 @@ class FrigateApp:
|
|||||||
shm_frame_count = self.shm_frame_count()
|
shm_frame_count = self.shm_frame_count()
|
||||||
|
|
||||||
for name, config in self.config.cameras.items():
|
for name, config in self.config.cameras.items():
|
||||||
if not self.config.cameras[name].enabled:
|
if not self.config.cameras[name].enabled_in_config:
|
||||||
logger.info(f"Capture process not started for disabled camera {name}")
|
logger.info(f"Capture process not started for disabled camera {name}")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@@ -630,6 +633,9 @@ class FrigateApp:
|
|||||||
# Ensure global state.
|
# Ensure global state.
|
||||||
self.ensure_dirs()
|
self.ensure_dirs()
|
||||||
|
|
||||||
|
# Set soft file limits.
|
||||||
|
set_file_limit()
|
||||||
|
|
||||||
# Start frigate services.
|
# Start frigate services.
|
||||||
self.init_camera_metrics()
|
self.init_camera_metrics()
|
||||||
self.init_queues()
|
self.init_queues()
|
||||||
@@ -684,6 +690,9 @@ class FrigateApp:
|
|||||||
def stop(self) -> None:
|
def stop(self) -> None:
|
||||||
logger.info("Stopping...")
|
logger.info("Stopping...")
|
||||||
|
|
||||||
|
# used by the docker healthcheck
|
||||||
|
Path("/dev/shm/.frigate-is-stopping").touch()
|
||||||
|
|
||||||
self.stop_event.set()
|
self.stop_event.set()
|
||||||
|
|
||||||
# set an end_time on entries without an end_time before exiting
|
# set an end_time on entries without an end_time before exiting
|
||||||
@@ -771,4 +780,7 @@ class FrigateApp:
|
|||||||
shm.close()
|
shm.close()
|
||||||
shm.unlink()
|
shm.unlink()
|
||||||
|
|
||||||
|
# exit the mp Manager process
|
||||||
|
_stop_logging()
|
||||||
|
|
||||||
os._exit(os.EX_OK)
|
os._exit(os.EX_OK)
|
||||||
|
|||||||
+51
-11
@@ -172,6 +172,7 @@ class CameraState:
|
|||||||
# draw any attributes
|
# draw any attributes
|
||||||
for attribute in obj["current_attributes"]:
|
for attribute in obj["current_attributes"]:
|
||||||
box = attribute["box"]
|
box = attribute["box"]
|
||||||
|
box_area = int((box[2] - box[0]) * (box[3] - box[1]))
|
||||||
draw_box_with_label(
|
draw_box_with_label(
|
||||||
frame_copy,
|
frame_copy,
|
||||||
box[0],
|
box[0],
|
||||||
@@ -179,7 +180,7 @@ class CameraState:
|
|||||||
box[2],
|
box[2],
|
||||||
box[3],
|
box[3],
|
||||||
attribute["label"],
|
attribute["label"],
|
||||||
f"{attribute['score']:.0%}",
|
f"{attribute['score']:.0%} {str(box_area)}",
|
||||||
thickness=thickness,
|
thickness=thickness,
|
||||||
color=color,
|
color=color,
|
||||||
)
|
)
|
||||||
@@ -255,6 +256,7 @@ class CameraState:
|
|||||||
updated_ids = current_ids.intersection(previous_ids)
|
updated_ids = current_ids.intersection(previous_ids)
|
||||||
|
|
||||||
for id in new_ids:
|
for id in new_ids:
|
||||||
|
logger.debug(f"{self.name}: New tracked object ID: {id}")
|
||||||
new_obj = tracked_objects[id] = TrackedObject(
|
new_obj = tracked_objects[id] = TrackedObject(
|
||||||
self.config.model,
|
self.config.model,
|
||||||
self.camera_config,
|
self.camera_config,
|
||||||
@@ -264,7 +266,13 @@ class CameraState:
|
|||||||
)
|
)
|
||||||
|
|
||||||
# add initial frame to frame cache
|
# add initial frame to frame cache
|
||||||
self.frame_cache[frame_time] = np.copy(current_frame)
|
logger.debug(
|
||||||
|
f"{self.name}: New object, adding {frame_time} to frame cache for {id}"
|
||||||
|
)
|
||||||
|
self.frame_cache[frame_time] = {
|
||||||
|
"frame": np.copy(current_frame),
|
||||||
|
"object_id": id,
|
||||||
|
}
|
||||||
|
|
||||||
# save initial thumbnail data and best object
|
# save initial thumbnail data and best object
|
||||||
thumbnail_data = {
|
thumbnail_data = {
|
||||||
@@ -282,9 +290,11 @@ class CameraState:
|
|||||||
}
|
}
|
||||||
new_obj.thumbnail_data = thumbnail_data
|
new_obj.thumbnail_data = thumbnail_data
|
||||||
tracked_objects[id].thumbnail_data = thumbnail_data
|
tracked_objects[id].thumbnail_data = thumbnail_data
|
||||||
self.best_objects[new_obj.obj_data["label"]] = new_obj
|
object_type = new_obj.obj_data["label"]
|
||||||
|
|
||||||
# call event handlers
|
# call event handlers
|
||||||
|
self.send_mqtt_snapshot(new_obj, object_type)
|
||||||
|
|
||||||
for c in self.callbacks["start"]:
|
for c in self.callbacks["start"]:
|
||||||
c(self.name, new_obj, frame_name)
|
c(self.name, new_obj, frame_name)
|
||||||
|
|
||||||
@@ -306,7 +316,13 @@ class CameraState:
|
|||||||
updated_obj.thumbnail_data["frame_time"] == frame_time
|
updated_obj.thumbnail_data["frame_time"] == frame_time
|
||||||
and frame_time not in self.frame_cache
|
and frame_time not in self.frame_cache
|
||||||
):
|
):
|
||||||
self.frame_cache[frame_time] = np.copy(current_frame)
|
logger.debug(
|
||||||
|
f"{self.name}: Existing object, adding {frame_time} to frame cache for {id}"
|
||||||
|
)
|
||||||
|
self.frame_cache[frame_time] = {
|
||||||
|
"frame": np.copy(current_frame),
|
||||||
|
"object_id": id,
|
||||||
|
}
|
||||||
|
|
||||||
updated_obj.last_updated = frame_time
|
updated_obj.last_updated = frame_time
|
||||||
|
|
||||||
@@ -332,6 +348,7 @@ class CameraState:
|
|||||||
removed_obj = tracked_objects[id]
|
removed_obj = tracked_objects[id]
|
||||||
if "end_time" not in removed_obj.obj_data:
|
if "end_time" not in removed_obj.obj_data:
|
||||||
removed_obj.obj_data["end_time"] = frame_time
|
removed_obj.obj_data["end_time"] = frame_time
|
||||||
|
logger.debug(f"{self.name}: end callback for object {id}")
|
||||||
for c in self.callbacks["end"]:
|
for c in self.callbacks["end"]:
|
||||||
c(self.name, removed_obj, frame_name)
|
c(self.name, removed_obj, frame_name)
|
||||||
|
|
||||||
@@ -398,13 +415,9 @@ class CameraState:
|
|||||||
or (now - current_best.thumbnail_data["frame_time"])
|
or (now - current_best.thumbnail_data["frame_time"])
|
||||||
> self.camera_config.best_image_timeout
|
> self.camera_config.best_image_timeout
|
||||||
):
|
):
|
||||||
self.best_objects[object_type] = obj
|
self.send_mqtt_snapshot(obj, object_type)
|
||||||
for c in self.callbacks["snapshot"]:
|
|
||||||
c(self.name, self.best_objects[object_type], frame_name)
|
|
||||||
else:
|
else:
|
||||||
self.best_objects[object_type] = obj
|
self.send_mqtt_snapshot(obj, object_type)
|
||||||
for c in self.callbacks["snapshot"]:
|
|
||||||
c(self.name, self.best_objects[object_type], frame_name)
|
|
||||||
|
|
||||||
for c in self.callbacks["camera_activity"]:
|
for c in self.callbacks["camera_activity"]:
|
||||||
c(self.name, camera_activity)
|
c(self.name, camera_activity)
|
||||||
@@ -413,7 +426,7 @@ class CameraState:
|
|||||||
current_thumb_frames = {
|
current_thumb_frames = {
|
||||||
obj.thumbnail_data["frame_time"]
|
obj.thumbnail_data["frame_time"]
|
||||||
for obj in tracked_objects.values()
|
for obj in tracked_objects.values()
|
||||||
if not obj.false_positive and obj.thumbnail_data is not None
|
if obj.thumbnail_data is not None
|
||||||
}
|
}
|
||||||
current_best_frames = {
|
current_best_frames = {
|
||||||
obj.thumbnail_data["frame_time"] for obj in self.best_objects.values()
|
obj.thumbnail_data["frame_time"] for obj in self.best_objects.values()
|
||||||
@@ -423,7 +436,20 @@ class CameraState:
|
|||||||
for t in self.frame_cache.keys()
|
for t in self.frame_cache.keys()
|
||||||
if t not in current_thumb_frames and t not in current_best_frames
|
if t not in current_thumb_frames and t not in current_best_frames
|
||||||
]
|
]
|
||||||
|
if len(thumb_frames_to_delete) > 0:
|
||||||
|
logger.debug(f"{self.name}: Current frame cache contents:")
|
||||||
|
for k, v in self.frame_cache.items():
|
||||||
|
logger.debug(f" frame time: {k}, object id: {v['object_id']}")
|
||||||
|
for obj_id, obj in tracked_objects.items():
|
||||||
|
thumb_time = (
|
||||||
|
obj.thumbnail_data["frame_time"] if obj.thumbnail_data else None
|
||||||
|
)
|
||||||
|
logger.debug(
|
||||||
|
f"{self.name}: Tracked object {obj_id} thumbnail frame_time: {thumb_time}, false positive: {obj.false_positive}"
|
||||||
|
)
|
||||||
for t in thumb_frames_to_delete:
|
for t in thumb_frames_to_delete:
|
||||||
|
object_id = self.frame_cache[t].get("object_id", "unknown")
|
||||||
|
logger.debug(f"{self.name}: Deleting {t} from frame cache for {object_id}")
|
||||||
del self.frame_cache[t]
|
del self.frame_cache[t]
|
||||||
|
|
||||||
with self.current_frame_lock:
|
with self.current_frame_lock:
|
||||||
@@ -440,6 +466,20 @@ class CameraState:
|
|||||||
|
|
||||||
self.previous_frame_id = frame_name
|
self.previous_frame_id = frame_name
|
||||||
|
|
||||||
|
def send_mqtt_snapshot(self, new_obj: TrackedObject, object_type: str) -> None:
|
||||||
|
for c in self.callbacks["snapshot"]:
|
||||||
|
updated = c(self.name, new_obj)
|
||||||
|
|
||||||
|
# if the snapshot was not updated, then this object is not a best object
|
||||||
|
# but all new objects should be considered the next best object
|
||||||
|
# so we remove the label from the best objects
|
||||||
|
if updated:
|
||||||
|
self.best_objects[object_type] = new_obj
|
||||||
|
else:
|
||||||
|
if object_type in self.best_objects:
|
||||||
|
self.best_objects.pop(object_type)
|
||||||
|
break
|
||||||
|
|
||||||
def save_manual_event_image(
|
def save_manual_event_image(
|
||||||
self,
|
self,
|
||||||
frame: np.ndarray | None,
|
frame: np.ndarray | None,
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ from typing import Any, Callable
|
|||||||
|
|
||||||
from py_vapid import Vapid01
|
from py_vapid import Vapid01
|
||||||
from pywebpush import WebPusher
|
from pywebpush import WebPusher
|
||||||
|
from titlecase import titlecase
|
||||||
|
|
||||||
from frigate.comms.base_communicator import Communicator
|
from frigate.comms.base_communicator import Communicator
|
||||||
from frigate.comms.config_updater import ConfigSubscriber
|
from frigate.comms.config_updater import ConfigSubscriber
|
||||||
@@ -173,7 +174,12 @@ class WebPushClient(Communicator): # type: ignore[misc]
|
|||||||
return
|
return
|
||||||
self.send_alert(decoded)
|
self.send_alert(decoded)
|
||||||
elif topic == "notification_test":
|
elif topic == "notification_test":
|
||||||
if not self.config.notifications.enabled:
|
if not self.config.notifications.enabled and not any(
|
||||||
|
cam.notifications.enabled for cam in self.config.cameras.values()
|
||||||
|
):
|
||||||
|
logger.debug(
|
||||||
|
"No cameras have notifications enabled, test notification not sent"
|
||||||
|
)
|
||||||
return
|
return
|
||||||
self.send_notification_test()
|
self.send_notification_test()
|
||||||
|
|
||||||
@@ -320,8 +326,8 @@ class WebPushClient(Communicator): # type: ignore[misc]
|
|||||||
|
|
||||||
sorted_objects.update(payload["after"]["data"]["sub_labels"])
|
sorted_objects.update(payload["after"]["data"]["sub_labels"])
|
||||||
|
|
||||||
title = f"{', '.join(sorted_objects).replace('_', ' ').title()}{' was' if state == 'end' else ''} detected in {', '.join(payload['after']['data']['zones']).replace('_', ' ').title()}"
|
title = f"{titlecase(', '.join(sorted_objects).replace('_', ' '))}{' was' if state == 'end' else ''} detected in {titlecase(', '.join(payload['after']['data']['zones']).replace('_', ' '))}"
|
||||||
message = f"Detected on {camera.replace('_', ' ').title()}"
|
message = f"Detected on {titlecase(camera.replace('_', ' '))}"
|
||||||
image = f"{payload['after']['thumb_path'].replace('/media/frigate', '')}"
|
image = f"{payload['after']['thumb_path'].replace('/media/frigate', '')}"
|
||||||
|
|
||||||
# if event is ongoing open to live view otherwise open to recordings view
|
# if event is ongoing open to live view otherwise open to recordings view
|
||||||
|
|||||||
@@ -78,7 +78,13 @@ class FaceRecognitionConfig(FrigateBaseModel):
|
|||||||
le=1.0,
|
le=1.0,
|
||||||
)
|
)
|
||||||
min_area: int = Field(
|
min_area: int = Field(
|
||||||
default=500, title="Min area of face box to consider running face recognition."
|
default=750, title="Min area of face box to consider running face recognition."
|
||||||
|
)
|
||||||
|
min_faces: int = Field(
|
||||||
|
default=1,
|
||||||
|
gt=0,
|
||||||
|
le=6,
|
||||||
|
title="Min face recognitions for the sub label to be applied to the person object.",
|
||||||
)
|
)
|
||||||
save_attempts: int = Field(
|
save_attempts: int = Field(
|
||||||
default=100, ge=0, title="Number of face attempts to save in the train tab."
|
default=100, ge=0, title="Number of face attempts to save in the train tab."
|
||||||
@@ -91,7 +97,7 @@ class FaceRecognitionConfig(FrigateBaseModel):
|
|||||||
class CameraFaceRecognitionConfig(FrigateBaseModel):
|
class CameraFaceRecognitionConfig(FrigateBaseModel):
|
||||||
enabled: bool = Field(default=False, title="Enable face recognition.")
|
enabled: bool = Field(default=False, title="Enable face recognition.")
|
||||||
min_area: int = Field(
|
min_area: int = Field(
|
||||||
default=500, title="Min area of face box to consider running face recognition."
|
default=750, title="Min area of face box to consider running face recognition."
|
||||||
)
|
)
|
||||||
|
|
||||||
model_config = ConfigDict(extra="forbid", protected_namespaces=())
|
model_config = ConfigDict(extra="forbid", protected_namespaces=())
|
||||||
|
|||||||
+48
-30
@@ -299,6 +299,22 @@ def verify_motion_and_detect(camera_config: CameraConfig) -> ValueError | None:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def verify_objects_track(
|
||||||
|
camera_config: CameraConfig, enabled_objects: list[str]
|
||||||
|
) -> None:
|
||||||
|
"""Verify that a user has not specified an object to track that is not in the labelmap."""
|
||||||
|
valid_objects = [
|
||||||
|
obj for obj in camera_config.objects.track if obj in enabled_objects
|
||||||
|
]
|
||||||
|
|
||||||
|
if len(valid_objects) != len(camera_config.objects.track):
|
||||||
|
invalid_objects = set(camera_config.objects.track) - set(valid_objects)
|
||||||
|
logger.warning(
|
||||||
|
f"{camera_config.name} is configured to track {list(invalid_objects)} objects, which are not supported by the current model."
|
||||||
|
)
|
||||||
|
camera_config.objects.track = valid_objects
|
||||||
|
|
||||||
|
|
||||||
def verify_lpr_and_face(
|
def verify_lpr_and_face(
|
||||||
frigate_config: FrigateConfig, camera_config: CameraConfig
|
frigate_config: FrigateConfig, camera_config: CameraConfig
|
||||||
) -> ValueError | None:
|
) -> ValueError | None:
|
||||||
@@ -471,6 +487,37 @@ class FrigateConfig(FrigateBaseModel):
|
|||||||
exclude_unset=True,
|
exclude_unset=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
for key, detector in self.detectors.items():
|
||||||
|
adapter = TypeAdapter(DetectorConfig)
|
||||||
|
model_dict = (
|
||||||
|
detector
|
||||||
|
if isinstance(detector, dict)
|
||||||
|
else detector.model_dump(warnings="none")
|
||||||
|
)
|
||||||
|
detector_config: BaseDetectorConfig = adapter.validate_python(model_dict)
|
||||||
|
|
||||||
|
# users should not set model themselves
|
||||||
|
if detector_config.model:
|
||||||
|
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":
|
||||||
|
model_config["path"] = "/cpu_model.tflite"
|
||||||
|
elif detector_config.type == "edgetpu":
|
||||||
|
model_config["path"] = "/edgetpu_model.tflite"
|
||||||
|
|
||||||
|
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():
|
for name, camera in self.cameras.items():
|
||||||
modified_global_config = global_config.copy()
|
modified_global_config = global_config.copy()
|
||||||
|
|
||||||
@@ -644,6 +691,7 @@ class FrigateConfig(FrigateBaseModel):
|
|||||||
verify_required_zones_exist(camera_config)
|
verify_required_zones_exist(camera_config)
|
||||||
verify_autotrack_zones(camera_config)
|
verify_autotrack_zones(camera_config)
|
||||||
verify_motion_and_detect(camera_config)
|
verify_motion_and_detect(camera_config)
|
||||||
|
verify_objects_track(camera_config, labelmap_objects)
|
||||||
verify_lpr_and_face(self, camera_config)
|
verify_lpr_and_face(self, camera_config)
|
||||||
|
|
||||||
self.objects.parse_all_objects(self.cameras)
|
self.objects.parse_all_objects(self.cameras)
|
||||||
@@ -655,36 +703,6 @@ class FrigateConfig(FrigateBaseModel):
|
|||||||
"Frigate+ is configured but clean snapshots are not enabled, submissions to Frigate+ will not be possible./"
|
"Frigate+ is configured but clean snapshots are not enabled, submissions to Frigate+ will not be possible./"
|
||||||
)
|
)
|
||||||
|
|
||||||
for key, detector in self.detectors.items():
|
|
||||||
adapter = TypeAdapter(DetectorConfig)
|
|
||||||
model_dict = (
|
|
||||||
detector
|
|
||||||
if isinstance(detector, dict)
|
|
||||||
else detector.model_dump(warnings="none")
|
|
||||||
)
|
|
||||||
detector_config: BaseDetectorConfig = adapter.validate_python(model_dict)
|
|
||||||
|
|
||||||
# users should not set model themselves
|
|
||||||
if detector_config.model:
|
|
||||||
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":
|
|
||||||
model_config["path"] = "/cpu_model.tflite"
|
|
||||||
elif detector_config.type == "edgetpu":
|
|
||||||
model_config["path"] = "/edgetpu_model.tflite"
|
|
||||||
|
|
||||||
model = ModelConfig.model_validate(model_config)
|
|
||||||
model.check_and_load_plus_model(self.plus_api, detector_config.type)
|
|
||||||
model.compute_model_hash()
|
|
||||||
detector_config.model = model
|
|
||||||
self.detectors[key] = detector_config
|
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|
||||||
@field_validator("cameras")
|
@field_validator("cameras")
|
||||||
|
|||||||
+12
-1
@@ -1,6 +1,6 @@
|
|||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from pydantic import Field
|
from pydantic import Field, field_validator
|
||||||
|
|
||||||
from .base import FrigateBaseModel
|
from .base import FrigateBaseModel
|
||||||
from .env import EnvString
|
from .env import EnvString
|
||||||
@@ -33,3 +33,14 @@ class ProxyConfig(FrigateBaseModel):
|
|||||||
default_role: Optional[str] = Field(
|
default_role: Optional[str] = Field(
|
||||||
default="viewer", title="Default role for proxy users."
|
default="viewer", title="Default role for proxy users."
|
||||||
)
|
)
|
||||||
|
separator: Optional[str] = Field(
|
||||||
|
default=",",
|
||||||
|
title="The character used to separate values in a mapped header.",
|
||||||
|
)
|
||||||
|
|
||||||
|
@field_validator("separator", mode="before")
|
||||||
|
@classmethod
|
||||||
|
def validate_separator_length(cls, v):
|
||||||
|
if v is not None and len(v) != 1:
|
||||||
|
raise ValueError("Separator must be exactly one character")
|
||||||
|
return v
|
||||||
|
|||||||
@@ -108,21 +108,24 @@ class FaceRecognizer(ABC):
|
|||||||
image, M, (output_width, output_height), flags=cv2.INTER_CUBIC
|
image, M, (output_width, output_height), flags=cv2.INTER_CUBIC
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_blur_factor(self, input: np.ndarray) -> float:
|
def get_blur_confidence_reduction(self, input: np.ndarray) -> float:
|
||||||
"""Calculates the factor for the confidence based on the blur of the image."""
|
"""Calculates the reduction in confidence based on the blur of the image."""
|
||||||
if not self.config.face_recognition.blur_confidence_filter:
|
if not self.config.face_recognition.blur_confidence_filter:
|
||||||
return 1.0
|
return 0.0
|
||||||
|
|
||||||
variance = cv2.Laplacian(input, cv2.CV_64F).var()
|
variance = cv2.Laplacian(input, cv2.CV_64F).var()
|
||||||
|
logger.debug(f"face detected with blurriness {variance}")
|
||||||
|
|
||||||
if variance < 60: # image is very blurry
|
if variance < 120: # image is very blurry
|
||||||
return 0.96
|
return 0.06
|
||||||
elif variance < 70: # image moderately blurry
|
elif variance < 160: # image moderately blurry
|
||||||
return 0.98
|
return 0.04
|
||||||
elif variance < 80: # image is slightly blurry
|
elif variance < 200: # image is slightly blurry
|
||||||
return 0.99
|
return 0.02
|
||||||
|
elif variance < 250: # image is mostly clear
|
||||||
|
return 0.01
|
||||||
else:
|
else:
|
||||||
return 1.0
|
return 0.0
|
||||||
|
|
||||||
|
|
||||||
def similarity_to_confidence(
|
def similarity_to_confidence(
|
||||||
@@ -234,8 +237,7 @@ class FaceNetRecognizer(FaceRecognizer):
|
|||||||
# face recognition is best run on grayscale images
|
# face recognition is best run on grayscale images
|
||||||
|
|
||||||
# get blur factor before aligning face
|
# get blur factor before aligning face
|
||||||
blur_factor = self.get_blur_factor(face_image)
|
blur_reduction = self.get_blur_confidence_reduction(face_image)
|
||||||
logger.debug(f"face detected with blurriness {blur_factor}")
|
|
||||||
|
|
||||||
# align face and run recognition
|
# align face and run recognition
|
||||||
img = self.align_face(face_image, face_image.shape[1], face_image.shape[0])
|
img = self.align_face(face_image, face_image.shape[1], face_image.shape[0])
|
||||||
@@ -258,7 +260,7 @@ class FaceNetRecognizer(FaceRecognizer):
|
|||||||
score = confidence
|
score = confidence
|
||||||
label = name
|
label = name
|
||||||
|
|
||||||
return label, round(score * blur_factor, 2)
|
return label, round(score - blur_reduction, 2)
|
||||||
|
|
||||||
|
|
||||||
class ArcFaceRecognizer(FaceRecognizer):
|
class ArcFaceRecognizer(FaceRecognizer):
|
||||||
@@ -344,9 +346,8 @@ class ArcFaceRecognizer(FaceRecognizer):
|
|||||||
|
|
||||||
# face recognition is best run on grayscale images
|
# face recognition is best run on grayscale images
|
||||||
|
|
||||||
# get blur factor before aligning face
|
# get blur reduction before aligning face
|
||||||
blur_factor = self.get_blur_factor(face_image)
|
blur_reduction = self.get_blur_confidence_reduction(face_image)
|
||||||
logger.debug(f"face detected with blurriness {blur_factor}")
|
|
||||||
|
|
||||||
# align face and run recognition
|
# align face and run recognition
|
||||||
img = self.align_face(face_image, face_image.shape[1], face_image.shape[0])
|
img = self.align_face(face_image, face_image.shape[1], face_image.shape[0])
|
||||||
@@ -367,4 +368,4 @@ class ArcFaceRecognizer(FaceRecognizer):
|
|||||||
score = confidence
|
score = confidence
|
||||||
label = name
|
label = name
|
||||||
|
|
||||||
return label, round(score * blur_factor, 2)
|
return label, round(score - blur_reduction, 2)
|
||||||
|
|||||||
@@ -167,6 +167,8 @@ class LicensePlateProcessingMixin:
|
|||||||
outputs = self.model_runner.recognition_model(norm_images)
|
outputs = self.model_runner.recognition_model(norm_images)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.warning(f"Error running LPR recognition model: {e}")
|
logger.warning(f"Error running LPR recognition model: {e}")
|
||||||
|
return [], []
|
||||||
|
|
||||||
return self.ctc_decoder(outputs)
|
return self.ctc_decoder(outputs)
|
||||||
|
|
||||||
def _process_license_plate(
|
def _process_license_plate(
|
||||||
@@ -1498,18 +1500,24 @@ class LicensePlateProcessingMixin:
|
|||||||
|
|
||||||
# Determine subLabel based on known plates, use regex matching
|
# Determine subLabel based on known plates, use regex matching
|
||||||
# Default to the detected plate, use label name if there's a match
|
# Default to the detected plate, use label name if there's a match
|
||||||
sub_label = next(
|
try:
|
||||||
(
|
sub_label = next(
|
||||||
label
|
(
|
||||||
for label, plates in self.lpr_config.known_plates.items()
|
label
|
||||||
if any(
|
for label, plates in self.lpr_config.known_plates.items()
|
||||||
re.match(f"^{plate}$", top_plate)
|
if any(
|
||||||
or distance(plate, top_plate) <= self.lpr_config.match_distance
|
re.match(f"^{plate}$", top_plate)
|
||||||
for plate in plates
|
or distance(plate, top_plate) <= self.lpr_config.match_distance
|
||||||
)
|
for plate in plates
|
||||||
),
|
)
|
||||||
None,
|
),
|
||||||
)
|
None,
|
||||||
|
)
|
||||||
|
except re.error:
|
||||||
|
logger.error(
|
||||||
|
f"{camera}: Invalid regex in known plates configuration: {self.lpr_config.known_plates}"
|
||||||
|
)
|
||||||
|
sub_label = None
|
||||||
|
|
||||||
# If it's a known plate, publish to sub_label
|
# If it's a known plate, publish to sub_label
|
||||||
if sub_label is not None:
|
if sub_label is not None:
|
||||||
@@ -1570,10 +1578,13 @@ class LicensePlateProcessingMixin:
|
|||||||
def handle_request(self, topic, request_data) -> dict[str, Any] | None:
|
def handle_request(self, topic, request_data) -> dict[str, Any] | None:
|
||||||
return
|
return
|
||||||
|
|
||||||
def expire_object(self, object_id: str, camera: str):
|
def lpr_expire(self, object_id: str, camera: str):
|
||||||
if object_id in self.detected_license_plates:
|
if object_id in self.detected_license_plates:
|
||||||
self.detected_license_plates.pop(object_id)
|
self.detected_license_plates.pop(object_id)
|
||||||
|
|
||||||
|
if object_id in self.camera_current_cars.get(camera, []):
|
||||||
|
self.camera_current_cars[camera].remove(object_id)
|
||||||
|
|
||||||
|
|
||||||
class CTCDecoder:
|
class CTCDecoder:
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -97,6 +97,9 @@ class BirdRealTimeProcessor(RealTimeProcessorApi):
|
|||||||
line = f.readline()
|
line = f.readline()
|
||||||
|
|
||||||
def process_frame(self, obj_data, frame):
|
def process_frame(self, obj_data, frame):
|
||||||
|
if not self.interpreter:
|
||||||
|
return
|
||||||
|
|
||||||
if obj_data["label"] != "bird":
|
if obj_data["label"] != "bird":
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -106,7 +109,13 @@ class BirdRealTimeProcessor(RealTimeProcessorApi):
|
|||||||
obj_data["box"][1],
|
obj_data["box"][1],
|
||||||
obj_data["box"][2],
|
obj_data["box"][2],
|
||||||
obj_data["box"][3],
|
obj_data["box"][3],
|
||||||
224,
|
int(
|
||||||
|
max(
|
||||||
|
obj_data["box"][1] - obj_data["box"][0],
|
||||||
|
obj_data["box"][3] - obj_data["box"][2],
|
||||||
|
)
|
||||||
|
* 1.1
|
||||||
|
),
|
||||||
1.0,
|
1.0,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import json
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
from pathlib import Path
|
||||||
from typing import Any, Optional
|
from typing import Any, Optional
|
||||||
|
|
||||||
import cv2
|
import cv2
|
||||||
@@ -293,10 +294,11 @@ class FaceRealTimeProcessor(RealTimeProcessorApi):
|
|||||||
if camera not in self.camera_current_people:
|
if camera not in self.camera_current_people:
|
||||||
self.camera_current_people[camera] = []
|
self.camera_current_people[camera] = []
|
||||||
|
|
||||||
|
self.camera_current_people[camera].append(id)
|
||||||
|
|
||||||
self.person_face_history[id].append(
|
self.person_face_history[id].append(
|
||||||
(sub_label, score, face_frame.shape[0] * face_frame.shape[1])
|
(sub_label, score, face_frame.shape[0] * face_frame.shape[1])
|
||||||
)
|
)
|
||||||
self.camera_current_people[camera].append(id)
|
|
||||||
(weighted_sub_label, weighted_score) = self.weighted_average(
|
(weighted_sub_label, weighted_score) = self.weighted_average(
|
||||||
self.person_face_history[id]
|
self.person_face_history[id]
|
||||||
)
|
)
|
||||||
@@ -439,18 +441,6 @@ class FaceRealTimeProcessor(RealTimeProcessorApi):
|
|||||||
if object_id in self.camera_current_people.get(camera, []):
|
if object_id in self.camera_current_people.get(camera, []):
|
||||||
self.camera_current_people[camera].remove(object_id)
|
self.camera_current_people[camera].remove(object_id)
|
||||||
|
|
||||||
if len(self.camera_current_people[camera]) == 0:
|
|
||||||
self.requestor.send_data(
|
|
||||||
"tracked_object_update",
|
|
||||||
json.dumps(
|
|
||||||
{
|
|
||||||
"type": TrackedObjectUpdateTypesEnum.face,
|
|
||||||
"name": None,
|
|
||||||
"camera": camera,
|
|
||||||
}
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
||||||
def weighted_average(
|
def weighted_average(
|
||||||
self, results_list: list[tuple[str, float, int]], max_weight: int = 4000
|
self, results_list: list[tuple[str, float, int]], max_weight: int = 4000
|
||||||
):
|
):
|
||||||
@@ -467,17 +457,22 @@ class FaceRealTimeProcessor(RealTimeProcessorApi):
|
|||||||
if not results_list:
|
if not results_list:
|
||||||
return None, 0.0
|
return None, 0.0
|
||||||
|
|
||||||
weighted_scores = {}
|
counts: dict[str, int] = {}
|
||||||
total_weights = {}
|
weighted_scores: dict[str, int] = {}
|
||||||
|
total_weights: dict[str, int] = {}
|
||||||
|
|
||||||
for name, score, face_area in results_list:
|
for name, score, face_area in results_list:
|
||||||
if name == "unknown":
|
if name == "unknown":
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if name not in weighted_scores:
|
if name not in weighted_scores:
|
||||||
|
counts[name] = 0
|
||||||
weighted_scores[name] = 0.0
|
weighted_scores[name] = 0.0
|
||||||
total_weights[name] = 0.0
|
total_weights[name] = 0.0
|
||||||
|
|
||||||
|
# increase count
|
||||||
|
counts[name] += 1
|
||||||
|
|
||||||
# Capped weight based on face area
|
# Capped weight based on face area
|
||||||
weight = min(face_area, max_weight)
|
weight = min(face_area, max_weight)
|
||||||
|
|
||||||
@@ -490,6 +485,16 @@ class FaceRealTimeProcessor(RealTimeProcessorApi):
|
|||||||
return None, 0.0
|
return None, 0.0
|
||||||
|
|
||||||
best_name = max(weighted_scores, key=weighted_scores.get)
|
best_name = max(weighted_scores, key=weighted_scores.get)
|
||||||
|
|
||||||
|
# If the number of faces for this person < min_faces, we are not confident it is a correct result
|
||||||
|
if counts[best_name] < self.face_config.min_faces:
|
||||||
|
return None, 0.0
|
||||||
|
|
||||||
|
# If the best name has the same number of results as another name, we are not confident it is a correct result
|
||||||
|
for name, count in counts.items():
|
||||||
|
if name != best_name and counts[best_name] == count:
|
||||||
|
return None, 0.0
|
||||||
|
|
||||||
weighted_average = weighted_scores[best_name] / total_weights[best_name]
|
weighted_average = weighted_scores[best_name] / total_weights[best_name]
|
||||||
|
|
||||||
return best_name, weighted_average
|
return best_name, weighted_average
|
||||||
@@ -523,4 +528,4 @@ class FaceRealTimeProcessor(RealTimeProcessorApi):
|
|||||||
|
|
||||||
# delete oldest face image if maximum is reached
|
# delete oldest face image if maximum is reached
|
||||||
if len(files) > self.config.face_recognition.save_attempts:
|
if len(files) > self.config.face_recognition.save_attempts:
|
||||||
os.unlink(os.path.join(folder, files[-1]))
|
Path(os.path.join(folder, files[-1])).unlink(missing_ok=True)
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
"""Handle processing images for face detection and recognition."""
|
"""Handle processing images for face detection and recognition."""
|
||||||
|
|
||||||
import json
|
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
@@ -15,7 +14,6 @@ from frigate.data_processing.common.license_plate.mixin import (
|
|||||||
from frigate.data_processing.common.license_plate.model import (
|
from frigate.data_processing.common.license_plate.model import (
|
||||||
LicensePlateModelRunner,
|
LicensePlateModelRunner,
|
||||||
)
|
)
|
||||||
from frigate.types import TrackedObjectUpdateTypesEnum
|
|
||||||
|
|
||||||
from ..types import DataProcessorMetrics
|
from ..types import DataProcessorMetrics
|
||||||
from .api import RealTimeProcessorApi
|
from .api import RealTimeProcessorApi
|
||||||
@@ -55,21 +53,5 @@ class LicensePlateRealTimeProcessor(LicensePlateProcessingMixin, RealTimeProcess
|
|||||||
return
|
return
|
||||||
|
|
||||||
def expire_object(self, object_id: str, camera: str):
|
def expire_object(self, object_id: str, camera: str):
|
||||||
if object_id in self.detected_license_plates:
|
"""Expire lpr objects."""
|
||||||
self.detected_license_plates.pop(object_id)
|
self.lpr_expire(object_id, camera)
|
||||||
|
|
||||||
if object_id in self.camera_current_cars.get(camera, []):
|
|
||||||
self.camera_current_cars[camera].remove(object_id)
|
|
||||||
|
|
||||||
if len(self.camera_current_cars[camera]) == 0:
|
|
||||||
self.requestor.send_data(
|
|
||||||
"tracked_object_update",
|
|
||||||
json.dumps(
|
|
||||||
{
|
|
||||||
"type": TrackedObjectUpdateTypesEnum.lpr,
|
|
||||||
"name": None,
|
|
||||||
"plate": None,
|
|
||||||
"camera": camera,
|
|
||||||
}
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -345,11 +345,17 @@ class HailoDetector(DetectionApi):
|
|||||||
request_id = self.input_store.put(tensor_input)
|
request_id = self.input_store.put(tensor_input)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
_, infer_results = self.response_store.get(request_id, timeout=10.0)
|
_, infer_results = self.response_store.get(request_id, timeout=1.0)
|
||||||
except TimeoutError:
|
except TimeoutError:
|
||||||
logger.error(
|
logger.error(
|
||||||
f"Timeout waiting for inference results for request {request_id}"
|
f"Timeout waiting for inference results for request {request_id}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not self.inference_thread.is_alive():
|
||||||
|
raise RuntimeError(
|
||||||
|
"HailoRT inference thread has stopped, restart required."
|
||||||
|
)
|
||||||
|
|
||||||
return np.zeros((20, 6), dtype=np.float32)
|
return np.zeros((20, 6), dtype=np.float32)
|
||||||
|
|
||||||
if isinstance(infer_results, list) and len(infer_results) == 1:
|
if isinstance(infer_results, list) and len(infer_results) == 1:
|
||||||
|
|||||||
@@ -3,11 +3,9 @@ import os
|
|||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import openvino as ov
|
import openvino as ov
|
||||||
import openvino.properties as props
|
|
||||||
from pydantic import Field
|
from pydantic import Field
|
||||||
from typing_extensions import Literal
|
from typing_extensions import Literal
|
||||||
|
|
||||||
from frigate.const import MODEL_CACHE_DIR
|
|
||||||
from frigate.detectors.detection_api import DetectionApi
|
from frigate.detectors.detection_api import DetectionApi
|
||||||
from frigate.detectors.detector_config import BaseDetectorConfig, ModelTypeEnum
|
from frigate.detectors.detector_config import BaseDetectorConfig, ModelTypeEnum
|
||||||
from frigate.util.model import (
|
from frigate.util.model import (
|
||||||
@@ -49,10 +47,6 @@ class OvDetector(DetectionApi):
|
|||||||
logger.error(f"OpenVino model file {detector_config.model.path} not found.")
|
logger.error(f"OpenVino model file {detector_config.model.path} not found.")
|
||||||
raise FileNotFoundError
|
raise FileNotFoundError
|
||||||
|
|
||||||
os.makedirs(os.path.join(MODEL_CACHE_DIR, "openvino"), exist_ok=True)
|
|
||||||
self.ov_core.set_property(
|
|
||||||
{props.cache_dir: os.path.join(MODEL_CACHE_DIR, "openvino")}
|
|
||||||
)
|
|
||||||
self.interpreter = self.ov_core.compile_model(
|
self.interpreter = self.ov_core.compile_model(
|
||||||
model=detector_config.model.path, device_name=detector_config.device
|
model=detector_config.model.path, device_name=detector_config.device
|
||||||
)
|
)
|
||||||
@@ -65,7 +59,6 @@ class OvDetector(DetectionApi):
|
|||||||
)
|
)
|
||||||
self.model_invalid = True
|
self.model_invalid = True
|
||||||
|
|
||||||
# Ensure the SSD model has the right input and output shapes
|
|
||||||
if self.ov_model_type == ModelTypeEnum.ssd:
|
if self.ov_model_type == ModelTypeEnum.ssd:
|
||||||
model_inputs = self.interpreter.inputs
|
model_inputs = self.interpreter.inputs
|
||||||
model_outputs = self.interpreter.outputs
|
model_outputs = self.interpreter.outputs
|
||||||
@@ -81,12 +74,6 @@ class OvDetector(DetectionApi):
|
|||||||
)
|
)
|
||||||
self.model_invalid = True
|
self.model_invalid = True
|
||||||
|
|
||||||
if model_inputs[0].get_shape() != ov.Shape([1, self.w, self.h, 3]):
|
|
||||||
logger.error(
|
|
||||||
f"SSD model input doesn't match. Found {model_inputs[0].get_shape()}."
|
|
||||||
)
|
|
||||||
self.model_invalid = True
|
|
||||||
|
|
||||||
output_shape = model_outputs[0].get_shape()
|
output_shape = model_outputs[0].get_shape()
|
||||||
if output_shape[0] != 1 or output_shape[1] != 1 or output_shape[3] != 7:
|
if output_shape[0] != 1 or output_shape[1] != 1 or output_shape[3] != 7:
|
||||||
logger.error(f"SSD model output doesn't match. Found {output_shape}.")
|
logger.error(f"SSD model output doesn't match. Found {output_shape}.")
|
||||||
@@ -106,13 +93,6 @@ class OvDetector(DetectionApi):
|
|||||||
f"YoloNAS models must be exported in flat format and only have 1 output. Found {len(model_outputs)}."
|
f"YoloNAS models must be exported in flat format and only have 1 output. Found {len(model_outputs)}."
|
||||||
)
|
)
|
||||||
self.model_invalid = True
|
self.model_invalid = True
|
||||||
|
|
||||||
if model_inputs[0].get_shape() != ov.Shape([1, 3, self.w, self.h]):
|
|
||||||
logger.error(
|
|
||||||
f"YoloNAS model input doesn't match. Found {model_inputs[0].get_shape()}, but expected {[1, 3, self.w, self.h]}."
|
|
||||||
)
|
|
||||||
self.model_invalid = True
|
|
||||||
|
|
||||||
output_shape = model_outputs[0].partial_shape
|
output_shape = model_outputs[0].partial_shape
|
||||||
if output_shape[-1] != 7:
|
if output_shape[-1] != 7:
|
||||||
logger.error(
|
logger.error(
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import ctypes
|
import ctypes
|
||||||
import logging
|
import logging
|
||||||
|
import platform
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
@@ -219,6 +220,14 @@ class TensorRtDetector(DetectionApi):
|
|||||||
]
|
]
|
||||||
|
|
||||||
def __init__(self, detector_config: TensorRTDetectorConfig):
|
def __init__(self, detector_config: TensorRTDetectorConfig):
|
||||||
|
if platform.machine() == "x86_64":
|
||||||
|
logger.error(
|
||||||
|
"TensorRT detector is no longer supported on amd64 system. Please use ONNX detector instead, see https://docs.frigate.video/configuration/object_detectors#onnx for more information."
|
||||||
|
)
|
||||||
|
raise ImportError(
|
||||||
|
"TensorRT detector is no longer supported on amd64 system. Please use ONNX detector instead, see https://docs.frigate.video/configuration/object_detectors#onnx for more information."
|
||||||
|
)
|
||||||
|
|
||||||
assert TRT_SUPPORT, (
|
assert TRT_SUPPORT, (
|
||||||
f"TensorRT libraries not found, {DETECTOR_KEY} detector not present"
|
f"TensorRT libraries not found, {DETECTOR_KEY} detector not present"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ import json
|
|||||||
import logging
|
import logging
|
||||||
import multiprocessing as mp
|
import multiprocessing as mp
|
||||||
import os
|
import os
|
||||||
import re
|
|
||||||
import signal
|
import signal
|
||||||
import threading
|
import threading
|
||||||
from types import FrameType
|
from types import FrameType
|
||||||
from typing import Any, Optional, Union
|
from typing import Any, Optional, Union
|
||||||
|
|
||||||
|
import regex
|
||||||
from pathvalidate import ValidationError, sanitize_filename
|
from pathvalidate import ValidationError, sanitize_filename
|
||||||
from setproctitle import setproctitle
|
from setproctitle import setproctitle
|
||||||
|
|
||||||
@@ -243,7 +243,7 @@ class EmbeddingsContext:
|
|||||||
)
|
)
|
||||||
|
|
||||||
def rename_face(self, old_name: str, new_name: str) -> None:
|
def rename_face(self, old_name: str, new_name: str) -> None:
|
||||||
valid_name_pattern = r"^[a-zA-Z0-9\s_-]{1,50}$"
|
valid_name_pattern = r"^[\p{L}\p{N}\s'_-]{1,50}$"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
sanitized_old_name = sanitize_filename(old_name, replacement_text="_")
|
sanitized_old_name = sanitize_filename(old_name, replacement_text="_")
|
||||||
@@ -251,9 +251,9 @@ class EmbeddingsContext:
|
|||||||
except ValidationError as e:
|
except ValidationError as e:
|
||||||
raise ValueError(f"Invalid face name: {str(e)}")
|
raise ValueError(f"Invalid face name: {str(e)}")
|
||||||
|
|
||||||
if not re.match(valid_name_pattern, old_name):
|
if not regex.match(valid_name_pattern, old_name):
|
||||||
raise ValueError(f"Invalid old face name: {old_name}")
|
raise ValueError(f"Invalid old face name: {old_name}")
|
||||||
if not re.match(valid_name_pattern, new_name):
|
if not regex.match(valid_name_pattern, new_name):
|
||||||
raise ValueError(f"Invalid new face name: {new_name}")
|
raise ValueError(f"Invalid new face name: {new_name}")
|
||||||
if sanitized_old_name != old_name:
|
if sanitized_old_name != old_name:
|
||||||
raise ValueError(f"Old face name contains invalid characters: {old_name}")
|
raise ValueError(f"Old face name contains invalid characters: {old_name}")
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
"""SQLite-vec embeddings database."""
|
"""SQLite-vec embeddings database."""
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
|
import io
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from numpy import ndarray
|
from numpy import ndarray
|
||||||
|
from PIL import Image
|
||||||
from playhouse.shortcuts import model_to_dict
|
from playhouse.shortcuts import model_to_dict
|
||||||
|
|
||||||
from frigate.comms.inter_process import InterProcessRequestor
|
from frigate.comms.inter_process import InterProcessRequestor
|
||||||
@@ -199,14 +201,31 @@ class Embeddings:
|
|||||||
@param: upsert If embedding should be upserted into vec DB
|
@param: upsert If embedding should be upserted into vec DB
|
||||||
"""
|
"""
|
||||||
start = datetime.datetime.now().timestamp()
|
start = datetime.datetime.now().timestamp()
|
||||||
ids = list(event_thumbs.keys())
|
valid_ids = []
|
||||||
embeddings = self.vision_embedding(list(event_thumbs.values()))
|
valid_thumbs = []
|
||||||
|
for eid, thumb in event_thumbs.items():
|
||||||
|
try:
|
||||||
|
img = Image.open(io.BytesIO(thumb))
|
||||||
|
img.verify() # Will raise if corrupt
|
||||||
|
valid_ids.append(eid)
|
||||||
|
valid_thumbs.append(thumb)
|
||||||
|
except Exception as e:
|
||||||
|
logger.warning(
|
||||||
|
f"Embeddings reindexing: Skipping corrupt thumbnail for event {eid}: {e}"
|
||||||
|
)
|
||||||
|
|
||||||
|
if not valid_thumbs:
|
||||||
|
logger.warning(
|
||||||
|
"Embeddings reindexing: No valid thumbnails to embed in this batch."
|
||||||
|
)
|
||||||
|
return []
|
||||||
|
|
||||||
|
embeddings = self.vision_embedding(valid_thumbs)
|
||||||
|
|
||||||
if upsert:
|
if upsert:
|
||||||
items = []
|
items = []
|
||||||
|
for i in range(len(valid_ids)):
|
||||||
for i in range(len(ids)):
|
items.append(valid_ids[i])
|
||||||
items.append(ids[i])
|
|
||||||
items.append(serialize(embeddings[i]))
|
items.append(serialize(embeddings[i]))
|
||||||
self.image_eps.update()
|
self.image_eps.update()
|
||||||
|
|
||||||
@@ -214,12 +233,12 @@ class Embeddings:
|
|||||||
"""
|
"""
|
||||||
INSERT OR REPLACE INTO vec_thumbnails(id, thumbnail_embedding)
|
INSERT OR REPLACE INTO vec_thumbnails(id, thumbnail_embedding)
|
||||||
VALUES {}
|
VALUES {}
|
||||||
""".format(", ".join(["(?, ?)"] * len(ids))),
|
""".format(", ".join(["(?, ?)"] * len(valid_ids))),
|
||||||
items,
|
items,
|
||||||
)
|
)
|
||||||
|
|
||||||
duration = datetime.datetime.now().timestamp() - start
|
duration = datetime.datetime.now().timestamp() - start
|
||||||
self.text_inference_speed.update(duration / len(ids))
|
self.text_inference_speed.update(duration / len(valid_ids))
|
||||||
|
|
||||||
return embeddings
|
return embeddings
|
||||||
|
|
||||||
|
|||||||
@@ -491,6 +491,6 @@ def parse_preset_output_record(arg: Any, force_record_hvc1: bool) -> list[str]:
|
|||||||
|
|
||||||
if force_record_hvc1:
|
if force_record_hvc1:
|
||||||
# Apple only supports HEVC if it is hvc1 (vs. hev1)
|
# Apple only supports HEVC if it is hvc1 (vs. hev1)
|
||||||
preset += FFMPEG_HVC1_ARGS
|
return preset + FFMPEG_HVC1_ARGS
|
||||||
|
|
||||||
return preset
|
return preset
|
||||||
|
|||||||
+11
-5
@@ -1,3 +1,4 @@
|
|||||||
|
# In log.py
|
||||||
import atexit
|
import atexit
|
||||||
import logging
|
import logging
|
||||||
import multiprocessing as mp
|
import multiprocessing as mp
|
||||||
@@ -6,6 +7,7 @@ import sys
|
|||||||
import threading
|
import threading
|
||||||
from collections import deque
|
from collections import deque
|
||||||
from logging.handlers import QueueHandler, QueueListener
|
from logging.handlers import QueueHandler, QueueListener
|
||||||
|
from queue import Queue
|
||||||
from typing import Deque, Optional
|
from typing import Deque, Optional
|
||||||
|
|
||||||
from frigate.util.builtin import clean_camera_user_pass
|
from frigate.util.builtin import clean_camera_user_pass
|
||||||
@@ -32,12 +34,14 @@ LOG_HANDLER.addFilter(
|
|||||||
)
|
)
|
||||||
|
|
||||||
log_listener: Optional[QueueListener] = None
|
log_listener: Optional[QueueListener] = None
|
||||||
|
log_queue: Optional[Queue] = None
|
||||||
|
manager = None
|
||||||
|
|
||||||
|
|
||||||
def setup_logging() -> None:
|
def setup_logging() -> None:
|
||||||
global log_listener
|
global log_listener, log_queue, manager
|
||||||
|
manager = mp.Manager()
|
||||||
log_queue: mp.Queue = mp.Queue()
|
log_queue = manager.Queue()
|
||||||
log_listener = QueueListener(log_queue, LOG_HANDLER, respect_handler_level=True)
|
log_listener = QueueListener(log_queue, LOG_HANDLER, respect_handler_level=True)
|
||||||
|
|
||||||
atexit.register(_stop_logging)
|
atexit.register(_stop_logging)
|
||||||
@@ -53,11 +57,13 @@ def setup_logging() -> None:
|
|||||||
|
|
||||||
|
|
||||||
def _stop_logging() -> None:
|
def _stop_logging() -> None:
|
||||||
global log_listener
|
global log_listener, manager
|
||||||
|
|
||||||
if log_listener is not None:
|
if log_listener is not None:
|
||||||
log_listener.stop()
|
log_listener.stop()
|
||||||
log_listener = None
|
log_listener = None
|
||||||
|
if manager is not None:
|
||||||
|
manager.shutdown()
|
||||||
|
manager = None
|
||||||
|
|
||||||
|
|
||||||
# When a multiprocessing.Process exits, python tries to flush stdout and stderr. However, if the
|
# When a multiprocessing.Process exits, python tries to flush stdout and stderr. However, if the
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ def output_frames(
|
|||||||
move_preview_frames("cache")
|
move_preview_frames("cache")
|
||||||
|
|
||||||
for camera, cam_config in config.cameras.items():
|
for camera, cam_config in config.cameras.items():
|
||||||
if not cam_config.enabled:
|
if not cam_config.enabled_in_config:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
jsmpeg_cameras[camera] = JsmpegCamera(cam_config, stop_event, websocket_server)
|
jsmpeg_cameras[camera] = JsmpegCamera(cam_config, stop_event, websocket_server)
|
||||||
|
|||||||
@@ -403,6 +403,7 @@ class PreviewRecorder:
|
|||||||
self.reset_frame_cache(frame_time)
|
self.reset_frame_cache(frame_time)
|
||||||
|
|
||||||
def stop(self) -> None:
|
def stop(self) -> None:
|
||||||
|
self.config_subscriber.stop()
|
||||||
self.requestor.stop()
|
self.requestor.stop()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1109,6 +1109,7 @@ class PtzAutoTracker:
|
|||||||
camera_height = camera_config.frame_shape[0]
|
camera_height = camera_config.frame_shape[0]
|
||||||
camera_fps = camera_config.detect.fps
|
camera_fps = camera_config.detect.fps
|
||||||
predicted_movement_time = 0
|
predicted_movement_time = 0
|
||||||
|
zoom_distance = 0
|
||||||
|
|
||||||
average_velocity = np.zeros((4,))
|
average_velocity = np.zeros((4,))
|
||||||
predicted_box = obj.obj_data["box"]
|
predicted_box = obj.obj_data["box"]
|
||||||
@@ -1171,7 +1172,20 @@ class PtzAutoTracker:
|
|||||||
zoom_predicted_movement_time = 0
|
zoom_predicted_movement_time = 0
|
||||||
|
|
||||||
if np.any(average_velocity):
|
if np.any(average_velocity):
|
||||||
zoom_predicted_movement_time = abs(zoom) * self.zoom_time[camera]
|
# Calculate the intended change in zoom level
|
||||||
|
zoom_change = (1 - abs(zoom)) * (1 if zoom >= 0 else -1)
|
||||||
|
|
||||||
|
# Calculate new zoom level and clamp to [0, 1]
|
||||||
|
new_zoom = max(
|
||||||
|
0, min(1, self.ptz_metrics[camera].zoom_level.value + zoom_change)
|
||||||
|
)
|
||||||
|
|
||||||
|
# Calculate the actual zoom distance
|
||||||
|
zoom_distance = abs(
|
||||||
|
new_zoom - self.ptz_metrics[camera].zoom_level.value
|
||||||
|
)
|
||||||
|
|
||||||
|
zoom_predicted_movement_time = zoom_distance * self.zoom_time[camera]
|
||||||
|
|
||||||
zoom_predicted_box = (
|
zoom_predicted_box = (
|
||||||
predicted_box
|
predicted_box
|
||||||
@@ -1188,7 +1202,7 @@ class PtzAutoTracker:
|
|||||||
tilt = (0.5 - (centroid_y / camera_height)) * 2
|
tilt = (0.5 - (centroid_y / camera_height)) * 2
|
||||||
|
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"{camera}: Zoom amount: {zoom}, zoom predicted time: {zoom_predicted_movement_time}, zoom predicted box: {tuple(zoom_predicted_box)}"
|
f"{camera}: Zoom amount: {zoom}, zoom distance: {zoom_distance}, zoom predicted time: {zoom_predicted_movement_time}, zoom predicted box: {tuple(zoom_predicted_box)}"
|
||||||
)
|
)
|
||||||
|
|
||||||
self._enqueue_move(camera, obj.obj_data["frame_time"], pan, tilt, zoom)
|
self._enqueue_move(camera, obj.obj_data["frame_time"], pan, tilt, zoom)
|
||||||
|
|||||||
+12
-2
@@ -265,9 +265,15 @@ class OnvifController:
|
|||||||
"RelativeZoomTranslationSpace"
|
"RelativeZoomTranslationSpace"
|
||||||
][zoom_space_id]["URI"]
|
][zoom_space_id]["URI"]
|
||||||
else:
|
else:
|
||||||
if "Zoom" in move_request["Translation"]:
|
if (
|
||||||
|
move_request["Translation"] is not None
|
||||||
|
and "Zoom" in move_request["Translation"]
|
||||||
|
):
|
||||||
del move_request["Translation"]["Zoom"]
|
del move_request["Translation"]["Zoom"]
|
||||||
if "Zoom" in move_request["Speed"]:
|
if (
|
||||||
|
move_request["Speed"] is not None
|
||||||
|
and "Zoom" in move_request["Speed"]
|
||||||
|
):
|
||||||
del move_request["Speed"]["Zoom"]
|
del move_request["Speed"]["Zoom"]
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"{camera_name}: Relative move request after deleting zoom: {move_request}"
|
f"{camera_name}: Relative move request after deleting zoom: {move_request}"
|
||||||
@@ -792,6 +798,10 @@ class OnvifController:
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
logger.debug(
|
||||||
|
f"{camera_name}: Pan/tilt status: {pan_tilt_status}, Zoom status: {zoom_status}"
|
||||||
|
)
|
||||||
|
|
||||||
if pan_tilt_status == "IDLE" and (zoom_status is None or zoom_status == "IDLE"):
|
if pan_tilt_status == "IDLE" and (zoom_status is None or zoom_status == "IDLE"):
|
||||||
self.cams[camera_name]["active"] = False
|
self.cams[camera_name]["active"] = False
|
||||||
if not self.ptz_metrics[camera_name].motor_stopped.is_set():
|
if not self.ptz_metrics[camera_name].motor_stopped.is_set():
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ class RecordingExporter(threading.Thread):
|
|||||||
minutes = int(diff / 60)
|
minutes = int(diff / 60)
|
||||||
seconds = int(diff % 60)
|
seconds = int(diff % 60)
|
||||||
ffmpeg_cmd = [
|
ffmpeg_cmd = [
|
||||||
self.config.ffmpeg.ffmpeg_path,
|
"/usr/lib/ffmpeg/7.0/bin/ffmpeg", # hardcode path for exports thumbnail due to missing libwebp support
|
||||||
"-hide_banner",
|
"-hide_banner",
|
||||||
"-loglevel",
|
"-loglevel",
|
||||||
"warning",
|
"warning",
|
||||||
|
|||||||
@@ -48,8 +48,9 @@ class TestHttpReview(BaseTestHttp):
|
|||||||
################################### GET /review Endpoint ########################################################
|
################################### GET /review Endpoint ########################################################
|
||||||
####################################################################################################################
|
####################################################################################################################
|
||||||
|
|
||||||
# Does not return any data point since the end time (before parameter) is not passed and the review segment end_time is 2 seconds from now
|
def test_get_review_that_overlaps_default_period(self):
|
||||||
def test_get_review_no_filters_no_matches(self):
|
"""Test that a review item that starts during the default period
|
||||||
|
but ends after is included in the results."""
|
||||||
now = datetime.now().timestamp()
|
now = datetime.now().timestamp()
|
||||||
|
|
||||||
with TestClient(self.app) as client:
|
with TestClient(self.app) as client:
|
||||||
@@ -57,7 +58,7 @@ class TestHttpReview(BaseTestHttp):
|
|||||||
response = client.get("/review")
|
response = client.get("/review")
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
response_json = response.json()
|
response_json = response.json()
|
||||||
assert len(response_json) == 0
|
assert len(response_json) == 1
|
||||||
|
|
||||||
def test_get_review_no_filters(self):
|
def test_get_review_no_filters(self):
|
||||||
now = datetime.now().timestamp()
|
now = datetime.now().timestamp()
|
||||||
@@ -73,11 +74,13 @@ class TestHttpReview(BaseTestHttp):
|
|||||||
assert response_json[0]["has_been_reviewed"] == False
|
assert response_json[0]["has_been_reviewed"] == False
|
||||||
|
|
||||||
def test_get_review_with_time_filter_no_matches(self):
|
def test_get_review_with_time_filter_no_matches(self):
|
||||||
|
"""Test that review items outside the range are not returned."""
|
||||||
now = datetime.now().timestamp()
|
now = datetime.now().timestamp()
|
||||||
|
|
||||||
with TestClient(self.app) as client:
|
with TestClient(self.app) as client:
|
||||||
id = "123456.random"
|
id = "123456.random"
|
||||||
super().insert_mock_review_segment(id, now, now + 2)
|
super().insert_mock_review_segment(id, now - 2, now - 1)
|
||||||
|
super().insert_mock_review_segment(f"{id}2", now + 4, now + 5)
|
||||||
params = {
|
params = {
|
||||||
"after": now,
|
"after": now,
|
||||||
"before": now + 3,
|
"before": now + 3,
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class TestConfig(unittest.TestCase):
|
|||||||
"description": "Fine tuned model",
|
"description": "Fine tuned model",
|
||||||
"trainDate": "2023-04-28T23:22:01.262Z",
|
"trainDate": "2023-04-28T23:22:01.262Z",
|
||||||
"type": "ssd",
|
"type": "ssd",
|
||||||
"supportedDetectors": ["edgetpu"],
|
"supportedDetectors": ["cpu", "edgetpu"],
|
||||||
"width": 320,
|
"width": 320,
|
||||||
"height": 320,
|
"height": 320,
|
||||||
"inputShape": "nhwc",
|
"inputShape": "nhwc",
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ from typing import Any
|
|||||||
|
|
||||||
import cv2
|
import cv2
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from peewee import DoesNotExist
|
from peewee import SQL, DoesNotExist
|
||||||
|
|
||||||
from frigate.camera.state import CameraState
|
from frigate.camera.state import CameraState
|
||||||
from frigate.comms.config_updater import ConfigSubscriber
|
from frigate.comms.config_updater import ConfigSubscriber
|
||||||
@@ -29,9 +29,13 @@ from frigate.config import (
|
|||||||
RecordConfig,
|
RecordConfig,
|
||||||
SnapshotsConfig,
|
SnapshotsConfig,
|
||||||
)
|
)
|
||||||
from frigate.const import FAST_QUEUE_TIMEOUT, UPDATE_CAMERA_ACTIVITY
|
from frigate.const import (
|
||||||
|
FAST_QUEUE_TIMEOUT,
|
||||||
|
UPDATE_CAMERA_ACTIVITY,
|
||||||
|
UPSERT_REVIEW_SEGMENT,
|
||||||
|
)
|
||||||
from frigate.events.types import EventStateEnum, EventTypeEnum
|
from frigate.events.types import EventStateEnum, EventTypeEnum
|
||||||
from frigate.models import Event, Timeline
|
from frigate.models import Event, ReviewSegment, Timeline
|
||||||
from frigate.track.tracked_object import TrackedObject
|
from frigate.track.tracked_object import TrackedObject
|
||||||
from frigate.util.image import SharedMemoryFrameManager
|
from frigate.util.image import SharedMemoryFrameManager
|
||||||
|
|
||||||
@@ -152,7 +156,7 @@ class TrackedObjectProcessor(threading.Thread):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
def snapshot(camera, obj: TrackedObject, frame_name: str):
|
def snapshot(camera: str, obj: TrackedObject) -> bool:
|
||||||
mqtt_config: CameraMqttConfig = self.config.cameras[camera].mqtt
|
mqtt_config: CameraMqttConfig = self.config.cameras[camera].mqtt
|
||||||
if mqtt_config.enabled and self.should_mqtt_snapshot(camera, obj):
|
if mqtt_config.enabled and self.should_mqtt_snapshot(camera, obj):
|
||||||
jpg_bytes = obj.get_img_bytes(
|
jpg_bytes = obj.get_img_bytes(
|
||||||
@@ -185,6 +189,10 @@ class TrackedObjectProcessor(threading.Thread):
|
|||||||
retain=True,
|
retain=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
def camera_activity(camera, activity):
|
def camera_activity(camera, activity):
|
||||||
last_activity = self.camera_activity.get(camera)
|
last_activity = self.camera_activity.get(camera)
|
||||||
|
|
||||||
@@ -249,7 +257,7 @@ class TrackedObjectProcessor(threading.Thread):
|
|||||||
|
|
||||||
def should_mqtt_snapshot(self, camera, obj: TrackedObject):
|
def should_mqtt_snapshot(self, camera, obj: TrackedObject):
|
||||||
# object never changed position
|
# object never changed position
|
||||||
if obj.obj_data["position_changes"] == 0:
|
if obj.is_stationary():
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# if there are required zones and there is no overlap
|
# if there are required zones and there is no overlap
|
||||||
@@ -357,6 +365,60 @@ class TrackedObjectProcessor(threading.Thread):
|
|||||||
data=Timeline.data.update({"sub_label": (sub_label, score)})
|
data=Timeline.data.update({"sub_label": (sub_label, score)})
|
||||||
).where(Timeline.source_id == event_id).execute()
|
).where(Timeline.source_id == event_id).execute()
|
||||||
|
|
||||||
|
# only update ended review segments
|
||||||
|
# manually updating a sub_label from the UI is only possible for ended tracked objects
|
||||||
|
try:
|
||||||
|
review_segment = ReviewSegment.get(
|
||||||
|
(
|
||||||
|
SQL(
|
||||||
|
"json_extract(data, '$.detections') LIKE ?",
|
||||||
|
[f'%"{event_id}"%'],
|
||||||
|
)
|
||||||
|
)
|
||||||
|
& (ReviewSegment.end_time.is_null(False))
|
||||||
|
)
|
||||||
|
|
||||||
|
segment_data = review_segment.data
|
||||||
|
detection_ids = segment_data.get("detections", [])
|
||||||
|
|
||||||
|
# Rebuild objects list and sync sub_labels
|
||||||
|
objects_list = []
|
||||||
|
sub_labels = set()
|
||||||
|
events = Event.select(Event.id, Event.label, Event.sub_label).where(
|
||||||
|
Event.id.in_(detection_ids)
|
||||||
|
)
|
||||||
|
for det_event in events:
|
||||||
|
if det_event.sub_label:
|
||||||
|
sub_labels.add(det_event.sub_label)
|
||||||
|
objects_list.append(
|
||||||
|
f"{det_event.label}-verified"
|
||||||
|
) # eg, "bird-verified"
|
||||||
|
else:
|
||||||
|
objects_list.append(det_event.label) # eg, "bird"
|
||||||
|
|
||||||
|
segment_data["sub_labels"] = list(sub_labels)
|
||||||
|
segment_data["objects"] = objects_list
|
||||||
|
|
||||||
|
updated_data = {
|
||||||
|
ReviewSegment.id.name: review_segment.id,
|
||||||
|
ReviewSegment.camera.name: review_segment.camera,
|
||||||
|
ReviewSegment.start_time.name: review_segment.start_time,
|
||||||
|
ReviewSegment.end_time.name: review_segment.end_time,
|
||||||
|
ReviewSegment.severity.name: review_segment.severity,
|
||||||
|
ReviewSegment.thumb_path.name: review_segment.thumb_path,
|
||||||
|
ReviewSegment.data.name: segment_data,
|
||||||
|
}
|
||||||
|
|
||||||
|
self.requestor.send_data(UPSERT_REVIEW_SEGMENT, updated_data)
|
||||||
|
logger.debug(
|
||||||
|
f"Updated sub_label for event {event_id} in review segment {review_segment.id}"
|
||||||
|
)
|
||||||
|
|
||||||
|
except ReviewSegment.DoesNotExist:
|
||||||
|
logger.debug(
|
||||||
|
f"No review segment found with event ID {event_id} when updating sub_label"
|
||||||
|
)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def set_recognized_license_plate(
|
def set_recognized_license_plate(
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ from frigate.config import (
|
|||||||
)
|
)
|
||||||
from frigate.const import CLIPS_DIR, THUMB_DIR
|
from frigate.const import CLIPS_DIR, THUMB_DIR
|
||||||
from frigate.review.types import SeverityEnum
|
from frigate.review.types import SeverityEnum
|
||||||
|
from frigate.util.builtin import sanitize_float
|
||||||
from frigate.util.image import (
|
from frigate.util.image import (
|
||||||
area,
|
area,
|
||||||
calculate_region,
|
calculate_region,
|
||||||
@@ -202,6 +203,11 @@ class TrackedObject:
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# users can configure speed zones incorrectly, so sanitize speed_magnitude
|
||||||
|
# and velocity_angle in case the values come back as inf or NaN
|
||||||
|
speed_magnitude = sanitize_float(speed_magnitude)
|
||||||
|
self.velocity_angle = sanitize_float(self.velocity_angle)
|
||||||
|
|
||||||
if self.ui_config.unit_system == "metric":
|
if self.ui_config.unit_system == "metric":
|
||||||
self.current_estimated_speed = (
|
self.current_estimated_speed = (
|
||||||
speed_magnitude * 3.6
|
speed_magnitude * 3.6
|
||||||
@@ -344,6 +350,9 @@ class TrackedObject:
|
|||||||
|
|
||||||
self.obj_data.update(obj_data)
|
self.obj_data.update(obj_data)
|
||||||
self.current_zones = current_zones
|
self.current_zones = current_zones
|
||||||
|
logger.debug(
|
||||||
|
f"{self.camera_config.name}: Updating {obj_data['id']}: thumb update? {thumb_update}, significant change? {significant_change}, path update? {path_update}, autotracker update? {autotracker_update} "
|
||||||
|
)
|
||||||
return (thumb_update, significant_change, path_update, autotracker_update)
|
return (thumb_update, significant_change, path_update, autotracker_update)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
@@ -384,16 +393,16 @@ class TrackedObject:
|
|||||||
|
|
||||||
return event
|
return event
|
||||||
|
|
||||||
def is_active(self):
|
def is_active(self) -> bool:
|
||||||
return not self.is_stationary()
|
return not self.is_stationary()
|
||||||
|
|
||||||
def is_stationary(self):
|
def is_stationary(self) -> bool:
|
||||||
return (
|
return (
|
||||||
self.obj_data["motionless_count"]
|
self.obj_data["motionless_count"]
|
||||||
> self.camera_config.detect.stationary.threshold
|
> self.camera_config.detect.stationary.threshold
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_thumbnail(self, ext: str):
|
def get_thumbnail(self, ext: str) -> bytes | None:
|
||||||
img_bytes = self.get_img_bytes(
|
img_bytes = self.get_img_bytes(
|
||||||
ext, timestamp=False, bounding_box=False, crop=True, height=175
|
ext, timestamp=False, bounding_box=False, crop=True, height=175
|
||||||
)
|
)
|
||||||
@@ -404,13 +413,13 @@ class TrackedObject:
|
|||||||
_, img = cv2.imencode(f".{ext}", np.zeros((175, 175, 3), np.uint8))
|
_, img = cv2.imencode(f".{ext}", np.zeros((175, 175, 3), np.uint8))
|
||||||
return img.tobytes()
|
return img.tobytes()
|
||||||
|
|
||||||
def get_clean_png(self):
|
def get_clean_png(self) -> bytes | None:
|
||||||
if self.thumbnail_data is None:
|
if self.thumbnail_data is None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
best_frame = cv2.cvtColor(
|
best_frame = cv2.cvtColor(
|
||||||
self.frame_cache[self.thumbnail_data["frame_time"]],
|
self.frame_cache[self.thumbnail_data["frame_time"]]["frame"],
|
||||||
cv2.COLOR_YUV2BGR_I420,
|
cv2.COLOR_YUV2BGR_I420,
|
||||||
)
|
)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
@@ -433,13 +442,13 @@ class TrackedObject:
|
|||||||
crop=False,
|
crop=False,
|
||||||
height: int | None = None,
|
height: int | None = None,
|
||||||
quality: int | None = None,
|
quality: int | None = None,
|
||||||
):
|
) -> bytes | None:
|
||||||
if self.thumbnail_data is None:
|
if self.thumbnail_data is None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
best_frame = cv2.cvtColor(
|
best_frame = cv2.cvtColor(
|
||||||
self.frame_cache[self.thumbnail_data["frame_time"]],
|
self.frame_cache[self.thumbnail_data["frame_time"]]["frame"],
|
||||||
cv2.COLOR_YUV2BGR_I420,
|
cv2.COLOR_YUV2BGR_I420,
|
||||||
)
|
)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
@@ -474,6 +483,7 @@ class TrackedObject:
|
|||||||
# draw any attributes
|
# draw any attributes
|
||||||
for attribute in self.thumbnail_data["attributes"]:
|
for attribute in self.thumbnail_data["attributes"]:
|
||||||
box = attribute["box"]
|
box = attribute["box"]
|
||||||
|
box_area = int((box[2] - box[0]) * (box[3] - box[1]))
|
||||||
draw_box_with_label(
|
draw_box_with_label(
|
||||||
best_frame,
|
best_frame,
|
||||||
box[0],
|
box[0],
|
||||||
@@ -481,7 +491,7 @@ class TrackedObject:
|
|||||||
box[2],
|
box[2],
|
||||||
box[3],
|
box[3],
|
||||||
attribute["label"],
|
attribute["label"],
|
||||||
f"{attribute['score']:.0%}",
|
f"{attribute['score']:.0%} {str(box_area)}",
|
||||||
thickness=thickness,
|
thickness=thickness,
|
||||||
color=color,
|
color=color,
|
||||||
)
|
)
|
||||||
@@ -649,8 +659,9 @@ class TrackedObjectAttribute:
|
|||||||
best_object_id = obj["id"]
|
best_object_id = obj["id"]
|
||||||
best_object_label = obj["label"]
|
best_object_label = obj["label"]
|
||||||
else:
|
else:
|
||||||
if best_object_label == "car" and obj["label"] == "car":
|
if best_object_label == obj["label"]:
|
||||||
# if multiple cars are overlapping with the same label then the label will not be assigned
|
# if multiple objects of the same type are overlapping
|
||||||
|
# then the attribute will not be assigned
|
||||||
return None
|
return None
|
||||||
elif object_area < best_object_area:
|
elif object_area < best_object_area:
|
||||||
# if a car and person are overlapping then assign the label to the smaller object (which should be the person)
|
# if a car and person are overlapping then assign the label to the smaller object (which should be the person)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import ast
|
|||||||
import copy
|
import copy
|
||||||
import datetime
|
import datetime
|
||||||
import logging
|
import logging
|
||||||
|
import math
|
||||||
import multiprocessing as mp
|
import multiprocessing as mp
|
||||||
import queue
|
import queue
|
||||||
import re
|
import re
|
||||||
@@ -399,3 +400,10 @@ def serialize(
|
|||||||
def deserialize(bytes_data: bytes) -> list[float]:
|
def deserialize(bytes_data: bytes) -> list[float]:
|
||||||
"""Deserializes a compact "raw bytes" format into a list of floats"""
|
"""Deserializes a compact "raw bytes" format into a list of floats"""
|
||||||
return list(struct.unpack("%sf" % (len(bytes_data) // 4), bytes_data))
|
return list(struct.unpack("%sf" % (len(bytes_data) // 4), bytes_data))
|
||||||
|
|
||||||
|
|
||||||
|
def sanitize_float(value):
|
||||||
|
"""Replace NaN or inf with 0.0."""
|
||||||
|
if isinstance(value, (int, float)) and not math.isfinite(value):
|
||||||
|
return 0.0
|
||||||
|
return value
|
||||||
|
|||||||
@@ -345,6 +345,13 @@ def get_ort_providers(
|
|||||||
"device_type": device,
|
"device_type": device,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
elif provider == "MIGraphXExecutionProvider":
|
||||||
|
# MIGraphX uses more CPU than ROCM, while also being the same speed
|
||||||
|
if device == "MIGraphX":
|
||||||
|
providers.append(provider)
|
||||||
|
options.append({})
|
||||||
|
else:
|
||||||
|
continue
|
||||||
elif provider == "CPUExecutionProvider":
|
elif provider == "CPUExecutionProvider":
|
||||||
providers.append(provider)
|
providers.append(provider)
|
||||||
options.append(
|
options.append(
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import json
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import resource
|
||||||
import signal
|
import signal
|
||||||
import subprocess as sp
|
import subprocess as sp
|
||||||
import traceback
|
import traceback
|
||||||
@@ -304,13 +305,16 @@ def get_intel_gpu_stats(sriov: bool) -> Optional[dict[str, str]]:
|
|||||||
]
|
]
|
||||||
|
|
||||||
if sriov:
|
if sriov:
|
||||||
intel_gpu_top_command += ["-d", "drm:/dev/dri/card0"]
|
intel_gpu_top_command += ["-d", "sriov"]
|
||||||
|
|
||||||
p = sp.run(
|
try:
|
||||||
intel_gpu_top_command,
|
p = sp.run(
|
||||||
encoding="ascii",
|
intel_gpu_top_command,
|
||||||
capture_output=True,
|
encoding="ascii",
|
||||||
)
|
capture_output=True,
|
||||||
|
)
|
||||||
|
except UnicodeDecodeError:
|
||||||
|
return None
|
||||||
|
|
||||||
# timeout has a non-zero returncode when timeout is reached
|
# timeout has a non-zero returncode when timeout is reached
|
||||||
if p.returncode != 124:
|
if p.returncode != 124:
|
||||||
@@ -748,3 +752,19 @@ def process_logs(
|
|||||||
log_lines.append(dedup_message)
|
log_lines.append(dedup_message)
|
||||||
|
|
||||||
return len(log_lines), log_lines[start:end]
|
return len(log_lines), log_lines[start:end]
|
||||||
|
|
||||||
|
|
||||||
|
def set_file_limit() -> None:
|
||||||
|
# Newer versions of containerd 2.X+ impose a very low soft file limit of 1024
|
||||||
|
# This applies to OSs like HA OS (see https://github.com/home-assistant/operating-system/issues/4110)
|
||||||
|
# Attempt to increase this limit
|
||||||
|
soft_limit = int(os.getenv("SOFT_FILE_LIMIT", "65536") or "65536")
|
||||||
|
|
||||||
|
current_soft, current_hard = resource.getrlimit(resource.RLIMIT_NOFILE)
|
||||||
|
logger.debug(f"Current file limits - Soft: {current_soft}, Hard: {current_hard}")
|
||||||
|
|
||||||
|
new_soft = min(soft_limit, current_hard)
|
||||||
|
resource.setrlimit(resource.RLIMIT_NOFILE, (new_soft, current_hard))
|
||||||
|
logger.debug(
|
||||||
|
f"File limit set. New soft limit: {new_soft}, Hard limit remains: {current_hard}"
|
||||||
|
)
|
||||||
|
|||||||
@@ -59,6 +59,11 @@ def create_ground_plane(zone_points, distances):
|
|||||||
:param y: Y-coordinate in the image
|
:param y: Y-coordinate in the image
|
||||||
:return: Real-world distance per pixel at the given (x, y) coordinate
|
:return: Real-world distance per pixel at the given (x, y) coordinate
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# Return 0 if divide by zero would occur
|
||||||
|
if (B[0] - A[0]) == 0 or (D[1] - A[1]) == 0:
|
||||||
|
return 0
|
||||||
|
|
||||||
# Normalize x and y within the zone
|
# Normalize x and y within the zone
|
||||||
x_norm = (x - A[0]) / (B[0] - A[0])
|
x_norm = (x - A[0]) / (B[0] - A[0])
|
||||||
y_norm = (y - A[1]) / (D[1] - A[1])
|
y_norm = (y - A[1]) / (D[1] - A[1])
|
||||||
|
|||||||
+37
-27
@@ -208,7 +208,35 @@ class CameraWatchdog(threading.Thread):
|
|||||||
|
|
||||||
return self.config.enabled
|
return self.config.enabled
|
||||||
|
|
||||||
def run(self):
|
def reset_capture_thread(
|
||||||
|
self, terminate: bool = True, drain_output: bool = True
|
||||||
|
) -> None:
|
||||||
|
if terminate:
|
||||||
|
self.ffmpeg_detect_process.terminate()
|
||||||
|
try:
|
||||||
|
self.logger.info("Waiting for ffmpeg to exit gracefully...")
|
||||||
|
|
||||||
|
if drain_output:
|
||||||
|
self.ffmpeg_detect_process.communicate(timeout=30)
|
||||||
|
else:
|
||||||
|
self.ffmpeg_detect_process.wait(timeout=30)
|
||||||
|
except sp.TimeoutExpired:
|
||||||
|
self.logger.info("FFmpeg did not exit. Force killing...")
|
||||||
|
self.ffmpeg_detect_process.kill()
|
||||||
|
|
||||||
|
if drain_output:
|
||||||
|
self.ffmpeg_detect_process.communicate()
|
||||||
|
else:
|
||||||
|
self.ffmpeg_detect_process.wait()
|
||||||
|
|
||||||
|
self.logger.error(
|
||||||
|
"The following ffmpeg logs include the last 100 lines prior to exit."
|
||||||
|
)
|
||||||
|
self.logpipe.dump()
|
||||||
|
self.logger.info("Restarting ffmpeg...")
|
||||||
|
self.start_ffmpeg_detect()
|
||||||
|
|
||||||
|
def run(self) -> None:
|
||||||
if self._update_enabled_state():
|
if self._update_enabled_state():
|
||||||
self.start_all_ffmpeg()
|
self.start_all_ffmpeg()
|
||||||
|
|
||||||
@@ -235,24 +263,7 @@ class CameraWatchdog(threading.Thread):
|
|||||||
self.logger.error(
|
self.logger.error(
|
||||||
f"Ffmpeg process crashed unexpectedly for {self.camera_name}."
|
f"Ffmpeg process crashed unexpectedly for {self.camera_name}."
|
||||||
)
|
)
|
||||||
self.logger.error(
|
self.reset_capture_thread(terminate=False)
|
||||||
"The following ffmpeg logs include the last 100 lines prior to exit."
|
|
||||||
)
|
|
||||||
self.logpipe.dump()
|
|
||||||
self.start_ffmpeg_detect()
|
|
||||||
elif now - self.capture_thread.current_frame.value > 20:
|
|
||||||
self.camera_fps.value = 0
|
|
||||||
self.logger.info(
|
|
||||||
f"No frames received from {self.camera_name} in 20 seconds. Exiting ffmpeg..."
|
|
||||||
)
|
|
||||||
self.ffmpeg_detect_process.terminate()
|
|
||||||
try:
|
|
||||||
self.logger.info("Waiting for ffmpeg to exit gracefully...")
|
|
||||||
self.ffmpeg_detect_process.communicate(timeout=30)
|
|
||||||
except sp.TimeoutExpired:
|
|
||||||
self.logger.info("FFmpeg did not exit. Force killing...")
|
|
||||||
self.ffmpeg_detect_process.kill()
|
|
||||||
self.ffmpeg_detect_process.communicate()
|
|
||||||
elif self.camera_fps.value >= (self.config.detect.fps + 10):
|
elif self.camera_fps.value >= (self.config.detect.fps + 10):
|
||||||
self.fps_overflow_count += 1
|
self.fps_overflow_count += 1
|
||||||
|
|
||||||
@@ -262,14 +273,13 @@ class CameraWatchdog(threading.Thread):
|
|||||||
self.logger.info(
|
self.logger.info(
|
||||||
f"{self.camera_name} exceeded fps limit. Exiting ffmpeg..."
|
f"{self.camera_name} exceeded fps limit. Exiting ffmpeg..."
|
||||||
)
|
)
|
||||||
self.ffmpeg_detect_process.terminate()
|
self.reset_capture_thread(drain_output=False)
|
||||||
try:
|
elif now - self.capture_thread.current_frame.value > 20:
|
||||||
self.logger.info("Waiting for ffmpeg to exit gracefully...")
|
self.camera_fps.value = 0
|
||||||
self.ffmpeg_detect_process.communicate(timeout=30)
|
self.logger.info(
|
||||||
except sp.TimeoutExpired:
|
f"No frames received from {self.camera_name} in 20 seconds. Exiting ffmpeg..."
|
||||||
self.logger.info("FFmpeg did not exit. Force killing...")
|
)
|
||||||
self.ffmpeg_detect_process.kill()
|
self.reset_capture_thread()
|
||||||
self.ffmpeg_detect_process.communicate()
|
|
||||||
else:
|
else:
|
||||||
# process is running normally
|
# process is running normally
|
||||||
self.fps_overflow_count = 0
|
self.fps_overflow_count = 0
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# Notebooks
|
||||||
|
|
||||||
|
## YOLO-NAS Pretrained
|
||||||
|
|
||||||
|
You can build and download a compatible model with pre-trained weights using [Google Colab](https://colab.research.google.com/github/blakeblackshear/frigate/blob/dev/notebooks/YOLO_NAS_Pretrained_Export.ipynb).
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> The pre-trained YOLO-NAS weights from DeciAI are subject to their license and can't be used commercially. For more information, see: https://docs.deci.ai/super-gradients/latest/LICENSE.YOLONAS.html
|
||||||
|
|
||||||
|
The input image size in this notebook is set to 320x320. This results in lower CPU usage and faster inference times without impacting performance in most cases due to the way Frigate crops video frames to areas of interest before running detection. The notebook and config can be updated to 640x640 if desired. By default, YOLO_NAS_S is built with YOLO_NAS_M and YOLO_NAS_L sizes also being available for export.
|
||||||
Generated
+201
-11
@@ -25,7 +25,7 @@
|
|||||||
"@radix-ui/react-select": "^2.1.6",
|
"@radix-ui/react-select": "^2.1.6",
|
||||||
"@radix-ui/react-separator": "^1.1.2",
|
"@radix-ui/react-separator": "^1.1.2",
|
||||||
"@radix-ui/react-slider": "^1.2.3",
|
"@radix-ui/react-slider": "^1.2.3",
|
||||||
"@radix-ui/react-slot": "^1.1.2",
|
"@radix-ui/react-slot": "^1.2.2",
|
||||||
"@radix-ui/react-switch": "^1.1.3",
|
"@radix-ui/react-switch": "^1.1.3",
|
||||||
"@radix-ui/react-tabs": "^1.1.3",
|
"@radix-ui/react-tabs": "^1.1.3",
|
||||||
"@radix-ui/react-toggle": "^1.1.2",
|
"@radix-ui/react-toggle": "^1.1.2",
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
"nosleep.js": "^0.12.0",
|
"nosleep.js": "^0.12.0",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-apexcharts": "^1.4.1",
|
"react-apexcharts": "^1.4.1",
|
||||||
"react-day-picker": "^8.10.1",
|
"react-day-picker": "^9.7.0",
|
||||||
"react-device-detect": "^2.2.3",
|
"react-device-detect": "^2.2.3",
|
||||||
"react-dom": "^18.3.1",
|
"react-dom": "^18.3.1",
|
||||||
"react-dropzone": "^14.3.8",
|
"react-dropzone": "^14.3.8",
|
||||||
@@ -268,6 +268,12 @@
|
|||||||
"integrity": "sha512-U9DBDe5fxHmbwQww9rFxMLNI2Wlg7DhPzI7AVFpq8GehiUP7+NwuMPXpP4zAd52sgkxtOqOeMjgE5g0ZLnQZ0w==",
|
"integrity": "sha512-U9DBDe5fxHmbwQww9rFxMLNI2Wlg7DhPzI7AVFpq8GehiUP7+NwuMPXpP4zAd52sgkxtOqOeMjgE5g0ZLnQZ0w==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/@date-fns/tz": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@date-fns/tz/-/tz-1.2.0.tgz",
|
||||||
|
"integrity": "sha512-LBrd7MiJZ9McsOgxqWX7AaxrDjcFVjWH/tIKJd7pnR7McaslGYOP1QmmiBXdJH/H/yLCT+rcQ7FaPBUxRGUtrg==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/@esbuild/aix-ppc64": {
|
"node_modules/@esbuild/aix-ppc64": {
|
||||||
"version": "0.25.0",
|
"version": "0.25.0",
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.0.tgz",
|
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.0.tgz",
|
||||||
@@ -1244,6 +1250,24 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-slot": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-YAKxaiGsSQJ38VzKH86/BPRC4rh+b1Jpa+JneA5LRE7skmLPNAyeG8kPJj/oo4STLvlrs8vkf/iYyc3A5stYCQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@radix-ui/react-compose-refs": "1.1.1"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@types/react": "*",
|
||||||
|
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@types/react": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@radix-ui/react-arrow": {
|
"node_modules/@radix-ui/react-arrow": {
|
||||||
"version": "1.1.2",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-arrow/-/react-arrow-1.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/@radix-ui/react-arrow/-/react-arrow-1.1.2.tgz",
|
||||||
@@ -1346,6 +1370,24 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-slot": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-YAKxaiGsSQJ38VzKH86/BPRC4rh+b1Jpa+JneA5LRE7skmLPNAyeG8kPJj/oo4STLvlrs8vkf/iYyc3A5stYCQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@radix-ui/react-compose-refs": "1.1.1"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@types/react": "*",
|
||||||
|
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@types/react": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@radix-ui/react-compose-refs": {
|
"node_modules/@radix-ui/react-compose-refs": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.1.tgz",
|
||||||
@@ -1440,6 +1482,24 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-YAKxaiGsSQJ38VzKH86/BPRC4rh+b1Jpa+JneA5LRE7skmLPNAyeG8kPJj/oo4STLvlrs8vkf/iYyc3A5stYCQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@radix-ui/react-compose-refs": "1.1.1"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@types/react": "*",
|
||||||
|
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@types/react": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@radix-ui/react-direction": {
|
"node_modules/@radix-ui/react-direction": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-direction/-/react-direction-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@radix-ui/react-direction/-/react-direction-1.1.0.tgz",
|
||||||
@@ -1663,6 +1723,24 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-slot": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-YAKxaiGsSQJ38VzKH86/BPRC4rh+b1Jpa+JneA5LRE7skmLPNAyeG8kPJj/oo4STLvlrs8vkf/iYyc3A5stYCQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@radix-ui/react-compose-refs": "1.1.1"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@types/react": "*",
|
||||||
|
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@types/react": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@radix-ui/react-popover": {
|
"node_modules/@radix-ui/react-popover": {
|
||||||
"version": "1.1.6",
|
"version": "1.1.6",
|
||||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-popover/-/react-popover-1.1.6.tgz",
|
"resolved": "https://registry.npmjs.org/@radix-ui/react-popover/-/react-popover-1.1.6.tgz",
|
||||||
@@ -1700,6 +1778,24 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-slot": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-YAKxaiGsSQJ38VzKH86/BPRC4rh+b1Jpa+JneA5LRE7skmLPNAyeG8kPJj/oo4STLvlrs8vkf/iYyc3A5stYCQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@radix-ui/react-compose-refs": "1.1.1"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@types/react": "*",
|
||||||
|
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@types/react": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@radix-ui/react-popper": {
|
"node_modules/@radix-ui/react-popper": {
|
||||||
"version": "1.2.2",
|
"version": "1.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-popper/-/react-popper-1.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/@radix-ui/react-popper/-/react-popper-1.2.2.tgz",
|
||||||
@@ -1803,6 +1899,24 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-YAKxaiGsSQJ38VzKH86/BPRC4rh+b1Jpa+JneA5LRE7skmLPNAyeG8kPJj/oo4STLvlrs8vkf/iYyc3A5stYCQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@radix-ui/react-compose-refs": "1.1.1"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@types/react": "*",
|
||||||
|
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@types/react": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@radix-ui/react-radio-group": {
|
"node_modules/@radix-ui/react-radio-group": {
|
||||||
"version": "1.2.3",
|
"version": "1.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-radio-group/-/react-radio-group-1.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/@radix-ui/react-radio-group/-/react-radio-group-1.2.3.tgz",
|
||||||
@@ -1940,6 +2054,24 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-slot": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-YAKxaiGsSQJ38VzKH86/BPRC4rh+b1Jpa+JneA5LRE7skmLPNAyeG8kPJj/oo4STLvlrs8vkf/iYyc3A5stYCQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@radix-ui/react-compose-refs": "1.1.1"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@types/react": "*",
|
||||||
|
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@types/react": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@radix-ui/react-separator": {
|
"node_modules/@radix-ui/react-separator": {
|
||||||
"version": "1.1.2",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-separator/-/react-separator-1.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/@radix-ui/react-separator/-/react-separator-1.1.2.tgz",
|
||||||
@@ -1997,12 +2129,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@radix-ui/react-slot": {
|
"node_modules/@radix-ui/react-slot": {
|
||||||
"version": "1.1.2",
|
"version": "1.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.2.2.tgz",
|
||||||
"integrity": "sha512-YAKxaiGsSQJ38VzKH86/BPRC4rh+b1Jpa+JneA5LRE7skmLPNAyeG8kPJj/oo4STLvlrs8vkf/iYyc3A5stYCQ==",
|
"integrity": "sha512-y7TBO4xN4Y94FvcWIOIh18fM4R1A8S4q1jhoz4PNzOoHsFcN8pogcFmZrTYAm4F9VRUrWP/Mw7xSKybIeRI+CQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@radix-ui/react-compose-refs": "1.1.1"
|
"@radix-ui/react-compose-refs": "1.1.2"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@types/react": "*",
|
"@types/react": "*",
|
||||||
@@ -2014,6 +2146,21 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@radix-ui/react-slot/node_modules/@radix-ui/react-compose-refs": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-z4eqJvfiNnFMHIIvXP3CY57y2WJs5g2v3X0zm9mEJkrkNv4rDxu+sg9Jh8EkXyeqBkB7SOcboo9dMVqhyrACIg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"peerDependencies": {
|
||||||
|
"@types/react": "*",
|
||||||
|
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@types/react": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@radix-ui/react-switch": {
|
"node_modules/@radix-ui/react-switch": {
|
||||||
"version": "1.1.3",
|
"version": "1.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-switch/-/react-switch-1.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/@radix-ui/react-switch/-/react-switch-1.1.3.tgz",
|
||||||
@@ -2161,6 +2308,24 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-YAKxaiGsSQJ38VzKH86/BPRC4rh+b1Jpa+JneA5LRE7skmLPNAyeG8kPJj/oo4STLvlrs8vkf/iYyc3A5stYCQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@radix-ui/react-compose-refs": "1.1.1"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@types/react": "*",
|
||||||
|
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@types/react": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@radix-ui/react-use-callback-ref": {
|
"node_modules/@radix-ui/react-use-callback-ref": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.1.0.tgz",
|
||||||
@@ -4395,11 +4560,18 @@
|
|||||||
"version": "3.6.0",
|
"version": "3.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.6.0.tgz",
|
||||||
"integrity": "sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww==",
|
"integrity": "sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww==",
|
||||||
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/kossnocorp"
|
"url": "https://github.com/sponsors/kossnocorp"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/date-fns-jalali": {
|
||||||
|
"version": "4.1.0-0",
|
||||||
|
"resolved": "https://registry.npmjs.org/date-fns-jalali/-/date-fns-jalali-4.1.0-0.tgz",
|
||||||
|
"integrity": "sha512-hTIP/z+t+qKwBDcmmsnmjWTduxCg+5KfdqWQvb2X/8C9+knYY6epN/pfxdDuyVlSVeFz0sM5eEfwIUQ70U4ckg==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/date-fns-tz": {
|
"node_modules/date-fns-tz": {
|
||||||
"version": "3.2.0",
|
"version": "3.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/date-fns-tz/-/date-fns-tz-3.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/date-fns-tz/-/date-fns-tz-3.2.0.tgz",
|
||||||
@@ -7196,16 +7368,34 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/react-day-picker": {
|
"node_modules/react-day-picker": {
|
||||||
"version": "8.10.1",
|
"version": "9.7.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-day-picker/-/react-day-picker-8.10.1.tgz",
|
"resolved": "https://registry.npmjs.org/react-day-picker/-/react-day-picker-9.7.0.tgz",
|
||||||
"integrity": "sha512-TMx7fNbhLk15eqcMt+7Z7S2KF7mfTId/XJDjKE8f+IUcFn0l08/kI4FiYTL/0yuOLmEcbR4Fwe3GJf/NiiMnPA==",
|
"integrity": "sha512-urlK4C9XJZVpQ81tmVgd2O7lZ0VQldZeHzNejbwLWZSkzHH498KnArT0EHNfKBOWwKc935iMLGZdxXPRISzUxQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@date-fns/tz": "1.2.0",
|
||||||
|
"date-fns": "4.1.0",
|
||||||
|
"date-fns-jalali": "4.1.0-0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "individual",
|
"type": "individual",
|
||||||
"url": "https://github.com/sponsors/gpbl"
|
"url": "https://github.com/sponsors/gpbl"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"date-fns": "^2.28.0 || ^3.0.0",
|
"react": ">=16.8.0"
|
||||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
}
|
||||||
|
},
|
||||||
|
"node_modules/react-day-picker/node_modules/date-fns": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-4.1.0.tgz",
|
||||||
|
"integrity": "sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"funding": {
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/kossnocorp"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/react-device-detect": {
|
"node_modules/react-device-detect": {
|
||||||
|
|||||||
+2
-2
@@ -31,7 +31,7 @@
|
|||||||
"@radix-ui/react-select": "^2.1.6",
|
"@radix-ui/react-select": "^2.1.6",
|
||||||
"@radix-ui/react-separator": "^1.1.2",
|
"@radix-ui/react-separator": "^1.1.2",
|
||||||
"@radix-ui/react-slider": "^1.2.3",
|
"@radix-ui/react-slider": "^1.2.3",
|
||||||
"@radix-ui/react-slot": "^1.1.2",
|
"@radix-ui/react-slot": "^1.2.2",
|
||||||
"@radix-ui/react-switch": "^1.1.3",
|
"@radix-ui/react-switch": "^1.1.3",
|
||||||
"@radix-ui/react-tabs": "^1.1.3",
|
"@radix-ui/react-tabs": "^1.1.3",
|
||||||
"@radix-ui/react-toggle": "^1.1.2",
|
"@radix-ui/react-toggle": "^1.1.2",
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
"nosleep.js": "^0.12.0",
|
"nosleep.js": "^0.12.0",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-apexcharts": "^1.4.1",
|
"react-apexcharts": "^1.4.1",
|
||||||
"react-day-picker": "^8.10.1",
|
"react-day-picker": "^9.7.0",
|
||||||
"react-device-detect": "^2.2.3",
|
"react-device-detect": "^2.2.3",
|
||||||
"react-dom": "^18.3.1",
|
"react-dom": "^18.3.1",
|
||||||
"react-dropzone": "^14.3.8",
|
"react-dropzone": "^14.3.8",
|
||||||
|
|||||||
@@ -3,25 +3,25 @@
|
|||||||
"snort": "نَفْخَة",
|
"snort": "نَفْخَة",
|
||||||
"heartbeat": "نَبْض القَلْب",
|
"heartbeat": "نَبْض القَلْب",
|
||||||
"pets": "حَيَوَانَات أَلِيفَة",
|
"pets": "حَيَوَانَات أَلِيفَة",
|
||||||
"whoop": "هُتَاف",
|
"whoop": "هتاف",
|
||||||
"humming": "هَمْهَمَة",
|
"humming": "هَمْهَمَة",
|
||||||
"chewing": "مَضْغ",
|
"chewing": "مَضْغ",
|
||||||
"yodeling": "تَزَلْغُط",
|
"yodeling": "غناء متقلب",
|
||||||
"howl": "عُوَاء",
|
"howl": "عُوَاء",
|
||||||
"speech": "كَلَام",
|
"speech": "تحدث",
|
||||||
"hiccup": "فُوَاق",
|
"hiccup": "فُوَاق",
|
||||||
"dog": "كَلْب",
|
"dog": "كَلْب",
|
||||||
"yip": "نُبَيْحَة",
|
"yip": "نُبَيْحَة",
|
||||||
"babbling": "ثَرْثَرَة",
|
"babbling": "ثرثرة",
|
||||||
"yell": "صُرَاخ",
|
"yell": "صراخ",
|
||||||
"bellow": "خُوَار",
|
"bellow": "زمجرة",
|
||||||
"whispering": "هَمْس",
|
"whispering": "همس",
|
||||||
"laughter": "ضَحِك",
|
"laughter": "ضحك",
|
||||||
"snicker": "تَضَاحُك",
|
"snicker": "ضحكة خفيفه",
|
||||||
"crying": "بُكَاء",
|
"crying": "بكاء",
|
||||||
"sigh": "تَنَهُّد",
|
"sigh": "تنهد",
|
||||||
"singing": "غِنَاء",
|
"singing": "غناء",
|
||||||
"choir": "جَوْقَة",
|
"choir": "فرقة غناء",
|
||||||
"chant": "تَرْنِيم",
|
"chant": "تَرْنِيم",
|
||||||
"mantra": "تَرْنِيمَة",
|
"mantra": "تَرْنِيمَة",
|
||||||
"child_singing": "غِنَاء طِفْل",
|
"child_singing": "غِنَاء طِفْل",
|
||||||
@@ -67,5 +67,8 @@
|
|||||||
"caterwaul": "صُرَاخ مُتَوَاصِل",
|
"caterwaul": "صُرَاخ مُتَوَاصِل",
|
||||||
"livestock": "مَاشِيَة",
|
"livestock": "مَاشِيَة",
|
||||||
"horse": "حِصَان",
|
"horse": "حِصَان",
|
||||||
"clip_clop": "حَوَافِر الخَيْل"
|
"clip_clop": "حَوَافِر الخَيْل",
|
||||||
|
"car": "سيارة",
|
||||||
|
"motorcycle": "دراجة نارية",
|
||||||
|
"bicycle": "دراجة هوائية"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1,8 @@
|
|||||||
{}
|
{
|
||||||
|
"time": {
|
||||||
|
"untilForTime": "حتى {{time}}",
|
||||||
|
"untilForRestart": "حتى يعاد تشغيل فرايجيت.",
|
||||||
|
"untilRestart": "حتى إعادة التشغيل",
|
||||||
|
"ago": "منذ {{timeAgo}}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1 +1,10 @@
|
|||||||
{}
|
{
|
||||||
|
"form": {
|
||||||
|
"password": "كلمة السر",
|
||||||
|
"user": "أسم المستخدم",
|
||||||
|
"login": "تسجيل الدخول",
|
||||||
|
"errors": {
|
||||||
|
"usernameRequired": "اسم المستخدم مطلوب"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1 +1,10 @@
|
|||||||
{}
|
{
|
||||||
|
"group": {
|
||||||
|
"label": "مجموعات الكاميرات",
|
||||||
|
"add": "إضافة مجموعة الكاميرات",
|
||||||
|
"edit": "تعديل مجموعة الكاميرات",
|
||||||
|
"delete": {
|
||||||
|
"label": "حذف مجموعة الكاميرات"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1 +1,9 @@
|
|||||||
{}
|
{
|
||||||
|
"restart": {
|
||||||
|
"title": "هل أنت متأكد أنك تريد إعادة تشغيل فرايجيت؟",
|
||||||
|
"button": "إعادة التشغيل",
|
||||||
|
"restarting": {
|
||||||
|
"title": "يتم إعادة تشغيل فرايجيت"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1 +1,9 @@
|
|||||||
{}
|
{
|
||||||
|
"filter": "ترشيح",
|
||||||
|
"labels": {
|
||||||
|
"label": "التسميات",
|
||||||
|
"all": {
|
||||||
|
"title": "كل التسميات"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user