Skip to content

NVR with realtime local object detection for IP cameras

Fixes (#19125)

Josh Hawkinsca1c98eab8f1
diff --git a/frigate/const.py b/frigate/const.py
index 183506a04b..5b16a36778 100644
--- a/frigate/const.py
+++ b/frigate/const.py
@@ -26,6 +26,7 @@ DEFAULT_ATTRIBUTE_LABEL_MAP = {
"car": [
"amazon",
"an_post",
+ "canada_post",
"dhl",
"dpd",
"fedex",
@@ -35,6 +36,7 @@ DEFAULT_ATTRIBUTE_LABEL_MAP = {
"postnl",
"postnord",
"purolator",
+ "royal_mail",
"ups",
"usps",
],
diff --git a/frigate/embeddings/embeddings.py b/frigate/embeddings/embeddings.py
index 30af15d8a5..833ab9ab2e 100644
--- a/frigate/embeddings/embeddings.py
+++ b/frigate/embeddings/embeddings.py
@@ -334,27 +334,24 @@ class Embeddings:
.paginate(current_page, batch_size)
)
- while len(events) > 0:
+ while events:
event: Event
batch_thumbs = {}
batch_descs = {}
for event in events:
- thumbnail = get_event_thumbnail_bytes(event)
-
- if thumbnail is None:
- continue
-
- batch_thumbs[event.id] = thumbnail
- totals["thumbnails"] += 1
+ totals["processed_objects"] += 1
if description := event.data.get("description", "").strip():
batch_descs[event.id] = description
totals["descriptions"] += 1
- totals["processed_objects"] += 1
+ if thumbnail := get_event_thumbnail_bytes(event):
+ batch_thumbs[event.id] = thumbnail
+ totals["thumbnails"] += 1
# run batch embedding
- self.batch_embed_thumbnail(batch_thumbs)
+ if batch_thumbs:
+ self.batch_embed_thumbnail(batch_thumbs)
if batch_descs:
self.batch_embed_description(batch_descs)