diff --git a/src/anomalib/post_processing/one_class.py b/src/anomalib/post_processing/one_class.py index 4dd0d9ce47..b7e135f1e8 100644 --- a/src/anomalib/post_processing/one_class.py +++ b/src/anomalib/post_processing/one_class.py @@ -273,8 +273,7 @@ def _normalize( if preds is None: return None preds = ((preds - threshold) / (norm_max - norm_min)) + 0.5 - preds = torch.minimum(preds, torch.tensor(1)) - return torch.maximum(preds, torch.tensor(0)) + return preds.clamp(min=0, max=1) @property def normalized_image_threshold(self) -> float: