You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tried to make a prediction on a .jpg/.png saved image of random drawings (from quick draw data set, directly saved the image).
However, the prediction came off quite wrong and can't seem to get it working and my guess is on due to the image processing before feeding to the model.
This is what I am using
from PIL import Image
import cv2
import matplotlib.pyplot as plt
from random import randint
%matplotlib inline
clock = qd.get_drawing("clock")
apple = clock
img = apple.image.convert("L")
img = img.resize((28,28),Image.BILINEAR)
img = np.array(img)
img = cv2.bitwise_not(img)
img = img.reshape(28,28,1)
img = img.astype('float32')
img /= 255.0
print(img.shape)
plt.imshow(img.squeeze())
print(img)
Yellowish image is the original one in npy format, the other is processed using above code.
The text was updated successfully, but these errors were encountered:
@shubhank008, can you explain more ? which model are you using ? Are you using this notebook ?
Yes, exactly that. Initially I tried to re-write how you were doing inference on drawings in web app (tensorflowjs) to python (using saved drawing images .jpg .png) but that did not work, then I started trying various image pre-processing alternatives as I am pretty sure its the whole image reading, processing and feeding part that I am messing up.
Tried to make a prediction on a .jpg/.png saved image of random drawings (from quick draw data set, directly saved the image).
However, the prediction came off quite wrong and can't seem to get it working and my guess is on due to the image processing before feeding to the model.
This is what I am using
Yellowish image is the original one in npy format, the other is processed using above code.
The text was updated successfully, but these errors were encountered: