Compare commits

..

No commits in common. "ea3a72b4dc81316a132fa78d0a2a3f3d8cdcf77c" and "7568c1da32654652c5713db097f719a9f9ae4875" have entirely different histories.

12 changed files with 80 additions and 122 deletions

View File

@ -0,0 +1,13 @@
#!/bin/bash
set -euxo pipefail
if [[ "${TARGETARCH}" == "amd64" ]]; then
arch="x86_64"
elif [[ "${TARGETARCH}" == "arm64" ]]; then
arch="aarch64"
fi
wget -qO- "https://github.com/GaryHuang-ASUS/frigate-synaptics-rt/releases/download/v1.5.0-1.0/synaptics-rt-1.0.tar" | tar -C / -xzf -
wget -P /wheels/ "https://github.com/synaptics-synap/synap-python/releases/download/v0.0.4-preview/synap_python-0.0.4-cp311-cp311-manylinux_2_35_aarch64.whl"

View File

@ -0,0 +1,34 @@
# syntax=docker/dockerfile:1.4
ARG DEBIAN_FRONTEND=noninteractive
FROM --platform=linux/amd64 debian:12-slim AS poky-toolchain
ARG DEBIAN_FRONTEND
RUN apt-get update \
&& apt-get install -y wget xz-utils \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /tmp
RUN wget -O /tmp/toolchain.sh.000 https://github.com/synaptics-astra/sdk/releases/download/v1.5.0/sl1680_oobe-poky-glibc-x86_64-astra-media-oobe-cortexa73-sl1680-toolchain-4.0.17.sh.000 \
&& wget -O /tmp/toolchain.sh.001 https://github.com/synaptics-astra/sdk/releases/download/v1.5.0/sl1680_oobe-poky-glibc-x86_64-astra-media-oobe-cortexa73-sl1680-toolchain-4.0.17.sh.001 \
&& cat /tmp/toolchain.sh.* > /tmp/toolchain.sh \
&& chmod +x /tmp/toolchain.sh \
&& /tmp/toolchain.sh -y -d /opt/poky/4.0.17
FROM deps AS synap1680-deps
ARG TARGETARCH
# Install dependencies
RUN --mount=type=bind,source=docker/synap1680/install_deps.sh,target=/deps/install_deps.sh \
/deps/install_deps.sh
WORKDIR /opt/frigate/
COPY --from=rootfs / /
COPY --from=poky-toolchain /opt/poky/4.0.17/sysroots/cortexa73-poky-linux/usr/lib/libtim-vx.so /rootfs/usr/lib/
COPY --from=poky-toolchain /opt/poky/4.0.17/sysroots/cortexa73-poky-linux/usr/lib/libtensorflow-lite.so /rootfs/usr/lib/
COPY --from=poky-toolchain /opt/poky/4.0.17/sysroots/cortexa73-poky-linux/usr/lib/libvx_delegate.so /rootfs/usr/lib/
COPY --from=poky-toolchain /opt/poky/4.0.17/sysroots/cortexa73-poky-linux/usr/lib/libsynapnb.so /rootfs/usr/lib/
COPY --from=poky-toolchain /opt/poky/4.0.17/sysroots/cortexa73-poky-linux/usr/lib/libebg_utils.so /rootfs/usr/lib/
COPY --from=poky-toolchain /opt/poky/4.0.17/sysroots/cortexa73-poky-linux/usr/lib/libovxlib.so /rootfs/usr/lib/
ADD https://github.com/synaptics-astra/synap-release/blob/v1.5.0/models/dolphin/object_detection/coco/model/mobilenet224_full80/model.synap /model.synap

View File

