MNIST handwritten digit classifier prediction

I am new to Deep Learning and am using Keras to learn this. I followed the instructions in this link to create a handwriting recognition classifier using the MNIST dataset. It performed excellently in terms of comparable assessment results. I used tensorflow as my Keras framework.

Now I want to read a handwritten digit image file and predict its digit using the same model. I think the image should be converted to 28x28 size with 255 inches deep? I'm not sure if I understand correctly. If so, how can I do this conversion in Python? If my understanding is wrong, what kind of transformation is required?

Thank you in advance!

+3


source to share


1 answer


As far as I know, you will need to turn this into a 28x28 grayscale image in order to work with this in Python. That the same shape and schema as the images used to train MNIST and tensors expect 784 (28 * 28) items, each with a value between 0 and 255 in their tensors as input.

To resize the image you can use PIL or Pillow. See this SO post or this page in the Pillow docs (link to Wtower in the above post, copied here for easy access to resize and maintain proportions if that's what you want to do.

NTN!



Greetings,

-Maashu

+1


source







All Articles