|
import gradio as gr |
|
|
|
def display_tree(): |
|
|
|
|
|
return "Tree will be displayed here." |
|
|
|
def display_image_based_on_dropdown_1(dropdown_value): |
|
|
|
|
|
return "Image based on dropdown 1 will be displayed here." |
|
|
|
def display_image_based_on_dropdown_2(dropdown_value): |
|
|
|
|
|
return "Image based on dropdown 2 will be displayed here." |
|
|
|
with gr.Blocks() as demo: |
|
gr.Markdown("## Interactive Tree and Image Display") |
|
|
|
with gr.Row(): |
|
tree_output = gr.Plot(display_tree) |
|
|
|
with gr.Row(): |
|
with gr.Column(): |
|
dropdown_1 = gr.Dropdown(label="Select Option for Field 2", choices=["Option 1", "Option 2", "Option 3"]) |
|
image_output_1 = gr.Image(fn=display_image_based_on_dropdown_1, inputs=dropdown_1) |
|
with gr.Column(): |
|
dropdown_2 = gr.Dropdown(label="Select Option for Field 3", choices=["Option A", "Option B", "Option C"]) |
|
image_output_2 = gr.Image(fn=display_image_based_on_dropdown_2, inputs=dropdown_2) |
|
|
|
demo.launch() |
|
|