-
-
Save amankharwal/fa7d699e43f33247fb42b490ffc70fff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from keras.preprocessing import image | |
# predicting images | |
path = "gender-recognition-200k-images-celeba/Dataset/Test/Female/160001.jpg" | |
img = image.load_img(path, target_size=(64, 64)) | |
x = image.img_to_array(img) | |
x = np.expand_dims(x, axis=0) | |
images = np.vstack([x]) | |
classes = model.predict(images, batch_size=1) | |
print(classes[0]) | |
if classes[0]>0.5: | |
print("is a man") | |
else: | |
print( " is a female") | |
plt.imshow(img) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment