3
$\begingroup$

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.

$\endgroup$

2 Answers 2

1
$\begingroup$

I have a suggestion for you. Maybe not complete enough to be a complete solution but that is exactly what I've experienced. Suppose that you have writings in a paper and the paper is a part of a scene, or you have boys with nice mustaches which are beside a wide scene. In such cases which you have special information which are significant for classifying, the first one may help the classifier recognize book and written things and the second one can help the classifier find the gender of people in the scene, try to resize the images in a way that such significant things be recognizable to the human. If humans can understand them, you can hope that your classifier will be able too. Consider that you shouldn't resize the images to small pixels to avoid your net being with lots parameters. If you resize the images to too small ones, you may loose important information.

$\endgroup$
2
  • $\begingroup$ There are some good strategies to find the right images' size, or I have to try empirically? $\endgroup$
    – Simone
    Jan 28, 2018 at 17:33
  • $\begingroup$ @Simone actually I've not seen a paper, but there may be. $\endgroup$ Jan 28, 2018 at 17:42
2
$\begingroup$

Two solutions:

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

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

$\endgroup$
2
  • $\begingroup$ How can I find the right size for images having different sizes? $\endgroup$
    – Simone
    Jan 28, 2018 at 16:15
  • $\begingroup$ Are you using GPU? There should be VRAM constraints $\endgroup$
    – Alex
    Jan 28, 2018 at 18:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.