I try to implement NetVLAD neural network. Before implementing it, i have to do data preprocessing, which is extract 128x128 and 68x68 patch size of image dataset. In order to prevent pixel loss, i have to do image padding first. I looked at Pytorch API and i figured it out.

Using F.pad for padding
Using unfold API to extract patches
write custom dataloader

I know the logic but i dont know how to implement it. Can anyone help me out?