Spaces:
Runtime error
Runtime error
File size: 735 Bytes
3ff10a0 ab3f808 a4fcc7e 559ec57 24d3233 9e95b47 24d3233 cd13712 e071497 0e74aec a4fcc7e d365b80 98224c2 cd13712 7826415 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
import tensorflow as tf
from keras.models import load_model
import gradio as gr
from matplotlib import pyplot as plt
import cv2
model = load_model('eee.keras')
def image_mod(image_mod):
img = cv2.imread("Sunny_day_in_Hiroo.jpg")
resize = tf.image.resize(img, (256, 256))
plt.imshow(resize.numpy().astype(int))
yhat = model.predict(np.expand_dims(resize,0))
display = np.max(yhat)
return display
gr.Interface(fn=image_mod,
inputs=gr.Image(shape=(256, 256)),
outputs=gr.Label(num_top_classes=3),
examples=["Sunny_day_in_Hiroo.jpg","640px-Cloudy_Sky2.JPG","Foggy_day_of_Riga.jpg","Jida,_Zhuhai,_rainy_day.jpg","Odalys_Edenarc,_Arc_1800,_on_a_snowy_day,_2013.jpg"]).launch() |