tracker_id contents are never None

This commit is contained in:
Linas Kondrackis
2024-05-21 13:58:20 +03:00
parent b916dc547c
commit 40b537c0be
2 changed files with 7 additions and 5 deletions
+7 -3
View File
@@ -140,6 +140,13 @@ class LineZone:
if len(detections) == 0:
return crossed_in, crossed_out
if detections.tracker_id is None:
print(
"Line zone conting skipped. LineZone requires tracker_id. Refer to "
"https://supervision.roboflow.com/latest/trackers for more information."
)
return crossed_in, crossed_out
all_anchors = np.array(
[
detections.get_anchors_coordinates(anchor)
@@ -148,9 +155,6 @@ class LineZone:
)
for i, tracker_id in enumerate(detections.tracker_id):
if tracker_id is None:
continue
box_anchors = [Point(x=x, y=y) for x, y in all_anchors[:, i, :]]
in_limits = all(
-2
View File
@@ -78,8 +78,6 @@ class DetectionsSmoother:
for detection_idx in range(len(detections)):
tracker_id = detections.tracker_id[detection_idx]
if tracker_id is None:
continue
self.tracks[tracker_id].append(detections[detection_idx])