0
$\begingroup$

I have built my model using images which are all 512x384, I then exported the model through .pkl and am hosting it on Render, the UI is built on React App where the user will input their chosen image

I am aware that I could resize the images, either on the client side when the user inputs the image, on the server side using python, or I could change my model to accept different image sizes, could anyone advise what the simplest, most elegant solution would be for this?

$\endgroup$
0
$\begingroup$

Generally image classification models require input images to be reshaped, because they use fully connected layers to classify features learned by the previous convolutional layers, and shapes must match to make classification. On the other hand, fully connected CNNs only use convolutional layers, so they can work images with any shape.

If your model has fully connected layers, then you should reshape your input images. If you send your images via network to get predictions, then reshaping images before sending can decrease network load, and response time for big images. If it is not the case I think you simply can reshape them right before you input them to model.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.