File size: 505 Bytes
fe74dc5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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()