Skip to content

Commit 5ad8505

Browse files
committed
Merge branch 'dev' of github.com:blakeblackshear/frigate into testing
2 parents 90ab521 + 898d1de commit 5ad8505

File tree

261 files changed

+8317
-755
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

261 files changed

+8317
-755
lines changed

docker/rockchip/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,7 @@ ADD https://github.com/MarcA711/rknn-toolkit2/releases/download/v2.3.2/librknnrt
3030

3131
ADD --chmod=111 https://github.com/MarcA711/Rockchip-FFmpeg-Builds/releases/download/6.1-11/ffmpeg /usr/lib/ffmpeg/6.0/bin/
3232
ADD --chmod=111 https://github.com/MarcA711/Rockchip-FFmpeg-Builds/releases/download/6.1-11/ffprobe /usr/lib/ffmpeg/6.0/bin/
33+
ADD --chmod=111 https://github.com/MarcA711/Rockchip-FFmpeg-Builds/releases/download/7.1-1/ffmpeg /usr/lib/ffmpeg/7.0/bin/
34+
ADD --chmod=111 https://github.com/MarcA711/Rockchip-FFmpeg-Builds/releases/download/7.1-1/ffprobe /usr/lib/ffmpeg/7.0/bin/
3335
ENV DEFAULT_FFMPEG_VERSION="6.0"
3436
ENV INCLUDED_FFMPEG_VERSIONS="${DEFAULT_FFMPEG_VERSION}:${INCLUDED_FFMPEG_VERSIONS}"

docker/tensorrt/Dockerfile.amd64

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,29 @@ ARG DEBIAN_FRONTEND=noninteractive
66
# Globally set pip break-system-packages option to avoid having to specify it every time
77
ARG PIP_BREAK_SYSTEM_PACKAGES=1
88

9-
FROM tensorrt-base AS frigate-tensorrt
9+
FROM wheels AS trt-wheels
1010
ARG PIP_BREAK_SYSTEM_PACKAGES
11-
ENV TRT_VER=8.6.1
1211

