import warnings

warnings.filterwarnings('ignore', category=FutureWarning)
import tensorflow as tf

classifierLoad = tf.keras.models.load_model('Paddy_Diseases_Leaf_Brain/Paddy_Diseases.h5')

import numpy as np
from keras.preprocessing import image

test_image = image.load_img('Paddy_Diseases_Leaf/Bacterialblight/BACTERAILBLIGHT3_013.jpg', target_size=(200, 200))
# test_image = image.img_to_array(test_image)
test_image = np.expand_dims(test_image, axis=0)
result = classifierLoad.predict(test_image)
print(result)
print("------------------ Predicted Diseases ------------------")
if result[0][0] == 1:
    print("Bacterialblight")
elif result[0][1] == 1:
    print("Blast")
elif result[0][2] == 1:
    print("Brownspot")
elif result[0][3] == 1:
    print("Tungro")
