File size: 655 Bytes
08b6f37
 
 
 
 
 
 
 
 
 
0e00c07
 
 
08b6f37
 
 
 
0e00c07
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import gradio as gr
from model import ChestGPTDemo

model = ChestGPTDemo()

def analyze(image):
    return model.predict(image)

with gr.Blocks() as demo:
    gr.Markdown("## 🩺 ChestGPT - Chest X-Ray Diagnosis Assistant")
    gr.Markdown("Upload a chest X-ray image or try an example.")

    image_input = gr.Image(type="pil", label="Chest X-Ray Input")
    output_text = gr.Textbox(label="Diagnosis Output")
    analyze_button = gr.Button("Analyze")
    analyze_button.click(fn=analyze, inputs=image_input, outputs=output_text)

    gr.Examples(
        examples=["example_images/sample1.png"],
        inputs=image_input
    )

demo.queue().launch()