Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from model import ChestGPTDemo
|
| 3 |
+
|
| 4 |
+
model = ChestGPTDemo()
|
| 5 |
+
|
| 6 |
+
def analyze(image):
|
| 7 |
+
return model.predict(image)
|
| 8 |
+
|
| 9 |
+
with gr.Blocks() as demo:
|
| 10 |
+
gr.Markdown("## 🩺 ChestGPT - Chest X-Ray Diagnosis Assistant")
|
| 11 |
+
gr.Markdown("Upload a chest X-ray image to get disease prediction.")
|
| 12 |
+
|
| 13 |
+
image_input = gr.Image(type="pil")
|
| 14 |
+
output_text = gr.Textbox(label="Diagnosis Output")
|
| 15 |
+
|
| 16 |
+
analyze_button = gr.Button("Analyze")
|
| 17 |
+
analyze_button.click(fn=analyze, inputs=image_input, outputs=output_text)
|
| 18 |
+
|
| 19 |
+
demo.launch()
|