From e4a2379e4e694f0e1c13aa2258b0d342a161b3a7 Mon Sep 17 00:00:00 2001 From: ironcadiz Date: Thu, 20 Feb 2020 12:46:41 -0300 Subject: [PATCH] Fixed predict_sliding not computing correctly --- evaluate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evaluate.py b/evaluate.py index b4a77a0..9bb8270 100644 --- a/evaluate.py +++ b/evaluate.py @@ -131,7 +131,7 @@ def predict_sliding(net, image, tile_size, classes, recurrence): if isinstance(padded_prediction, list): padded_prediction = padded_prediction[0] padded_prediction = interp(padded_prediction).cpu().numpy().transpose(0,2,3,1) - prediction = padded_prediction[0, 0:img.shape[2], 0:img.shape[3], :] + prediction = padded_prediction[:, 0:img.shape[2], 0:img.shape[3], :] count_predictions[0, y1:y2, x1:x2] += 1 full_probs[:, y1:y2, x1:x2] += prediction # accumulate the predictions also in the overlapping regions