Skip to content

Commit

Permalink
Bug fix in the inferencer (#475)
Browse files Browse the repository at this point in the history
  • Loading branch information
samet-akcay committed Aug 2, 2022
1 parent 92a4b95 commit 645ed5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion anomalib/post_processing/normalization/min_max.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def normalize(
) -> Union[np.ndarray, Tensor]:
"""Apply min-max normalization and shift the values such that the threshold value is centered at 0.5."""
normalized = ((targets - threshold) / (max_val - min_val)) + 0.5
if isinstance(targets, (np.ndarray, np.float32)):
if isinstance(targets, (np.ndarray, np.float32, np.float64)):
normalized = np.minimum(normalized, 1)
normalized = np.maximum(normalized, 0)
elif isinstance(targets, Tensor):
Expand Down

0 comments on commit 645ed5c

Please sign in to comment.