Advertisement
Guest User

Untitled

a guest
Feb 18th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. import numpy as np
  2. from keras.preprocessing import image
  3. test_image = image.load_img('dataset/single_prediction/cat_or_dog_1.jpg', target_size = (64, 64))
  4. test_image = image.img_to_array(test_image)
  5. test_image = np.expand_dims(test_image, axis = 0)
  6. result = classifier.predict(test_image)
  7. training_set.class_indices
  8. if result[0][0] == 1:
  9. prediction = 'dog'
  10. else:
  11. prediction = 'cat'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement