Update app.py
Browse files
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 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
-
|
46 |
-
|
|
|
|
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()
|