File size: 656 Bytes
8a5ded3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
28
import gradio as gr
import cv2
from keras.models import load_model

my_model=load_model('Liver_model.h5',compile=True)
class_num={0:'Healthy',1:'Un-Healthy'}

def Predict(Image):
  Image=cv2.resize(Image,(224,224))
  class_no=my_model.predict(Image.reshape(1,224,224,3)).argmax()
  class_name=class_num.get(class_no)
  return class_name


interface=gr.Interface(fn=Predict,inputs='image',outputs=[gr.components.Textbox(label="Class Name")],
                       title="This Space predict the liver of Chicken is healthy or un-healthy",
                       examples=[['Test1.jpg'],['Test2.jpeg'],['Test3.jpeg']]) 
interface.launch(debug=True)