diff --git a/mask2former/data/dataset_mappers/mask_former_panoptic_dataset_mapper.py b/mask2former/data/dataset_mappers/mask_former_panoptic_dataset_mapper.py index ddbc2bd7..ccb35b25 100644 --- a/mask2former/data/dataset_mappers/mask_former_panoptic_dataset_mapper.py +++ b/mask2former/data/dataset_mappers/mask_former_panoptic_dataset_mapper.py @@ -145,7 +145,7 @@ def __call__(self, dataset_dict): masks = [] for segment_info in segments_info: class_id = segment_info["category_id"] - if not segment_info["iscrowd"]: + if not segment_info.get("iscrowd", 0): classes.append(class_id) masks.append(pan_seg_gt == segment_info["id"])