@@ -1675,27 +1675,27 @@ def annotate(
1675
1675
supervision-annotator-examples/triangle-annotator-example.png)
1676
1676
"""
1677
1677
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
+ )
1696
1696
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 )
1699
1699
1700
1700
return scene
1701
1701
0 commit comments