Spaces:
Sleeping
Sleeping
from keras.models import load_model | |
import cv2 | |
import gradio as gr | |
intestine_model=load_model('Intestine_model.h5') | |
intestine_class_name={0:'Healthy',1:'Intestine have ulcer button'} | |
def predict_intestine(img): | |
img=cv2.resize(img,(224,224)) | |
prediction=intestine_model.predict(img.reshape(1,224,224,3)).argmax() | |
return intestine_class_name[prediction] | |
interface=gr.Interface(fn=predict_intestine,inputs='image',outputs=[gr.components.Textbox(label='Result')]) | |
interface.launch(debug=True) | |