Skip to content

Commit

Permalink
use right threshold in forward pass
Browse files Browse the repository at this point in the history
  • Loading branch information
djdameln committed Jan 22, 2025
1 parent 5179fb4 commit 2aede4a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/anomalib/post_processing/one_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ def forward(self, predictions: InferenceBatch) -> InferenceBatch:
msg = "At least one of pred_score or anomaly_map must be provided."
raise ValueError(msg)
pred_score = predictions.pred_score or torch.amax(predictions.anomaly_map, dim=(-2, -1))
pred_score = self._normalize(pred_score, self.image_min, self.image_max, self._image_threshold)
anomaly_map = self._normalize(predictions.anomaly_map, self.pixel_min, self.pixel_max, self._pixel_threshold)
pred_score = self._normalize(pred_score, self.image_min, self.image_max, self.image_threshold)
anomaly_map = self._normalize(predictions.anomaly_map, self.pixel_min, self.pixel_max, self.pixel_threshold)
pred_label = self._apply_threshold(pred_score, self.normalized_image_threshold)
pred_mask = self._apply_threshold(anomaly_map, self.normalized_pixel_threshold)
return InferenceBatch(
Expand Down

0 comments on commit 2aede4a

Please sign in to comment.