Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from PIL import Image | |
| from backend.predict import predict_image | |
| def infer(image): | |
| result = predict_image(image) | |
| return result["label_name"], float(result["confidence"]) | |
| demo = gr.Interface( | |
| fn=infer, | |
| inputs=gr.Image(type="pil"), | |
| outputs=[ | |
| gr.Text(label="Prediction"), | |
| gr.Number(label="Confidence") | |
| ], | |
| title="X-Ray Multi-Class Classifier", | |
| description="Upload an X-ray image to get the predicted class and confidence." | |
| ) | |
| demo.launch() | |