How to apply trained model on images of shape/size larger than what the model was trained on (in Tensorflow)?
I once have the same question about how to deal with larger or smaller images. According to my experience, a possible method is to resize images to the input size of the network. For example, if your current image size is 982x982 and the network input size is 512x512, then you can just use some libraries like Pillow or OpenCV to resize the original image from 982x982 to 512x512.
Your method is a possible solution. I would say that there are many possible solutions other than the resizing operation, but you should better try this simplest method to see if your network works well. What I have learned from my projects is that we can always try the simplest solution, and in most cases, it works perfectly.
Generally speaking, there is not a general perfect way to do it. You can start with the simplest method, and find a more complicated one if it does not work.
I trained a model on size 512x512 images. I currently have size 982x982 (or any other size) images that I need to have the model predict on. When I run on these images, I get errors about unexpected input array shape.
Does Tensorflow provide any way to conveniently deploy a model on images of size/shape larger than what the model was trained on?
More Details:
Specifically, this is a model used for image segmentation.
I assume one workaround to the issue is creating my own sliding-window script that, instead, inputs into the model windows of the expected size taken at different intervals from the original image, and then somehow pasting all those output windows back into a single image after they have gone through the model. However, I want to know if there is a more standard approach.
I am brand new to Tensorflow (and image segmentation) so it is very possible I just missed something, or that perhaps my question is unclear.
Thank you for any advice :)