Prediction Inference

I have some doubts about new images prediction. I trained my model with my car images, for model to predict the class name of the images, doing same steps as the lesson 2 ( bears ) it worked good (model not perfect yet, but it’s working fine), this way I asked for some friends send me pictures o their cars for me to test the prediction usingt my model to those new photos, although the prediction wasn’t
right, then I realized that those pictures was different in size and proportion from the images in databuch, from which the model was trained. I was looking for how to transform the image to be the same pattern as the image from data bunch but I couldn’t find it, the only thing I found was how to crop an image, but I didn’t find how to transform the new img to the same pixels/tensors size of the imageBunch. How is the best way to transform a new img to the same type/pattern/size/normalizade as the ones from ImageBunch? thanks

If you are using the inference learner, it stores all of the transforms inside the class so you shouldn’t need to do anything manually. Maybe the images are consistently different than the training class in some way (angle, car type etc.)?
If you are looking for a good cars dataset the Stanford Cars dataset is pretty classic for these tasks.

1 Like