mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-12 01:57:36 +03:00
Keep track of verified objects separately
This commit is contained in:
parent
7dd0cadaae
commit
74f7251d6b
@ -259,20 +259,18 @@ def run_analysis(
|
||||
|
||||
objects_list = final_data["data"]["objects"]
|
||||
sub_labels_list = final_data["data"]["sub_labels"]
|
||||
verified_index = 0
|
||||
|
||||
for label in objects_list:
|
||||
if "-verified" in label:
|
||||
try:
|
||||
named_objects.append(
|
||||
f"{sub_labels_list[verified_index].replace('_', ' ').title()} ({label.replace('-verified', '')})"
|
||||
)
|
||||
verified_index += 1
|
||||
except IndexError:
|
||||
continue
|
||||
continue
|
||||
elif label in labelmap_objects:
|
||||
objects.append(label.replace("_", " ").title())
|
||||
|
||||
for i, verified_label in enumerate(final_data["data"]["verified_objects"]):
|
||||
named_objects.append(
|
||||
f"{sub_labels_list[i].replace('_', ' ').title()} ({verified_label.replace('-verified', '')})"
|
||||
)
|
||||
|
||||
analytics_data["objects"] = objects
|
||||
analytics_data["recognized_objects"] = named_objects
|
||||
|
||||
|
||||
@ -147,6 +147,9 @@ class PendingReviewSegment:
|
||||
ReviewSegment.data.name: {
|
||||
"detections": list(set(self.detections.keys())),
|
||||
"objects": list(set(self.detections.values())),
|
||||
"verified_objects": [
|
||||
o for o in self.detections.values() if "-verified" in o
|
||||
],
|
||||
"sub_labels": list(self.sub_labels.values()),
|
||||
"zones": self.zones,
|
||||
"audio": list(self.audio),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user