mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-30 18:47:40 +03:00
fix embeddings reindex
- always increment processed objects to prevent division by zero - ensure description still gets processed even if there is no thumbnail
This commit is contained in:
parent
d574d1edae
commit
2495e4d7c3
@ -339,6 +339,12 @@ class Embeddings:
|
|||||||
batch_thumbs = {}
|
batch_thumbs = {}
|
||||||
batch_descs = {}
|
batch_descs = {}
|
||||||
for event in events:
|
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)
|
thumbnail = get_event_thumbnail_bytes(event)
|
||||||
|
|
||||||
if thumbnail is None:
|
if thumbnail is None:
|
||||||
@ -347,12 +353,6 @@ class Embeddings:
|
|||||||
batch_thumbs[event.id] = thumbnail
|
batch_thumbs[event.id] = thumbnail
|
||||||
totals["thumbnails"] += 1
|
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
|
# run batch embedding
|
||||||
self.batch_embed_thumbnail(batch_thumbs)
|
self.batch_embed_thumbnail(batch_thumbs)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user