From 8fbfe9e8bafcec9cd4d7a09b0f60327d73588c55 Mon Sep 17 00:00:00 2001 From: fcakyon <34196005+fcakyon@users.noreply.github.com> Date: Sat, 8 May 2021 08:24:58 +0300 Subject: [PATCH] update get_area_filtered_coco (#87) --- sahi/utils/coco.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sahi/utils/coco.py b/sahi/utils/coco.py index 5db4e9ad0..4938cbaf7 100644 --- a/sahi/utils/coco.py +++ b/sahi/utils/coco.py @@ -1264,7 +1264,7 @@ def get_area_filtered_coco(self, min=0, max=float('inf'), intervals_per_category for image in self.images: is_valid_image = True for annotation in image.annotations: - if intervals_per_category is not None: + if intervals_per_category is not None and annotation.name in intervals_per_category.keys(): category_based_min = intervals_per_category[annotation.category_name]["min"] category_based_max = intervals_per_category[annotation.category_name]["max"] if (annotation.area < category_based_min