mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-15 15:45:27 +03:00
Fix selection bug
This commit is contained in:
parent
269f534210
commit
2ab14d0ad6
@ -734,7 +734,7 @@ def process_frames(
|
|||||||
object_tracker.update_frame_times(frame_time)
|
object_tracker.update_frame_times(frame_time)
|
||||||
|
|
||||||
# group the attribute detections based on what label they apply to
|
# group the attribute detections based on what label they apply to
|
||||||
attribute_detections: dict[str, ObjectAttribute] = {}
|
attribute_detections: dict[str, list[ObjectAttribute]] = {}
|
||||||
for label, attribute_labels in model_config.attributes_map.items():
|
for label, attribute_labels in model_config.attributes_map.items():
|
||||||
attribute_detections[label] = [
|
attribute_detections[label] = [
|
||||||
ObjectAttribute(d)
|
ObjectAttribute(d)
|
||||||
@ -752,7 +752,10 @@ def process_frames(
|
|||||||
for attributes in attribute_detections.values():
|
for attributes in attribute_detections.values():
|
||||||
for attribute in attributes:
|
for attribute in attributes:
|
||||||
filtered_objects = filter(
|
filtered_objects = filter(
|
||||||
lambda o: o["label"] in attribute_detections.keys(), all_objects
|
lambda o: o["label"] in attribute_detections.keys()
|
||||||
|
and attribute.label
|
||||||
|
in model_config.attributes_map.get(o["label"], []),
|
||||||
|
all_objects,
|
||||||
)
|
)
|
||||||
selected_object_id = attribute.find_best_object(filtered_objects)
|
selected_object_id = attribute.find_best_object(filtered_objects)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user