-
-
Save Karts27/b22c1097c8c180ec239a06187718bf13 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
def predict(img_path, model): | |
image = load_img(img_path) | |
image = image.resize((64,64)) | |
image = img_to_array(image) | |
image = np.expand_dims(image, axis = 0) | |
pred = model.predict(image) | |
#print(pred) | |
pred = np.argmax(pred) | |
if pred == 0: | |
return 'daisy' | |
elif pred == 1: | |
return "dandelion" | |
elif pred == 2: | |
return "rose" | |
else: | |
return "sunflower" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment