mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-07-26 13:47:03 +02:00
Fixes (#19125)
* fix embeddings reindex - always increment processed objects to prevent division by zero - ensure description still gets processed even if there is no thumbnail * clean up * Add newer labels to default attribute map --------- Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
This commit is contained in:
parent
3eb3797bc5
commit
ca1c98eab8
@ -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",
|
||||
],
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user