Skip to content

Commit 0ac400d

Browse files
authored
Merge branch 'blakeblackshear:dev' into testing
2 parents 5ad8505 + 8254602 commit 0ac400d

Some content is hidden

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

97 files changed

+1408
-139
lines changed

docs/docs/configuration/object_detectors.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,8 @@ detectors:
365365
366366
model:
367367
model_type: rfdetr
368-
width: 560
369-
height: 560
368+
width: 320
369+
height: 320
370370
input_tensor: nchw
371371
input_dtype: float
372372
path: /config/model_cache/rfdetr.onnx
@@ -616,8 +616,8 @@ detectors:
616616
617617
model:
618618
model_type: rfdetr
619-
width: 560
620-
height: 560
619+
width: 320
620+
height: 320
621621
input_tensor: nchw
622622
input_dtype: float
623623
path: /config/model_cache/rfdetr.onnx
@@ -777,8 +777,8 @@ model:
777777
labelmap_path: /labelmap/coco-80.txt
778778
input_tensor: nchw
779779
input_pixel_format: rgb
780-
width: 320
781-
height: 320
780+
width: 320 # MUST match the chosen model i.e yolov7-320 -> 320, yolov4-416 -> 416
781+
height: 320 # MUST match the chosen model i.e yolov7-320 -> 320 yolov4-416 -> 416
782782
```
783783
784784
## Rockchip platform
@@ -983,22 +983,21 @@ Make sure you change the batch size to 1 before exporting.
983983

984984
### Download RF-DETR Model
985985

986-
To export as ONNX:
987-
988-
1. `pip3 install rfdetr`
989-
2. `python3`
990-
3. `from rfdetr import RFDETRBase`
991-
4. `x = RFDETRBase()`
992-
5. `x.export()`
993-
994-
#### Additional Configuration
986+
RF-DETR can be exported as ONNX by running the command below. You can copy and paste the whole thing to your terminal and execute, altering `MODEL_SIZE=Nano` in the first line to `Nano`, `Small`, or `Medium` size.
995987

996-
The input tensor resolution can be customized:
997-
998-
```python
999-
from rfdetr import RFDETRBase
1000-
x = RFDETRBase(resolution=560) # resolution must be a multiple of 56
1001-
x.export()
988+
```sh
989+
docker build . --build-arg MODEL_SIZE=Nano --output . -f- <<'EOF'
990+
FROM python:3.11 AS build
991+
RUN apt-get update && apt-get install --no-install-recommends -y libgl1 && rm -rf /var/lib/apt/lists/*
992+
COPY --from=ghcr.io/astral-sh/uv:0.8.0 /uv /bin/
993+
WORKDIR /rfdetr
994+
RUN uv pip install --system rfdetr onnx onnxruntime onnxsim onnx-graphsurgeon
995+
ARG MODEL_SIZE
996+
RUN python3 -c "from rfdetr import RFDETR${MODEL_SIZE}; x = RFDETR${MODEL_SIZE}(resolution=320); x.export()"
997+
FROM scratch
998+
ARG MODEL_SIZE
999+
COPY --from=build /rfdetr/output/inference_model.onnx /rfdetr-${MODEL_SIZE}.onnx
1000+
EOF
10021001
```
10031002

10041003
### Downloading YOLO-NAS Model

docs/docs/frigate/hardware.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -166,16 +166,12 @@ There are improved capabilities in newer GPU architectures that TensorRT can ben
166166
Inference speeds will vary greatly depending on the GPU and the model used.
167167
`tiny` variants are faster than the equivalent non-tiny model, some known examples are below:
168168

169-
| Name | YOLOv7 Inference Time | YOLO-NAS Inference Time | RF-DETR Inference Time |
170-
| --------------- | --------------------- | ------------------------- | ------------------------- |
171-
| GTX 1060 6GB | ~ 7 ms | | |
172-
| GTX 1070 | ~ 6 ms | | |
173-
| GTX 1660 SUPER | ~ 4 ms | | |
174-
| RTX 3050 | 5 - 7 ms | 320: ~ 10 ms 640: ~ 16 ms | 336: ~ 16 ms 560: ~ 40 ms |
175-
| RTX 3070 Mobile | ~ 5 ms | | |
176-
| RTX 3070 | 4 - 6 ms | 320: ~ 6 ms 640: ~ 12 ms | 336: ~ 14 ms 560: ~ 36 ms |
177-
| Quadro P400 2GB | 20 - 25 ms | | |
178-
| Quadro P2000 | ~ 12 ms | | |
169+
| Name | YOLOv9 Inference Time | YOLO-NAS Inference Time | RF-DETR Inference Time |
170+
| --------------- | --------------------- | ------------------------- | ---------------------- |
171+
| RTX 3050 | t-320: 15 ms | 320: ~ 10 ms 640: ~ 16 ms | Nano-320: ~ 12 ms |
172+
| RTX 3070 | t-320: 11 ms | 320: ~ 8 ms 640: ~ 14 ms | Nano-320: ~ 9 ms |
173+
| RTX A4000 | | 320: ~ 15 ms | |
174+
| Tesla P40 | | 320: ~ 105 ms | |
179175

