Skip to content

Commit

Permalink
Update has_mask method for mmdet models (#1054)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alias-z authored Jun 7, 2024
1 parent 4d80492 commit 1660978
Showing 1 changed file with 3 additions and 1 deletion.
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

0 comments on commit 1660978

Please sign in to comment.