diff --git a/supervision/annotation/__init__.py b/supervision/dataset/__init__.py similarity index 100% rename from supervision/annotation/__init__.py rename to supervision/dataset/__init__.py diff --git a/supervision/dataset/core.py b/supervision/dataset/core.py new file mode 100644 index 00000000..e69de29b diff --git a/supervision/annotation/voc.py b/supervision/dataset/voc.py similarity index 100% rename from supervision/annotation/voc.py rename to supervision/dataset/voc.py diff --git a/supervision/detection/annotate.py b/supervision/detection/annotate.py index e78ee6e2..2e2cb92a 100644 --- a/supervision/detection/annotate.py +++ b/supervision/detection/annotate.py @@ -147,10 +147,10 @@ class MaskAnnotator: Returns: np.ndarray: The image with the masks overlaid """ - for i in range(len(detections.xyxy)): - if detections.mask is None: - continue + if detections.mask is None: + return scene + for i in np.argsort(detections.area): class_id = ( detections.class_id[i] if detections.class_id is not None else None )