Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update has_mask method for mmdet models #1054

Merged
merged 11 commits into from
Jun 7, 2024
4 changes: 3 additions & 1 deletion sahi/models/mmdet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down