Rehman1603 commited on
Commit
8a5ded3
·
verified ·
1 Parent(s): 2b3f79f

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -0
app.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import cv2
3
+ from keras.models import load_model
4
+
5
+ my_model=load_model('Liver_model.h5',compile=True)
6
+ class_num={0:'Healthy',1:'Un-Healthy'}
7
+
8
+ def Predict(Image):
9
+ Image=cv2.resize(Image,(224,224))
10
+ class_no=my_model.predict(Image.reshape(1,224,224,3)).argmax()
11
+ class_name=class_num.get(class_no)
12
+ return class_name
13
+
14
+
15
+ interface=gr.Interface(fn=Predict,inputs='image',outputs=[gr.components.Textbox(label="Class Name")],
16
+ title="This Space predict the liver of Chicken is healthy or un-healthy",
17
+ examples=[['Test1.jpg'],['Test2.jpeg'],['Test3.jpeg']])
18
+ interface.launch(debug=True)
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+