Skip to content

Commit 900952a

Browse files
authored
Modified annotators-core.py
1 parent 9530812 commit 900952a

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

supervision/annotators/core.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1675,27 +1675,27 @@ def annotate(
16751675
supervision-annotator-examples/triangle-annotator-example.png)
16761676
"""
16771677
xy = detections.get_anchors_coordinates(anchor=self.position)
1678-
for detection_idx in range(len(detections)):
1679-
color = resolve_color(
1680-
color=self.color,
1681-
detections=detections,
1682-
detection_idx=detection_idx,
1683-
color_lookup=self.color_lookup
1684-
if custom_color_lookup is None
1685-
else custom_color_lookup,
1686-
)
1687-
tip_x, tip_y = int(xy[detection_idx, 0]), int(xy[detection_idx, 1])
1688-
vertices = np.array(
1689-
[
1690-
[tip_x - self.base // 2, tip_y - self.height],
1691-
[tip_x + self.base // 2, tip_y - self.height],
1692-
[tip_x, tip_y],
1693-
],
1694-
np.int32,
1695-
)
1678+
for detection_idx in range(len(detections)):
1679+
color = resolve_color(
1680+
color=self.color,
1681+
detections=detections,
1682+
detection_idx=detection_idx,
1683+
color_lookup=self.color_lookup
1684+
if custom_color_lookup is None
1685+
else custom_color_lookup,
1686+
)
1687+
tip_x, tip_y = int(xy[detection_idx, 0]), int(xy[detection_idx, 1])
1688+
vertices = np.array(
1689+
[
1690+
[tip_x - self.base // 2, tip_y - self.height],
1691+
[tip_x + self.base // 2, tip_y - self.height],
1692+
[tip_x, tip_y],
1693+
],
1694+
np.int32,
1695+
)
16961696

1697-
cv2.fillPoly(scene, [vertices], color.as_bgr())
1698-
cv2.polylines(scene, [vertices], True, (0,0,0), thickness=self.outline_thickness)
1697+
cv2.fillPoly(scene, [vertices], color.as_bgr())
1698+
cv2.polylines(scene, [vertices], True, (0,0,0), thickness=self.outline_thickness)
16991699

17001700
return scene
17011701

0 commit comments

Comments
 (0)