Feed multi resolution images to Neural Network Pytorch
I am new in this area so pardon if my question seems stupid.
I have created a multiresolution image pyramid using 


  skimage.transform.pyramid_gaussian


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?

Thank you

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

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 Mask R-CNN

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)


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

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))


For more details about the models and there usage you may refer to PyTorch documentation
