I am preprocessing ImageNet data so all the data is the same shape, (256, 256, 3). My idea was to crop the data to (256, 256). However, I am running into issues because the images are of variable size and some are smaller than 256 in width/height, or both. Some example dimensions include (194, 150, 3) and (200, 300, 3). Do I just resize all the images to (256, 256)? This would potentially throw off aspect ratio and cause distortions. How do I best approach this? Any examples of this in tensorflow would also be helpful.
Asked
Active
Viewed 286 times
1 Answers
0
Padding then cropping is probably the good solution.

Ricocotam
- 41
- 7
-
By padding, I assume you mean zero padding? This would just add zeros so that both the width and height meet 256, right? – Jane Sully Nov 08 '20 at 09:27
-
@JaneSully yes, 0 padding or mirror, depending on your problem. – Ricocotam Nov 08 '20 at 09:33