Steps to be able to use my saved model on images in a flask server for classification

Hello, I am using a resent18 pretrained model for an image classification task.

I have saved this model using the model.state_dict() save method. I have saved it as a .pth file and i am now ready to deploy it and use it for predicting images that i send to it.

I am unsure how to go about this, in my training and testing all of the data came from folder in my windows machine that was local to the file so using datasets and dataloaders like this was fine

dataloaders[‘train’] = torch.utils.data.DataLoader(image_datasets[‘train’],
batch_size=128,
shuffle=True,
num_workers=4)

How should i be preparing my data for classification when it is being used to actually predict things? I know that it must be a certain size etc for resnet but I am struggling to see how i would do this for images that come from post requests for example

I should make clear that I am able to load it etc it is just when it is being called that there is a problem. Thanks in advance