From 08ae0b2fc7186b7630aa681d54eebd4b98f8e926 Mon Sep 17 00:00:00 2001 From: Hardik Dava <39372750+hardikdava@users.noreply.github.com> Date: Sat, 20 May 2023 19:22:30 +0200 Subject: [PATCH] using basic functions from cv2 --- supervision/detection/core.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/supervision/detection/core.py b/supervision/detection/core.py index 7f69c23c..01603256 100644 --- a/supervision/detection/core.py +++ b/supervision/detection/core.py @@ -189,10 +189,9 @@ class Detections: """ masks = None if yolov8_results.masks: - from ultralytics.yolo.utils.ops import scale_image masks = yolov8_results.masks.masks.cpu().numpy() # masks, (N, H, W) masks = np.moveaxis(masks, 0, -1) # masks, (H, W, N) - masks = scale_image(masks, yolov8_results.masks.orig_shape) + masks = cv2.resize(masks, (yolov8_results.masks.orig_shape[1], yolov8_results.masks.orig_shape[0])) masks = np.moveaxis(masks, -1, 0) # masks, (N, H, W) return cls( xyxy=yolov8_results.boxes.xyxy.cpu().numpy(),