-
Notifications
You must be signed in to change notification settings - Fork 1.5k
get_mask_edges wrongly uses squeeze #4312
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
This error place is in:
Line 161 in e58086d
| seg_pred, seg_gt = np.squeeze(cropper(seg_pred)), np.squeeze(cropper(seg_gt)) |
To use spatial crop, a channel dimension is expanded, thus it needs to be squeezed after the transform. However,
axis should be specified otherwise more than one dimensions may be squeezed. If a input tensor only has one pixel that has label, after crop and squeeze, it will has shape (), and then after binary erosion and XOR, it will has type bool, rather than an array, and may get wrong surface_distance.
To Reproduce
Steps to reproduce the behavior:
import numpy as np
print(np.squeeze(np.random.rand(1, 1, 16, 16, 16)).shape)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working