mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-07-30 13:48:07 +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": [
|
"car": [
|
||||||
"amazon",
|
"amazon",
|
||||||
"an_post",
|
"an_post",
|
||||||
|
"canada_post",
|
||||||
"dhl",
|
"dhl",
|
||||||
"dpd",
|
"dpd",
|
||||||
"fedex",
|
"fedex",
|
||||||
@ -35,6 +36,7 @@ DEFAULT_ATTRIBUTE_LABEL_MAP = {
|
|||||||
"postnl",
|
"postnl",
|
||||||
"postnord",
|
"postnord",
|
||||||
"purolator",
|
"purolator",
|
||||||
|
"royal_mail",
|
||||||
"ups",
|
"ups",
|
||||||
"usps",
|
"usps",
|
||||||
],
|
],
|
||||||
|
@ -334,27 +334,24 @@ class Embeddings:
|
|||||||
.paginate(current_page, batch_size)
|
.paginate(current_page, batch_size)
|
||||||
)
|
)
|
||||||
|
|
||||||
while len(events) > 0:
|
while events:
|
||||||
event: Event
|
event: Event
|
||||||
batch_thumbs = {}
|
batch_thumbs = {}
|
||||||
batch_descs = {}
|
batch_descs = {}
|
||||||
for event in events:
|
for event in events:
|
||||||
thumbnail = get_event_thumbnail_bytes(event)
|
totals["processed_objects"] += 1
|
||||||
|
|
||||||
if thumbnail is None:
|
|
||||||
continue
|
|
||||||
|
|
||||||
batch_thumbs[event.id] = thumbnail
|
|
||||||
totals["thumbnails"] += 1
|
|
||||||
|
|
||||||
if description := event.data.get("description", "").strip():
|
if description := event.data.get("description", "").strip():
|
||||||
batch_descs[event.id] = description
|
batch_descs[event.id] = description
|
||||||
totals["descriptions"] += 1
|
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
|
# run batch embedding
|
||||||
self.batch_embed_thumbnail(batch_thumbs)
|
if batch_thumbs:
|
||||||
|
self.batch_embed_thumbnail(batch_thumbs)
|
||||||
|
|
||||||
if batch_descs:
|
if batch_descs:
|
||||||
self.batch_embed_description(batch_descs)
|
self.batch_embed_description(batch_descs)
|
||||||
|
Loading…
Reference in New Issue
Block a user