1312
# Install TensorRT wheels
1413
COPY docker/tensorrt/requirements-amd64.txt /requirements-tensorrt.txt
15-
RUN pip3 install -U -r /requirements-tensorrt.txt && ldconfig
14+
COPY docker/main/requirements-wheels.txt /requirements-wheels.txt
15+
RUN pip3 wheel --wheel-dir=/trt-wheels -c /requirements-wheels.txt -r /requirements-tensorrt.txt
16+
17+
FROM deps AS frigate-tensorrt
18+
ARG PIP_BREAK_SYSTEM_PACKAGES
19+
20+
RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \
21+
pip3 uninstall -y onnxruntime-openvino tensorflow-cpu \
22+
&& pip3 install -U /deps/trt-wheels/*.whl
1623

17-
WORKDIR /opt/frigate/
1824
COPY --from=rootfs / /
25+
COPY docker/tensorrt/detector/rootfs/etc/ld.so.conf.d /etc/ld.so.conf.d
26+
RUN ldconfig
27+
28+
WORKDIR /opt/frigate/
1929

2030
# Dev Container w/ TRT
2131
FROM devcontainer AS devcontainer-trt
2232

23-
COPY --from=trt-deps /usr/local/lib/libyolo_layer.so /usr/local/lib/libyolo_layer.so
24-
COPY --from=trt-deps /usr/local/src/tensorrt_demos /usr/local/src/tensorrt_demos
25-
COPY --from=trt-deps /usr/local/cuda-12.1 /usr/local/cuda
26-
COPY docker/tensorrt/detector/rootfs/ /
27-
COPY --from=trt-deps /usr/local/lib/libyolo_layer.so /usr/local/lib/libyolo_layer.so
2833
RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \
2934
pip3 install -U /deps/trt-wheels/*.whl

docker/tensorrt/Dockerfile.arm64

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,61 @@
1-
# syntax=docker/dockerfile:1.4
1+
# syntax=docker/dockerfile:1.6
22

33
# https://askubuntu.com/questions/972516/debian-frontend-environment-variable
44
ARG DEBIAN_FRONTEND=noninteractive
5-
65
ARG BASE_IMAGE
6+
ARG TRT_BASE=nvcr.io/nvidia/tensorrt:23.12-py3
7+
8+
# Build TensorRT-specific library
9+
FROM ${TRT_BASE} AS trt-deps
10+
11+
ARG TARGETARCH
12+
ARG COMPUTE_LEVEL
13+
14+
RUN apt-get update \
15+
&& apt-get install -y git build-essential cuda-nvcc-* cuda-nvtx-* libnvinfer-dev libnvinfer-plugin-dev libnvparsers-dev libnvonnxparsers-dev \
16+
&& rm -rf /var/lib/apt/lists/*
17+
RUN --mount=type=bind,source=docker/tensorrt/detector/tensorrt_libyolo.sh,target=/tensorrt_libyolo.sh \
18+
/tensorrt_libyolo.sh
19+
20+
# COPY required individual CUDA deps
21+
RUN mkdir -p /usr/local/cuda-deps
22+
RUN if [ "$TARGETARCH" = "amd64" ]; then \
23+
cp /usr/local/cuda-12.3/targets/x86_64-linux/lib/libcurand.so.* /usr/local/cuda-deps/ && \
24+
cp /usr/local/cuda-12.3/targets/x86_64-linux/lib/libnvrtc.so.* /usr/local/cuda-deps/ && \
25+
cd /usr/local/cuda-deps/ && \
26+
for lib in libnvrtc.so.*; do \
27+
if [[ "$lib" =~ libnvrtc.so\.([0-9]+\.[0-9]+\.[0-9]+) ]]; then \
28+
version="${BASH_REMATCH[1]}"; \
29+
ln -sf "libnvrtc.so.$version" libnvrtc.so; \
30+
fi; \
31+
done && \
32+
for lib in libcurand.so.*; do \
33+
if [[ "$lib" =~ libcurand.so\.([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+) ]]; then \
34+
version="${BASH_REMATCH[1]}"; \
35+
ln -sf "libcurand.so.$version" libcurand.so; \
36+
fi; \
37+
done; \
38+
fi
39+
40+
# Frigate w/ TensorRT Support as separate image
41+
FROM deps AS tensorrt-base
42+
43+
#Disable S6 Global timeout
44+
ENV S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0
45+
46+
# COPY TensorRT Model Generation Deps
47+
COPY --from=trt-deps /usr/local/lib/libyolo_layer.so /usr/local/lib/libyolo_layer.so
48+
COPY --from=trt-deps /usr/local/src/tensorrt_demos /usr/local/src/tensorrt_demos
49+
50+
# COPY Individual CUDA deps folder
51+
COPY --from=trt-deps /usr/local/cuda-deps /usr/local/cuda
52+
53+
COPY docker/tensorrt/detector/rootfs/ /
54+
ENV YOLO_MODELS=""
55+
56+
HEALTHCHECK --start-period=600s --start-interval=5s --interval=15s --timeout=5s --retries=3 \
57+
CMD curl --fail --silent --show-error http://127.0.0.1:5000/api/version || exit 1
58+
759
FROM ${BASE_IMAGE} AS build-wheels
860
ARG DEBIAN_FRONTEND
961

@@ -100,4 +152,4 @@ WORKDIR /opt/frigate/
100152
COPY --from=rootfs / /
101153

102154
# Fixes "Error importing detector runtime: /usr/lib/aarch64-linux-gnu/libstdc++.so.6: cannot allocate memory in static TLS block"
103-
ENV LD_PRELOAD /usr/lib/aarch64-linux-gnu/libstdc++.so.6
155+
ENV LD_PRELOAD /usr/lib/aarch64-linux-gnu/libstdc++.so.6

docker/tensorrt/Dockerfile.base

Lines changed: 0 additions & 57 deletions
This file was deleted.
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
/usr/local/lib
2-
/usr/local/cuda
3-
/usr/local/lib/python3.11/dist-packages/tensorrt
41
/usr/local/lib/python3.11/dist-packages/nvidia/cudnn/lib
52
/usr/local/lib/python3.11/dist-packages/nvidia/cuda_runtime/lib
63
/usr/local/lib/python3.11/dist-packages/nvidia/cublas/lib
7-
/usr/local/lib/python3.11/dist-packages/nvidia/cufft/lib
4+
/usr/local/lib/python3.11/dist-packages/nvidia/cufft/lib
5+
/usr/local/lib/python3.11/dist-packages/nvidia/curand/lib/
6+
/usr/local/lib/python3.11/dist-packages/nvidia/cuda_nvrtc/lib/
Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
# NVidia TensorRT Support (amd64 only)
22
--extra-index-url 'https://pypi.nvidia.com'
3-
numpy < 1.24; platform_machine == 'x86_64'
4-
tensorrt == 8.6.1; platform_machine == 'x86_64'
5-
tensorrt_bindings == 8.6.1; platform_machine == 'x86_64'
6-
cuda-python == 11.8.*; platform_machine == 'x86_64'
7-
cython == 3.0.*; platform_machine == 'x86_64'
8-
nvidia-cuda-runtime-cu12 == 12.1.*; platform_machine == 'x86_64'
9-
nvidia-cuda-runtime-cu11 == 11.8.*; platform_machine == 'x86_64'
10-
nvidia-cublas-cu11 == 11.11.3.6; platform_machine == 'x86_64'
11-
nvidia-cudnn-cu11 == 8.6.0.*; platform_machine == 'x86_64'
12-
nvidia-cudnn-cu12 == 9.5.0.*; platform_machine == 'x86_64'
13-
nvidia-cufft-cu11==10.*; platform_machine == 'x86_64'
14-
nvidia-cufft-cu12==11.*; platform_machine == 'x86_64'
3+
cython==3.0.*; platform_machine == 'x86_64'
4+
nvidia_cuda_cupti_cu12==12.5.82; platform_machine == 'x86_64'
5+
nvidia-cublas-cu12==12.5.3.*; platform_machine == 'x86_64'
6+
nvidia-cudnn-cu12==9.3.0.*; platform_machine == 'x86_64'
7+
nvidia-cufft-cu12==11.2.3.*; platform_machine == 'x86_64'
8+
nvidia-curand-cu12==10.3.6.*; platform_machine == 'x86_64'
9+
nvidia_cuda_nvcc_cu12==12.5.82; platform_machine == 'x86_64'
10+
nvidia-cuda-nvrtc-cu12==12.5.82; platform_machine == 'x86_64'
11+
nvidia_cuda_runtime_cu12==12.5.82; platform_machine == 'x86_64'
12+
nvidia_cusolver_cu12==11.6.3.*; platform_machine == 'x86_64'
13+
nvidia_cusparse_cu12==12.5.1.*; platform_machine == 'x86_64'
14+
nvidia_nccl_cu12==2.23.4; platform_machine == 'x86_64'
15+
nvidia_nvjitlink_cu12==12.5.82; platform_machine == 'x86_64'
1516
onnx==1.16.*; platform_machine == 'x86_64'
1617
onnxruntime-gpu==1.20.*; platform_machine == 'x86_64'
1718
protobuf==3.20.3; platform_machine == 'x86_64'

docker/tensorrt/trt.hcl

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,13 @@ target "trt-deps" {
7979
inherits = ["_build_args"]
8080
}
8181

82-
target "tensorrt-base" {
83-
dockerfile = "docker/tensorrt/Dockerfile.base"
84-
context = "."
85-
contexts = {
86-
deps = "target:deps",
87-
}
88-
inherits = ["_build_args"]
89-
}
90-
9182
target "tensorrt" {
9283
dockerfile = "docker/tensorrt/Dockerfile.${ARCH}"
9384
context = "."
9485
contexts = {
9586
wget = "target:wget",
96-
tensorrt-base = "target:tensorrt-base",
87+
wheels = "target:wheels",
88+
deps = "target:deps",
9789
rootfs = "target:rootfs"
9890
}
9991
target = "frigate-tensorrt"

docs/docs/configuration/authentication.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,15 @@ python3 -c 'import secrets; print(secrets.token_hex(64))'
112112

113113
### Header mapping
114114

115-
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.
115+
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-Groups` 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.
116116

117117
```yaml
118118
proxy:
119119
...
120120
separator: "|" # This value defaults to a comma, but Authentik uses a pipe, for example.
121121
header_map:
122122
user: x-forwarded-user
123-
role: x-forwarded-role
123+
role: x-forwarded-groups
124124
```
125125

126126
Frigate supports both `admin` and `viewer` roles (see below). When using port `8971`, Frigate validates these headers and subsequent requests use the headers `remote-user` and `remote-role` for authorization.

docs/docs/configuration/face_recognition.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Fine-tune face recognition with these optional parameters at the global level of
6767
- Default: `0.8`.
6868
- `recognition_threshold`: Recognition confidence score required to add the face to the object as a sub label.
6969
- Default: `0.9`.
70-
- `min_faces`: Min face attempts for the sub label to be applied to the person object.
70+
- `min_faces`: Min face recognitions for the sub label to be applied to the person object.
7171
- Default: `1`
7272
- `save_attempts`: Number of images of recognized faces to save for training.
7373
- Default: `100`.

docs/docs/configuration/ffmpeg_presets.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ cameras:
7171
7272
Output args presets help make the config more readable and handle use cases for different types of streams to ensure consistent recordings.
7373
74-
| Preset | Usage | Other Notes |
75-
| -------------------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
76-
| preset-record-generic | Record WITHOUT audio | This is the default when nothing is specified |
77-
| preset-record-generic-audio-copy | Record WITH original audio | Use this to enable audio in recordings |
78-
| 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 |
79-
| preset-record-mjpeg | Record an mjpeg stream | Recommend restreaming mjpeg stream instead |
80-
| preset-record-jpeg | Record live jpeg | Recommend restreaming live jpeg instead |
81-
| preset-record-ubiquiti | Record ubiquiti stream with audio | Recordings with ubiquiti non-standard audio |
74+
| Preset | Usage | Other Notes |
75+
| -------------------------------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
76+
| 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 |
77+
| preset-record-generic-audio-copy | Record WITH original audio | Use this to enable audio in recordings |
78+
| 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 |
79+
| preset-record-mjpeg | Record an mjpeg stream | Recommend restreaming mjpeg stream instead |
80+
| preset-record-jpeg | Record live jpeg | Recommend restreaming live jpeg instead |
81+
| preset-record-ubiquiti | Record ubiquiti stream with audio | Recordings with ubiquiti non-standard audio |

0 commit comments

Comments
 (0)