peal.data.transformations.Padding¶
- class peal.data.transformations.Padding[source]¶
Bases:
objectSymmetrically pad a
[C, H, W]tensor up to a fixed spatial size.- Parameters:
input_size (
tupleofint) – Target(height, width). The input must not be larger than this.
Methods
- __call__(sample)[source]¶
Pad
sampletoinput_sizewith grey (128) borders.- Parameters:
sample (
torch.Tensor) – Image of shape[C, H, W].- Returns:
Image of shape
[C, input_size[0], input_size[1]]; odd size differences put the extra pixel on the bottom/right.- Return type: