How to set/calculate padding for semantic segmentation

17 views
Skip to first unread message

Shima Caffe

unread,
Apr 30, 2018, 3:20:15 PM4/30/18
to Caffe Users
Hi, 

Since Unet is doing zero-padding the output prediction image size is not the same size of the label image. Do you know how to change and calculate the padding size in each layer in a way that the output prediction size is equal to the ground truth image? 

Thanks

Przemek D

unread,
Aug 17, 2018, 9:05:46 AM8/17/18
to Caffe Users
Convolution output shape is equal to (input_shape - filter_size + 2*padding) / stride + 1.
If you assume stride=1 you get: output = input - filter + 2*padding + 1. If you want to preserve the input shape (output=input): padding = (filter - 1) / 2.
Reply all
Reply to author
Forward
0 new messages