Update app.py
Browse files
app.py
CHANGED
@@ -30,6 +30,9 @@ with gr.Blocks() as demo:
|
|
30 |
gr.HTML("<h1 style='text-align: center;'>MedViT: A Vision Transformer-Driven Method for Generating Medical Reports π₯π€</h1>")
|
31 |
gr.HTML("<p style='text-align: center;'>You can generate captions by uploading an X-Ray and selecting a model of your choice below</p>")
|
32 |
|
|
|
|
|
|
|
33 |
with gr.Row():
|
34 |
sample_images = [
|
35 |
"CXR191_IM-0591-1001.png",
|
@@ -43,11 +46,12 @@ with gr.Blocks() as demo:
|
|
43 |
image = gr.Image(label="Upload Chest X-ray", type="pil")
|
44 |
|
45 |
sample_images_gallery = gr.Gallery(value = sample_images,label="Sample Images")
|
46 |
-
|
47 |
with gr.Row():
|
48 |
-
model_choice = gr.Radio(["CLIP-GPT2", "ViT-GPT2", "ViT-CoAttention"], label="Select Model")
|
49 |
generate_button = gr.Button("Generate Caption")
|
50 |
|
|
|
|
|
51 |
caption = gr.Textbox(label="Generated Caption")
|
52 |
|
53 |
def predict(img, model_name):
|
|
|
30 |
gr.HTML("<h1 style='text-align: center;'>MedViT: A Vision Transformer-Driven Method for Generating Medical Reports π₯π€</h1>")
|
31 |
gr.HTML("<p style='text-align: center;'>You can generate captions by uploading an X-Ray and selecting a model of your choice below</p>")
|
32 |
|
33 |
+
with gr.Row():
|
34 |
+
model_choice = gr.Radio(["CLIP-GPT2", "ViT-GPT2", "ViT-CoAttention"], label="Select Model")
|
35 |
+
|
36 |
with gr.Row():
|
37 |
sample_images = [
|
38 |
"CXR191_IM-0591-1001.png",
|
|
|
46 |
image = gr.Image(label="Upload Chest X-ray", type="pil")
|
47 |
|
48 |
sample_images_gallery = gr.Gallery(value = sample_images,label="Sample Images")
|
49 |
+
|
50 |
with gr.Row():
|
|
|
51 |
generate_button = gr.Button("Generate Caption")
|
52 |
|
53 |
+
|
54 |
+
|
55 |
caption = gr.Textbox(label="Generated Caption")
|
56 |
|
57 |
def predict(img, model_name):
|