Update inference_example.py

Adding else statement
This commit is contained in:
Kokouvi authored and GitHub committed 2024-01-30 10:53:40 +00:00
1 parent 2d494893fc
commit 1e482e172f
1 file changed
+4 -2
@@ -50,8 +50,10 @@ class DetectionsManager:
self.counts[zone_out_id][zone_in_id].add(tracker_id)
if len(detections_all) > 0:
detections_all.class_id = np.vectorize(
lambda x: self.tracker_id_to_zone_id.get(x, -1)
)(detections_all.tracker_id)
lambda x: self.tracker_id_to_zone_id.get(x, -1))
(detections_all.tracker_id)
else:
detections_all.class_id = np.array([], dtype=int)
return detections_all[detections_all.class_id != -1]