import gradio as gr | |
# URLs of the images | |
urls = [ | |
"https://raw.githubusercontent.com/xoghd1126/G4-finalproject/main/wordcloud.png" | |
] | |
# Function to get the selected image URL | |
def get_image(sid): | |
nid = int(sid) - 1 | |
return urls[nid] | |
# Create a Gradio interface | |
with gr.Blocks() as demo: | |
sid_input = gr.Radio(choices=["1"], label="Select Image") | |
image_output = gr.Image() | |
sid_input.change(fn=get_image, inputs=sid_input, outputs=image_output) | |
demo.launch() |