Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save um4ng-tiw/fd2e1ea5333895a0167067574a8dd374 to your computer and use it in GitHub Desktop.
Save um4ng-tiw/fd2e1ea5333895a0167067574a8dd374 to your computer and use it in GitHub Desktop.
x,y = test_data_generator.next()
pred_array=[]
max_index_arr = []
for i in range(10):
img = x[i]
img = img.reshape(-1,64,64,3)
pred_val = model.predict(img)
max_idx = np.argmax(pred_val)
pred_array.append(max_idx)
cell_dict = {0:"EOSINOPHIL", 1:"LYMPHOCYTE", 2:"MONOCYTE", 3:"NEUTROPHIL"}
predictions = {}
actual_val = {}
k=0
for arr in y[:10]:
actual_val[k] = cell_dict[np.argmax(arr)]
k+=1
k=0
for pred in pred_array:
predictions[k] = cell_dict[pred]
k+=1
print("ACTUAL:", actual_val)
print("\nPREDICTIONS:", predictions)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment