diff --git a/sahi/utils/coco.py b/sahi/utils/coco.py index 1777555aa..e84f2f3d3 100644 --- a/sahi/utils/coco.py +++ b/sahi/utils/coco.py @@ -130,7 +130,7 @@ def from_coco_annotation_dict(cls, annotation_dict: Dict, category_name: Optiona annotation_dict: dict COCO formatted annotation dict (with fields "bbox", "segmentation", "category_id") """ - if annotation_dict.__contains__("segmentation") and not isinstance(annotation_dict["segmentation"], list): + if annotation_dict.__contains__("segmentation") and isinstance(annotation_dict["segmentation"], dict): has_rle_segmentation = True logger.warning( f"Segmentation annotation for id {annotation_dict['id']} is skipped since RLE segmentation format is not supported."