180176
### ROCm - AMD GPU
181177

frigate/embeddings/__init__.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import os
88
import signal
99
import threading
10+
from json.decoder import JSONDecodeError
1011
from types import FrameType
1112
from typing import Any, Optional, Union
1213

@@ -73,13 +74,21 @@ def __init__(self, db: SqliteVecQueueDatabase):
7374
self.requestor = EmbeddingsRequestor()
7475

7576
# load stats from disk
77+
stats_file = os.path.join(CONFIG_DIR, ".search_stats.json")
7678
try:
77-
with open(os.path.join(CONFIG_DIR, ".search_stats.json"), "r") as f:
79+
with open(stats_file, "r") as f:
7880
data = json.loads(f.read())
7981
self.thumb_stats.from_dict(data["thumb_stats"])
8082
self.desc_stats.from_dict(data["desc_stats"])
8183
except FileNotFoundError:
8284
pass
85+
except JSONDecodeError:
86+
logger.warning("Failed to decode semantic search stats, clearing file")
87+
try:
88+
with open(stats_file, "w") as f:
89+
f.write("")
90+
except OSError as e:
91+
logger.error(f"Failed to clear corrupted stats file: {e}")
8392

8493
def stop(self):
8594
"""Write the stats to disk as JSON on exit."""

frigate/events/cleanup.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -340,21 +340,22 @@ def run(self) -> None:
340340
.where(Event.has_clip == False, Event.has_snapshot == False)
341341
.iterator()
342342
)
343-
events_to_delete = [e.id for e in events]
343+
events_to_delete: list[Event] = [e for e in events]
344344

345-
for e in events:
345+
for e in events_to_delete:
346346
delete_event_thumbnail(e)
347347

348348
logger.debug(f"Found {len(events_to_delete)} events that can be expired")
349349
if len(events_to_delete) > 0:
350-
for i in range(0, len(events_to_delete), CHUNK_SIZE):
351-
chunk = events_to_delete[i : i + CHUNK_SIZE]
350+
ids_to_delete = [e.id for e in events_to_delete]
351+
for i in range(0, len(ids_to_delete), CHUNK_SIZE):
352+
chunk = ids_to_delete[i : i + CHUNK_SIZE]
352353
logger.debug(f"Deleting {len(chunk)} events from the database")
353354
Event.delete().where(Event.id << chunk).execute()
354355

355356
if self.config.semantic_search.enabled:
356357
self.db.delete_embeddings_description(event_ids=chunk)
357358
self.db.delete_embeddings_thumbnail(event_ids=chunk)
358-
logger.debug(f"Deleted {len(events_to_delete)} embeddings")
359+
logger.debug(f"Deleted {len(ids_to_delete)} embeddings")
359360

360361
logger.info("Exiting event cleanup...")

web/public/locales/hu/views/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"desc": "Automatikusan váltson át a kamera élő nézetére, amikor aktivitást észlel. Ha ez az opció ki van kapcsolva, akkor az Élő irányítópulton a statikus kameraképek csak percenként egyszer frissülnek."
4343
},
4444
"playAlertVideos": {
45-
"label": "Riadó Videók Lejátszása",
45+
"label": "Riasztási Videók Lejátszása",
4646
"desc": "Alapértelmezetten az Élő irányítópulton a legutóbbi riasztások kis, ismétlődő videóként jelennek meg. Kapcsolja ki ezt az opciót, ha csak állóképet szeretne megjeleníteni a legutóbbi riasztásokról ezen az eszközön/böngészőben."
4747
}
4848
},

web/public/locales/ko/audio.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

web/public/locales/ko/common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)