diff --git a/sahi/models/mmdet.py b/sahi/models/mmdet.py index c64ea87c7..b4b363d3c 100644 --- a/sahi/models/mmdet.py +++ b/sahi/models/mmdet.py @@ -190,7 +190,9 @@ def has_mask(self): """ Returns if model output contains segmentation mask """ - has_mask = self.model.model.with_mask + # has_mask = self.model.model.with_mask + train_pipeline = self.model.cfg["train_dataloader"]["dataset"]["pipeline"] + has_mask = any(isinstance(item, dict) and any("mask" in key for key in item.keys()) for item in train_pipeline) return has_mask @property