@ -0,0 +1,15 @@
#!/bin/bash
set -euxo pipefail
apt-get -qq update
if [[ "${TARGETARCH}" == "amd64" ]]; then
arch="x86_64"
elif [[ "${TARGETARCH}" == "arm64" ]]; then
arch="aarch64"
fi
wget -qO- "https://github.com/GaryHuang-ASUS/frigate-synaptics-rt/releases/download/v1.5.0-1.0/synaptics-rt-1.0.tar" | tar -C / -xzf -
wget -P /wheels/ "https://github.com/synaptics-synap/synap-python/releases/download/v0.0.4-preview/synap_python-0.0.4-cp311-cp311-manylinux_2_35_aarch64.whl"
cp /rootfs/usr/local/lib/* /usr/local/lib

View File

@ -16,8 +16,8 @@ target rootfs {
target = "rootfs"
}
target synaptics {
dockerfile = "docker/synaptics/Dockerfile"
target synap1680 {
dockerfile = "docker/synap1680/Dockerfile"
contexts = {
wheels = "target:wheels",
deps = "target:deps",

View File

@ -0,0 +1,15 @@
BOARDS += synap1680
local-synap1680: version
docker buildx bake --file=docker/synap1680/synap1680.hcl synap1680 \
--set synap1680.tags=frigate:latest-synap1680 \
--load
build-synap1680: version
docker buildx bake --file=docker/synap1680/synap1680.hcl synap1680 \
--set synap1680.tags=$(IMAGE_REPO):${GITHUB_REF_NAME}-$(COMMIT_HASH)-synap1680
push-synap1680: build-synap1680
docker buildx bake --file=docker/synap1680/synap1680.hcl synap1680 \
--set synap1680.tags=$(IMAGE_REPO):${GITHUB_REF_NAME}-$(COMMIT_HASH)-synap1680 \
--push

View File

@ -1,15 +0,0 @@
BOARDS += synaptics
local-synaptics: version
docker buildx bake --file=docker/synaptics/synaptics.hcl synaptics \
--set synaptics.tags=frigate:latest-synaptics \
--load
build-synaptics: version
docker buildx bake --file=docker/synaptics/synaptics.hcl synaptics \
--set synaptics.tags=$(IMAGE_REPO):${GITHUB_REF_NAME}-$(COMMIT_HASH)-synaptics
push-synaptics: build-synaptics
docker buildx bake --file=docker/synaptics/synaptics.hcl synaptics \
--set synaptics.tags=$(IMAGE_REPO):${GITHUB_REF_NAME}-$(COMMIT_HASH)-synaptics \
--push

View File

@ -428,29 +428,3 @@ cameras:
```
:::
## Synaptics
Hardware accelerated video de-/encoding is supported on Synpatics SL-series SoC.
### Prerequisites
Make sure to follow the [Synaptics specific installation instructions](/frigate/installation#synaptics).
### Configuration
Add one of the following FFmpeg presets to your `config.yml` to enable hardware video processing:
```yaml
ffmpeg:
hwaccel_args: -c:v h264_v4l2m2m
input_args: preset-rtsp-restream
output_args:
record: preset-record-generic-audio-aac
```
:::warning
Make sure that your SoC supports hardware acceleration for your input stream and your input stream is h264 encoding. For example, if your camera streams with h264 encoding, your SoC must be able to de- and encode with it. If you are unsure whether your SoC meets the requirements, take a look at the datasheet.
:::

View File

@ -40,10 +40,6 @@ Frigate supports multiple different detectors that work on different types of ha
- [RKNN](#rockchip-platform): RKNN models can run on Rockchip devices with included NPUs.
**Synaptics**
- [Synaptics](#synaptics): synap models can run on Synaptics devices(e.g astra machina) with included NPUs.
**For Testing**
- [CPU Detector (not recommended for actual use](#cpu-detector-not-recommended): Use a CPU to run tflite model, this is not recommended and in most cases OpenVINO can be used in CPU mode with better results.
@ -842,35 +838,6 @@ model:
height: 320 # MUST match the chosen model i.e yolov7-320 -> 320 yolov4-416 -> 416
```
## Synaptics
Hardware accelerated object detection is supported on the following SoCs:
- SL1680
This implementation uses the [Synaptics model conversion](https://synaptics-synap.github.io/doc/v/latest/docs/manual/introduction.html#offline-model-conversion), version v3.1.0.
See the [installation docs](../frigate/installation.md#synaptics) for information on configuring the SL-series NPU hardware.
### Configuration
When configuring the Synap detector, you have to specify the model: a local **path**.
#### SSD
Use this configuration for ssd models. Here's a default pre-converted ssd model under the root folder.
```yaml
detectors:
synap_npu:
type: synaptics
model:
path: /model.synap
width: 224
height: 224
```
## Rockchip platform
Hardware accelerated object detection is supported on the following SoCs:

View File

@ -90,21 +90,8 @@ Frigate supports multiple different detectors that work on different types of ha
- Runs best with tiny or small size models
- Runs efficiently on low power hardware
**Synaptics**
- [Synaptics](#synaptics): synap models can run on Synaptics devices(e.g astra machina) with included NPUs to provide efficient object detection.
:::
### Synaptics
- **Synaptics** Default model is **mobilenet**
| Name | Synaptics SL1680 Inference Time |
| ---------------- | ------------------------------- |
| ssd mobilenet | ~ 25 ms |
| yolov5m | ~ 118 ms |
### Hailo-8
Frigate supports both the Hailo-8 and Hailo-8L AI Acceleration Modules on compatible hardware platforms—including the Raspberry Pi 5 with the PCIe hat from the AI kit. The Hailo detector integration in Frigate automatically identifies your hardware type and selects the appropriate default model when a custom model isnt provided.

View File

@ -185,37 +185,6 @@ or add these options to your `docker run` command:
Next, you should configure [hardware object detection](/configuration/object_detectors#rockchip-platform) and [hardware video processing](/configuration/hardware_acceleration_video#rockchip-platform).
### Synaptics
- SL1680
#### Setup
Follow Frigate's default installation instructions, but use a docker image with `-synaptics` suffix for example `ghcr.io/blakeblackshear/frigate:stable-synaptics`.
Next, you need to grant docker permissions to access your hardware:
- During the configuration process, you should run docker in privileged mode to avoid any errors due to insufficient permissions. To do so, add `privileged: true` to your `docker-compose.yml` file or the `--privileged` flag to your docker run command.
```yaml
devices:
- /dev/synap
- /dev/video0
- /dev/video1
```
or add these options to your `docker run` command:
```
--device /dev/synap \
--device /dev/video0 \
--device /dev/video1
```
#### Configuration
Next, you should configure [hardware object detection](/configuration/object_detectors#synaptics) and [hardware video processing](/configuration/hardware_acceleration_video#synaptics).
## Docker
Running through Docker with Docker Compose is the recommended install method.

View File

@ -1,4 +1,3 @@
import os
import logging
from typing_extensions import Literal
@ -14,7 +13,7 @@ from frigate.detectors.detector_config import BaseDetectorConfig, ModelTypeEnum
logger = logging.getLogger(__name__)
DETECTOR_KEY = "synaptics"
DETECTOR_KEY = "synap1680"
class SynapDetectorConfig(BaseDetectorConfig):