Vermeer commited on
Commit
6a5ede1
1 Parent(s): 020fe74

model deployed

Browse files
Files changed (4) hide show
  1. Normal-2.png +0 -0
  2. Tuberculosis-24.png +0 -0
  3. app.py +17 -4
  4. best_model.h5 +3 -0
Normal-2.png ADDED
Tuberculosis-24.png ADDED
app.py CHANGED
@@ -1,7 +1,20 @@
1
  import gradio as gr
 
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
 
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ import joblib
3
+ import tensorflow as tf
4
 
5
+ #model = joblib.load('model.pkl')
6
+ model = tf.keras.models.load_model('best_model.h5')
7
+ categories = ["Normal", "Tubercolosis"] #"Pneumonia", "Covid-19"
8
 
9
+ def classify(img):
10
+ img = img.reshape((-1, 224, 224, 3))
11
+ pred = model.predict(img)[0]
12
+ return {categories[i]: float(pred[i]) for i in range(2)}
13
+
14
+ image = gr.inputs.Image(shape=(224, 224))
15
+ label = gr.outputs.Label(num_top_classes=2)
16
+ examples = ["Normal-2.png", "Tubercolosis-24.png"]
17
+
18
+
19
+ intf = gr.Interface(classify,inpuys=image, outputs=label, examples=examples, capture_session=True)
20
+ intf.launch(inline=False)
best_model.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:16a7ffaf91f83a0375ef297dc148de790e990ffccc4037a5aa68b3a7b3849e85
3
+ size 363638328