From 0274c45dbc086b75144a85a30af0630adf94fadf Mon Sep 17 00:00:00 2001 From: SkalskiP Date: Tue, 23 Apr 2024 23:12:54 +0200 Subject: [PATCH] solve CI tests --- supervision/keypoints/annotate.py | 6 +++--- supervision/keypoints/skeletons.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/supervision/keypoints/annotate.py b/supervision/keypoints/annotate.py index 978c1e8d..0a837946 100644 --- a/supervision/keypoints/annotate.py +++ b/supervision/keypoints/annotate.py @@ -5,10 +5,10 @@ import cv2 import numpy as np from supervision.annotators.base import ImageType -from supervision.annotators.utils import scene_to_annotator_img_type from supervision.draw.color import Color from supervision.keypoints.core import KeyPoints from supervision.keypoints.skeletons import KnownSkeletons, Skeleton +from supervision.utils.conversion import convert_for_annotation_method class BaseKeyPointAnnotator(ABC): @@ -33,7 +33,7 @@ class KeyPointAnnotator(BaseKeyPointAnnotator): self.color = color self.radius = radius - @scene_to_annotator_img_type + @convert_for_annotation_method def annotate(self, scene: ImageType, keypoints: KeyPoints) -> ImageType: # TODO: I'm getting shape [1, N, 2] here - not [N, 2]. # Seems like it accounts for more than 1 person in an image. @@ -74,7 +74,7 @@ class SkeletonAnnotator(BaseKeyPointAnnotator): self.thickness = thickness self.skeleton = skeleton - @scene_to_annotator_img_type + @convert_for_annotation_method def annotate(self, scene: ImageType, keypoints: KeyPoints) -> ImageType: if len(keypoints) == 0: return scene diff --git a/supervision/keypoints/skeletons.py b/supervision/keypoints/skeletons.py index 03a4f335..d150b661 100644 --- a/supervision/keypoints/skeletons.py +++ b/supervision/keypoints/skeletons.py @@ -86,7 +86,8 @@ class KnownSkeletons: def get_skeleton(self, limb_count: int) -> Skeleton: if limb_count not in self._skeletons: print( - f"Warning: No skeleton found with {limb_count} limbs. Will create one now." + f"Warning: No skeleton found with {limb_count} limbs. " + f"Will create one now." ) self.add_skeleton(_make_sequential_skeleton(limb_count)) return self._skeletons[limb_count]