How to correctly resize input images in a CNN? I have a training set composed of images having different width and height, I need to resize them to a fix dimension nxn or nxm before passing them as the input of a CNN.

I would like to know which parameters I need to take into account for correctly choose the new scaled dimensions n and m.
Two solutions:

Crop images to a fixed size
Pad images to a fixed size with 0s.

Keep in mind if you are doing segmentation, gt masks have to be cropped/padded too.