<p>There are two types of Neural Networks: First one that can process variable input size and second that requires fixed input size.</p>

<p>Good example for first kind is Fully Convolutional Network (FCN). They are widely used for object detection and semantic segmentation. Next code snippet is minimal example of testing pre-trained keypointrcnn from PyTorch. This is improvement of previous state of the art <a href="https://arxiv.org/abs/1703.06870" rel="nofollow noreferrer">Mask R-CNN</a></p>

<pre><code>import torch
import torchvision
from PIL import Image

model_rcnn = torchvision.models.detection.keypointrcnn_resnet50_fpn(pretrained=True)
model_rcnn.eval()

image1 = Image.open('image122 × 430.jpg')
image2 = Image.open('image448 × 465.jpg')

image_tensor1 = torchvision.transforms.functional.to_tensor(image1)
image_tensor2 = torchvision.transforms.functional.to_tensor(image2)

output1 = model_rcnn([image_tensor1])
output2 = model_rcnn([image_tensor2])
print(output1, output2)
</code></pre>

<p>Second kind of Neural Networks require fixed size input, for example ResNet. <strong>Standard solution is using Resize transform</strong> before feeding images to the network. Minimal example:</p>

<pre><code>import torch
import torchvision
from torchvision import transforms
from PIL import Image

model_imagnet = torchvision.models.resnet50(pretrained=True)
model_imagnet.eval()

# don't forget to use the same normalization as in training, 
# if you are using pre-trained model
normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406],
                                 std=[0.229, 0.224, 0.225])
my_transforms = transforms.Compose([transforms.Resize(224), 
                                   transforms.ToTensor(),
                                   normalize])

image1 = Image.open('image122 × 430.jpg')
image2 = Image.open('image448 × 465.jpg')

image_tensor1 = my_transforms(image1)
image_tensor2 = my_transforms(image2)


output1 = model_imagnet(torch.unsqueeze(image_tensor1, 0))
output2 = model_imagnet(torch.unsqueeze(image_tensor2, 0))
</code></pre>

<p>For more details about the models and there usage you may refer to PyTorch <a href="https://pytorch.org/docs/stable/torchvision/models.html" rel="nofollow noreferrer">documentation</a></p>
Feed multi resolution images to Neural Network Pytorch
<p>I am new in this area so pardon if my question seems stupid.
I have created a multiresolution image pyramid using </p>

<blockquote>
  <p>skimage.transform.pyramid_gaussian</p>
</blockquote>

<p>The images are 2D. Now I want to feed these images to a neural network. The structure of the neural network is not fixed. But I can't do that since the images are not of the same size. Can anyone guide me to any resource regarding if this can be done?</p>

<p>Thank you</p>