runaksh commited on
Commit
88967f1
·
verified ·
1 Parent(s): 3e586d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -11
app.py CHANGED
@@ -31,16 +31,27 @@ def classify_image(image):
31
 
32
  return label
33
 
34
- # Create title, description and article strings
35
- title = "Classification Demo"
36
- description = "XRay classification"
37
-
38
  # Create Gradio interface
39
- iface = gr.Interface(fn=classify_image,
40
- inputs=gr.Image(), # Accepts image of any size
41
- outputs=gr.Label(),
42
- title=title,
43
- description=description)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
 
45
- # Launch the app
46
- iface.launch()
 
 
31
 
32
  return label
33
 
 
 
 
 
34
  # Create Gradio interface
35
+ def make_block(dem):
36
+ with dem:
37
+ gr.Markdown("Medical - Lungs Disease Prediction")
38
+ with gr.Tabs():
39
+ with gr.TabItem("Pneumonia Detection"):
40
+ with gr.Row():
41
+ in_prompt_1 = gr.Image()
42
+ out_response_1 = gr.Label()
43
+ b1 = gr.Button("Enter")
44
+
45
+ with gr.TabItem("Tuberculosis Detection"):
46
+ with gr.Row():
47
+ in_prompt_2 = gr.Image()
48
+ out_response_2 = gr.Label()
49
+ b2 = gr.Button("Enter")
50
+ b1.click(predict_sentiment, inputs=in_prompt_1, outputs=out_response_1)
51
+ b2.click(predict, inputs=in_prompt_2, outputs=out_response_2)
52
+
53
+ if __name__ == '__main__':
54
 
55
+ demo = gr.Blocks()
56
+ make_block(demo)
57
+ demo.launch()