<p>A few methods have been developed to process images with multiple sizes, including images with unequal horizontal and vertical dimensions. For example, <a href="https://arxiv.org/abs/1406.4729" rel="nofollow noreferrer">spatial pyramid pooling</a> or <a href="https://arxiv.org/abs/1803.09218" rel="nofollow noreferrer">scale recurrent neural networks</a>. You could also set network <a href="https://github.com/keras-team/keras/issues/1920" rel="nofollow noreferrer">dimensions to be variable</a>, then use a pooling operation (e.g. global average pooling) to get fixed size dimensions before fully connected or other layers than need a fixed size.</p>
<p>The simplest approach is cropping or padding images (e.g. with zeros) so that they are all the same size.</p>
Keras Image Classification for Different Input Sizes
<p>I want to use Tensorflow and Keras to train a dataset composed of images with very different sizes in order to classify them. But some of them are horizontal (1400x100) and some of them are vertical (100x1000).
As far as I understand, Keras accepts same size input images.
I'm not sure if it's wise to convert all of them to a classical resolution like 150x150 or 180x180 since they are horizontal and vertical.</p>
<p>How can I solve this problem?</p>