Update app.py
Browse files
app.py
CHANGED
@@ -32,10 +32,14 @@ with gr.Blocks() as demo:
|
|
32 |
"CXR195_IM-0618-1001.png"
|
33 |
]
|
34 |
image = gr.Image(label="Upload Chest X-ray")
|
35 |
-
|
36 |
value = sample_images,
|
37 |
label="Sample Images",
|
38 |
)
|
|
|
|
|
|
|
|
|
39 |
with gr.Row():
|
40 |
model_choice = gr.Radio(["CLIP-GPT2", "ViT-GPT2", "ViT-CoAttention"], label="Select Model")
|
41 |
generate_button = gr.Button("Generate Caption")
|
@@ -48,7 +52,7 @@ with gr.Blocks() as demo:
|
|
48 |
return "Caption generation for this model is not yet implemented."
|
49 |
|
50 |
generate_button.click(predict, [image, model_choice], caption) # Trigger prediction on button click
|
51 |
-
sample_images_gallery.change(predict, [sample_images_gallery, model_choice], caption) # Handle sample images
|
52 |
|
53 |
|
54 |
demo.launch()
|
|
|
32 |
"CXR195_IM-0618-1001.png"
|
33 |
]
|
34 |
image = gr.Image(label="Upload Chest X-ray")
|
35 |
+
gr.Gallery(
|
36 |
value = sample_images,
|
37 |
label="Sample Images",
|
38 |
)
|
39 |
+
# sample_images_gallery = gr.Gallery(
|
40 |
+
# value = sample_images,
|
41 |
+
# label="Sample Images",
|
42 |
+
# )
|
43 |
with gr.Row():
|
44 |
model_choice = gr.Radio(["CLIP-GPT2", "ViT-GPT2", "ViT-CoAttention"], label="Select Model")
|
45 |
generate_button = gr.Button("Generate Caption")
|
|
|
52 |
return "Caption generation for this model is not yet implemented."
|
53 |
|
54 |
generate_button.click(predict, [image, model_choice], caption) # Trigger prediction on button click
|
55 |
+
# sample_images_gallery.change(predict, [sample_images_gallery, model_choice], caption) # Handle sample images
|
56 |
|
57 |
|
58 |
demo.launch()
|