From 96b52f28fbfe0efae056258ff71a5ae1dd1d251d Mon Sep 17 00:00:00 2001 From: Christoforos Aristeidou Date: Mon, 29 Jan 2024 23:36:20 +0200 Subject: [PATCH] added attributes and base for annotate() method --- supervision/annotators/core.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/supervision/annotators/core.py b/supervision/annotators/core.py index 355ebe08..ebfca647 100644 --- a/supervision/annotators/core.py +++ b/supervision/annotators/core.py @@ -1766,7 +1766,8 @@ class CropAnnotator(BaseAnnotator): position (Position): the anchor position to place cropped detections zoom_factor (int): the percentage factor to zoom cropped image part ''' - pass + self.position: Position = position + self.zoom_factor: int = zoom_factor def annotate( self, @@ -1800,4 +1801,10 @@ class CropAnnotator(BaseAnnotator): ![crop-annotator-example](https://media.roboflow.com/ #TODO update link supervision-annotator-examples/______.png) ''' - pass \ No newline at end of file + anchors = detections.get_anchors_coordinates(anchor=self.position) + for detection_idx in range(len(detections)): + x1, y1, x2, y2 = detections.xyxy[detection_idx].astype(int) + anchor = anchors[detection_idx].astype(int) + + + return scene \ No newline at end of file