File size: 509 Bytes
ac08cea
 
 
 
 
f4c90d7
ac08cea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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)