diff --git a/anomalib/deploy/inferencers/torch.py b/anomalib/deploy/inferencers/torch.py index 9eeabb2eee..6223b3809f 100644 --- a/anomalib/deploy/inferencers/torch.py +++ b/anomalib/deploy/inferencers/torch.py @@ -157,6 +157,8 @@ def post_process( anomaly_map = anomaly_map.detach().cpu().numpy() if "image_shape" in meta_data and anomaly_map.shape != meta_data["image_shape"]: - anomaly_map = cv2.resize(anomaly_map, meta_data["image_shape"]) + image_height = meta_data["image_shape"][0] + image_width = meta_data["image_shape"][1] + anomaly_map = cv2.resize(anomaly_map, (image_width, image_height)) return anomaly_map, float(pred_score)