SHARE
TWEET

Untitled

a guest May 19th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import numpy as np
  2. import glob
  3. import matplotlib.pyplot as plt
  4. import matplotlib.image as mpimg
  5. from tensorflow.keras.preprocessing import image
  6.  
  7.  
  8. for file in glob.glob('./test2/*'):
  9.     test_image = image.load_img(file, target_size=(64,64))
  10.     plt.imshow(test_image)
  11.     plt.show()
  12.    
  13.     test_image = image.img_to_array(test_image)
  14.     test_image = np.expand_dims(test_image, axis=0)
  15.     result = classifier.predict(test_image)
  16.     training_set.class_indices
  17.     if result[0][0] >= 0.5:
  18.         prediction = 'dasha'
  19.     else:
  20.         prediction = 'cara'
  21.     print(prediction)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top