import gradio as gr def predict(image): # your caption + classification logic here return "Generated caption", "Predicted class", 0.95 with gr.Blocks() as demo: gr.Markdown("## 🩺 Skin Cancer Web App") with gr.Row(): with gr.Column(): image_input = gr.Image(type="pil", label="Upload Lesion Image") submit_btn = gr.Button("Analyze") with gr.Column(): caption_output = gr.Textbox(label="Generated Caption") class_output = gr.Textbox(label="Predicted Class") conf_output = gr.Number(label="Confidence Score") submit_btn.click(predict, inputs=image_input, outputs=[caption_output, class_output, conf_output]) demo.launch()