This a classification process for blood cells. I have 2 classes: Mononuclear and Polynuclear. The training is done. X_test is the image array and y_test is the label array. I am trying to predict the label of a single input image.
I have changed the label array into dtype int and have flattened it and image array in float32 as I have done with the training image and label. Do I need to make a test dataset as I have made a train dataset using DatasetMixin? And how do I get the desired result. I am aiming for a single image prediction only.
y_test = y_test.astype(int)
y_test = y_test.flatten()
batch_size = 1
dataset = MyDataset(X_test, y_test)
test_iter = iterators.SerialIterator(dataset, batch_size)
img = cv2.imread('C:/Users/Dell/Desktop/TEST IMAGES/MONOCYTE.jpeg')
plt.imshow(img)
plt.show()
img=np.array((img), dtype = np.float32)
img=img/255.0
x = Variable(np.asarray([X_test[0]]))
y = model(x)
prediction = y.data.argmax(axis=1)
After the line y = model(x) I get the error: TypeError: call() missing 1 required positional argument: 'x'
TypeError: call() missing 1 required positional argument: 'x'