Skip to content

Commit

Permalink
Update eval.py
Browse files Browse the repository at this point in the history
  • Loading branch information
PkuRainBow authored Nov 11, 2018
1 parent 32eaca7 commit d54cde1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,14 @@ def predict_whole_img_w_label(net, image, classes, method, scale, label):
interp = nn.Upsample(size=(H_, W_), mode='bilinear', align_corners=True)
else:
interp = nn.Upsample(size=(H_, W_), mode='bilinear')
if scale != 1:
scaled_img = ndimage.zoom(image, (1.0, 1.0, scale, scale), order=1, prefilter=False)
else:
scaled_img = image

# bug
# if scale > 1:
# scaled_img = ndimage.zoom(image, (1.0, 1.0, scale, scale), order=1, prefilter=False)
# else:
# scaled_img = image

scaled_img = ndimage.zoom(image, (1.0, 1.0, scale, scale), order=1, prefilter=False)

full_prediction_ = net(Variable(torch.from_numpy(scaled_img), volatile=True).cuda(), label)
if 'dsn' in method or 'center' in method or 'fuse' in method:
Expand Down

0 comments on commit d54cde1

Please sign in to comment.