From 2495e4d7c3e701a10d520e1412b797fec6366166 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Sun, 13 Jul 2025 06:56:50 -0500 Subject: [PATCH] fix embeddings reindex - always increment processed objects to prevent division by zero - ensure description still gets processed even if there is no thumbnail --- frigate/embeddings/embeddings.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frigate/embeddings/embeddings.py b/frigate/embeddings/embeddings.py index 30af15d8a..c84390e91 100644 --- a/frigate/embeddings/embeddings.py +++ b/frigate/embeddings/embeddings.py @@ -339,6 +339,12 @@ class Embeddings: batch_thumbs = {} batch_descs = {} for event in events: + totals["processed_objects"] += 1 + + if description := event.data.get("description", "").strip(): + batch_descs[event.id] = description + totals["descriptions"] += 1 + thumbnail = get_event_thumbnail_bytes(event) if thumbnail is None: @@ -347,12 +353,6 @@ class Embeddings: batch_thumbs[event.id] = thumbnail totals["thumbnails"] += 1 - if description := event.data.get("description", "").strip(): - batch_descs[event.id] = description - totals["descriptions"] += 1 - - totals["processed_objects"] += 1 - # run batch embedding self.batch_embed_thumbnail(batch_thumbs)