From 3cff0df0ce2a7e907e46adea933e6d4a286b407f Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Tue, 1 Oct 2024 07:54:27 -0600 Subject: [PATCH] Bug fixes (#14092) * Fix path of selected GPU * Fix selection bug * Simplify --- frigate/ffmpeg_presets.py | 2 +- frigate/video.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frigate/ffmpeg_presets.py b/frigate/ffmpeg_presets.py index a1ff3d74d..875357de5 100644 --- a/frigate/ffmpeg_presets.py +++ b/frigate/ffmpeg_presets.py @@ -32,7 +32,7 @@ class LibvaGpuSelector: devices = list(filter(lambda d: d.startswith("render"), os.listdir("/dev/dri"))) if len(devices) < 2: - self._selected_gpu = devices[0] + self._selected_gpu = f"/dev/dri/{devices[0]}" return self._selected_gpu for device in devices: diff --git a/frigate/video.py b/frigate/video.py index 2af38540c..a8514ae03 100755 --- a/frigate/video.py +++ b/frigate/video.py @@ -734,7 +734,7 @@ def process_frames( object_tracker.update_frame_times(frame_time) # 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(): attribute_detections[label] = [ ObjectAttribute(d) @@ -752,7 +752,9 @@ def process_frames( for attributes in attribute_detections.values(): for attribute in attributes: filtered_objects = filter( - lambda o: o["label"] in attribute_detections.keys(), all_objects + lambda o: attribute.label + in model_config.attributes_map.get(o["label"], []), + all_objects, ) selected_object_id = attribute.find_best_object(filtered_objects)