| import gradio as gr | |
| from predict import predict | |
| demo = gr.Interface( | |
| fn=predict, | |
| inputs=gr.Image(type="filepath", label="Upload Image"), | |
| outputs=[ | |
| gr.Image(label="Uploaded Image"), | |
| gr.Image(label="Top-1 Class Example"), | |
| gr.Label(label="Top-5 Probabilities") | |
| ], | |
| title="Scene Classification with Reference Image", | |
| description="Upload an image to get the predicted class with a sample image and top-5 prediction chart." | |
| ) | |
| demo.launch() | |