Skip to content

Commit

Permalink
return pred masks in predict step (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
djdameln committed Feb 15, 2022
1 parent 4bf4970 commit dbca627
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions anomalib/models/components/base/anomaly_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ def predict_step(self, batch: Any, batch_idx: int, _dataloader_idx: Optional[int
outputs = self.validation_step(batch, batch_idx)
self._post_process(outputs)
outputs["pred_labels"] = outputs["pred_scores"] >= self.image_threshold.value
if "anomaly_maps" in outputs.keys():
outputs["pred_masks"] = outputs["anomaly_maps"] >= self.pixel_threshold.value
return outputs

def test_step(self, batch, _): # pylint: disable=arguments-differ
Expand Down

0 comments on commit dbca627

Please sign in to comment.