Add all albels count for cameras

This commit is contained in:
Nick Mowen 2022-03-06 11:33:04 -07:00
parent 3f8278c6a6
commit 150fc25fc9

View File

@ -554,13 +554,22 @@ class CameraState:
if not obj.false_positive if not obj.false_positive
) )
# keep track of all labels detected for this camera
all_labels_count = 0
# report on detected objects # report on detected objects
for obj_name, count in obj_counter.items(): for obj_name, count in obj_counter.items():
all_labels_count += count
if count != self.object_counts[obj_name]: if count != self.object_counts[obj_name]:
self.object_counts[obj_name] = count self.object_counts[obj_name] = count
for c in self.callbacks["object_status"]: for c in self.callbacks["object_status"]:
c(self.name, obj_name, count) c(self.name, obj_name, count)
# publish for all labels detected for this camera
for c in self.callbacks["object_status"]:
c(self.name, "all", all_labels_count)
# expire any objects that are >0 and no longer detected # expire any objects that are >0 and no longer detected
expired_objects = [ expired_objects = [
obj_name obj_name