Compare commits

...

12 Commits

Author SHA1 Message Date
Brian Horakh
444eecfd8e
Merge ab59fdf570 into 352d271fe4 2026-02-24 12:36:43 -08:00
Josh Hawkins
352d271fe4
Update HA docs with MQTT example (#22098)
* update HA docs with MQTT example

* format block as yaml
2026-02-23 10:25:03 -06:00
Kai Curry
a6e11a59d6
docs: Add detail to face recognition MQTT update docs (#21942)
* Add detail to face recognition MQTT update docs

Clarify that the weighted average favors larger faces and
higher-confidence detections, that unknown attempts are excluded,
and document when name/score will be null/0.0.

* Fix score decimal in MQTT face recognition documentation

`0.0` in JSON is just `0`.

* Clarify score is a running weighted average

* Simplify MQTT tracked_object_update docs with inline comments

Move scoring logic details to face recognition docs and keep
MQTT reference concise with inline field comments and links.

* fix (expand) lpr doc link

* rm obvious lpr comments

---------

Co-authored-by: Kai Curry <kai@wjerk.com>
2026-02-23 06:46:55 -07:00
Kai Curry
a7d8d13d9a
docs: Add frame selection and clean copy details to snapshots docs (#21946)
* docs: Add frame selection and clean copy details to snapshots docs

Document how Frigate selects the best frame for snapshots, explain the
difference between regular snapshots and clean copies, fix internal
links to use absolute paths, and highlight Frigate+ as the primary
reason to keep clean_copy enabled if regular snapshot is configured clean.

* revert - do not use the word event

* rm clean copy is only saved when `clean_copy` is enabled

* Simplified the Frame Selection section down to a single paragraph.

* rm note about snapshot file ext change from png to webp

---------

Co-authored-by: Kai Curry <kai@wjerk.com>
2026-02-23 06:45:29 -07:00
Matt Rusiniak
4d51f7a1bb
Fix script for downloading RF-DETR (#22083) 2026-02-22 07:57:27 -07:00
Brian H
ab59fdf570 fix: clean up duplicate SoC list and fix RKNN converter for rk3588s
- Remove unused supported_socs variable in rknn.py that duplicated
  the SUPPORTED_RK_SOCS constant from frigate.const
- Add rk3588s to rk3588 mapping in rknn_converter.py to ensure custom
  ONNX model conversion works on RK3588S devices

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 20:49:46 +11:00
Brian Horakh
075ea3305c
Update frigate/detectors/plugins/rknn.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-02 19:49:58 +11:00
Brian H
8f99733638 ci: add Rockchip build workflow for fork
- Builds and publishes to ghcr.io/elasticdotventures/frigate
- Triggers on push to dev and fix-rk3588s-support branches
- Can be manually triggered via workflow_dispatch
- Tags: {sha}-rk and latest-rk
2026-02-01 18:21:47 +11:00
Brian H
6f18ea8fde fix: remove trailing whitespace for ruff format check 2026-02-01 18:15:04 +11:00
Brian H
a7042a7c0b fix: add rk3588s support with model mapping to rk3588
- Add rk3588s to SUPPORTED_RK_SOCS list
- Map rk3588s to rk3588 for model downloads (models are compatible)
- Update documentation to include rk3588s in supported SoCs
- Addresses feedback from blakeblackshear/frigate#20441
2026-02-01 17:38:21 +11:00
Brian Horakh
dea03ea099
Merge branch 'dev' into fix-rk3588s-support 2026-02-01 17:33:45 +11:00
b
68877f51fb fix: allow rk3588s in RKNN detector (#20440) 2025-10-12 16:25:45 +11:00
9 changed files with 125 additions and 19 deletions

66
.github/workflows/build-rk.yml vendored Normal file
View File

@ -0,0 +1,66 @@
name: Build Rockchip
on:
workflow_dispatch:
push:
branches:
- dev
- fix-rk3588s-support
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
rockchip_build:
runs-on: ubuntu-latest
name: Build Rockchip Image
permissions:
contents: read
packages: write
steps:
- name: Check out code
uses: actions/checkout@v4
- id: lowercaseRepo
uses: ASzc/change-string-case-action@v6
with:
string: ${{ github.repository }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create version file
run: make version
- name: Create short sha
id: sha
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
- name: Build and push Rockchip image
uses: docker/bake-action@v5
with:
push: true
targets: rk
files: docker/rockchip/rk.hcl
set: |
rk.tags=ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ steps.sha.outputs.SHORT_SHA }}-rk
rk.tags=ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:latest-rk
*.cache-from=type=gha
*.cache-to=type=gha,mode=max
- name: Show image tags
run: |
echo "Images published:"
echo " ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ steps.sha.outputs.SHORT_SHA }}-rk"
echo " ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:latest-rk"

View File

@ -1352,7 +1352,7 @@ To convert a onnx model to the rknn format using the [rknn-toolkit2](https://git
This is an example configuration file that you need to adjust to your specific onnx model:
```yaml
soc: ["rk3562", "rk3566", "rk3568", "rk3576", "rk3588"]
soc: ["rk3562", "rk3566", "rk3568", "rk3576", "rk3588", "rk3588s"]
quantization: false
output_name: "{input_basename}"
@ -1514,11 +1514,11 @@ RF-DETR can be exported as ONNX by running the command below. You can copy and p
```sh
docker build . --build-arg MODEL_SIZE=Nano --rm --output . -f- <<'EOF'
FROM python:3.11 AS build
FROM python:3.12 AS build
RUN apt-get update && apt-get install --no-install-recommends -y libgl1 && rm -rf /var/lib/apt/lists/*
COPY --from=ghcr.io/astral-sh/uv:0.8.0 /uv /bin/
COPY --from=ghcr.io/astral-sh/uv:0.10.4 /uv /bin/
WORKDIR /rfdetr
RUN uv pip install --system rfdetr[onnxexport] torch==2.8.0 onnx==1.19.1 onnxscript
RUN uv pip install --system rfdetr[onnxexport] torch==2.8.0 onnx==1.19.1 transformers==4.57.6 onnxscript
ARG MODEL_SIZE
RUN python3 -c "from rfdetr import RFDETR${MODEL_SIZE}; x = RFDETR${MODEL_SIZE}(resolution=320); x.export(simplify=True)"
FROM scratch

View File

@ -9,4 +9,25 @@ Snapshots are accessible in the UI in the Explore pane. This allows for quick su
To only save snapshots for objects that enter a specific zone, [see the zone docs](./zones.md#restricting-snapshots-to-specific-zones)
Snapshots sent via MQTT are configured in the [config file](https://docs.frigate.video/configuration/) under `cameras -> your_camera -> mqtt`
Snapshots sent via MQTT are configured in the [config file](/configuration) under `cameras -> your_camera -> mqtt`
## Frame Selection
Frigate does not save every frame — it picks a single "best" frame for each tracked object and uses it for both the snapshot and clean copy. As the object is tracked across frames, Frigate continuously evaluates whether the current frame is better than the previous best based on detection confidence, object size, and the presence of key attributes like faces or license plates. Frames where the object touches the edge of the frame are deprioritized. The snapshot is written to disk once tracking ends using whichever frame was determined to be the best.
MQTT snapshots are published more frequently — each time a better thumbnail frame is found during tracking, or when the current best image is older than `best_image_timeout` (default: 60s). These use their own annotation settings configured under `cameras -> your_camera -> mqtt`.
## Clean Copy
Frigate can produce up to two snapshot files per event, each used in different places:
| Version | File | Annotations | Used by |
| --- | --- | --- | --- |
| **Regular snapshot** | `<camera>-<id>.jpg` | Respects your `timestamp`, `bounding_box`, `crop`, and `height` settings | API (`/api/events/<id>/snapshot.jpg`), MQTT (`<camera>/<label>/snapshot`), Explore pane in the UI |
| **Clean copy** | `<camera>-<id>-clean.webp` | Always unannotated — no bounding box, no timestamp, no crop, full resolution | API (`/api/events/<id>/snapshot-clean.webp`), [Frigate+](/plus/first_model) submissions, "Download Clean Snapshot" in the UI |
MQTT snapshots are configured separately under `cameras -> your_camera -> mqtt` and are unrelated to the clean copy.
The clean copy is required for submitting events to [Frigate+](/plus/first_model) — if you plan to use Frigate+, keep `clean_copy` enabled regardless of your other snapshot settings.
If you are not using Frigate+ and `timestamp`, `bounding_box`, and `crop` are all disabled, the regular snapshot is already effectively clean, so `clean_copy` provides no benefit and only uses additional disk space. You can safely set `clean_copy: False` in this case.

View File

@ -273,6 +273,7 @@ Frigate supports hardware video processing on all Rockchip boards. However, hard
- RK3568
- RK3576
- RK3588
- RK3588S
| Name | YOLOv9 Inference Time | YOLO-NAS Inference Time | YOLOx Inference Time |
| -------------- | --------------------- | --------------------------- | ----------------------- |

View File

@ -16,7 +16,15 @@ See the [MQTT integration
documentation](https://www.home-assistant.io/integrations/mqtt/) for more
details.
In addition, MQTT must be enabled in your Frigate configuration file and Frigate must be connected to the same MQTT server as Home Assistant for many of the entities created by the integration to function.
In addition, MQTT must be enabled in your Frigate configuration file and Frigate must be connected to the same MQTT server as Home Assistant for many of the entities created by the integration to function, e.g.:
```yaml
mqtt:
enabled: True
host: mqtt.server.com # the address of your HA server that's running the MQTT integration
user: your_mqtt_broker_username
password: your_mqtt_broker_password
```
### Integration installation
@ -95,12 +103,12 @@ services:
If you are using Home Assistant Add-on, the URL should be one of the following depending on which Add-on variant you are using. Note that if you are using the Proxy Add-on, you should NOT point the integration at the proxy URL. Just enter the same URL used to access Frigate directly from your network.
| Add-on Variant | URL |
| -------------------------- | ----------------------------------------- |
| Frigate | `http://ccab4aaf-frigate:5000` |
| Frigate (Full Access) | `http://ccab4aaf-frigate-fa:5000` |
| Frigate Beta | `http://ccab4aaf-frigate-beta:5000` |
| Frigate Beta (Full Access) | `http://ccab4aaf-frigate-fa-beta:5000` |
| Add-on Variant | URL |
| -------------------------- | -------------------------------------- |
| Frigate | `http://ccab4aaf-frigate:5000` |
| Frigate (Full Access) | `http://ccab4aaf-frigate-fa:5000` |
| Frigate Beta | `http://ccab4aaf-frigate-beta:5000` |
| Frigate Beta (Full Access) | `http://ccab4aaf-frigate-fa-beta:5000` |
### Frigate running on a separate machine

View File

@ -120,7 +120,7 @@ Message published for each changed tracked object. The first message is publishe
### `frigate/tracked_object_update`
Message published for updates to tracked object metadata, for example:
Message published for updates to tracked object metadata. All messages include an `id` field which is the tracked object's event ID, and can be used to look up the event via the API or match it to items in the UI.
#### Generative AI Description Update
@ -134,12 +134,14 @@ Message published for updates to tracked object metadata, for example:
#### Face Recognition Update
Published after each recognition attempt, regardless of whether the score meets `recognition_threshold`. See the [Face Recognition](/configuration/face_recognition) documentation for details on how scoring works.
```json
{
"type": "face",
"id": "1607123955.475377-mxklsc",
"name": "John",
"score": 0.95,
"name": "John", // best matching person, or null if no match
"score": 0.95, // running weighted average across all recognition attempts
"camera": "front_door_cam",
"timestamp": 1607123958.748393
}
@ -147,11 +149,13 @@ Message published for updates to tracked object metadata, for example:
#### License Plate Recognition Update
Published when a license plate is recognized on a car object. See the [License Plate Recognition](/configuration/license_plate_recognition) documentation for details.
```json
{
"type": "lpr",
"id": "1607123955.475377-mxklsc",
"name": "John's Car",
"name": "John's Car", // known name for the plate, or null
"plate": "123ABC",
"score": 0.95,
"camera": "driveway_cam",

View File

@ -78,7 +78,7 @@ FFMPEG_HWACCEL_AMF = "preset-amd-amf"
FFMPEG_HVC1_ARGS = ["-tag:v", "hvc1"]
# RKNN constants
SUPPORTED_RK_SOCS = ["rk3562", "rk3566", "rk3568", "rk3576", "rk3588"]
SUPPORTED_RK_SOCS = ["rk3562", "rk3566", "rk3568", "rk3576", "rk3588", "rk3588s"]
# Regex constants

View File

@ -90,6 +90,9 @@ class Rknn(DetectionApi):
def parse_model_input(self, model_path, soc):
model_props = {}
# Map rk3588s to rk3588 for model compatibility
model_soc = "rk3588" if soc == "rk3588s" else soc
# find out if user provides his own model
# user provided models should be a path and contain a "/"
if "/" in model_path:
@ -146,7 +149,7 @@ class Rknn(DetectionApi):
model_props["model_type"] = model_type
if model_matched:
model_props["filename"] = model_path + f"-{soc}-v2.3.2-2.rknn"
model_props["filename"] = model_path + f"-{model_soc}-v2.3.2-2.rknn"
model_props["path"] = model_cache_dir + model_props["filename"]

View File

@ -189,13 +189,16 @@ def convert_onnx_to_rknn(
logger.debug("Could not determine SoC type")
return False
# Map rk3588s to rk3588 for RKNN toolkit compatibility
target_soc = "rk3588" if soc == "rk3588s" else soc
# Get model config for the specified type
if model_type not in MODEL_TYPE_CONFIGS:
logger.debug(f"Unsupported model type: {model_type}")
return False
config = MODEL_TYPE_CONFIGS[model_type].copy()
config["target_platform"] = soc
config["target_platform"] = target_soc
# RKNN toolkit requires .onnx extension, create temporary copy if needed
temp_onnx_path = None