Create app.py
Browse files123456789101112131415import gradio as grfrom inference import predict
def gradio_predict(image): with open(image.name, "rb") as f: result = predict(f.read()) return f"Predicted Class: {result['class']}\nConfidence: {result['confidence']*100:.2f}%"
iface = gr.Interface(fn=gradio_predict, inputs=gr.Image(type="file"), outputs="text", title="Brain Tumor MRI Image Classification")
if __name__ == "__main__": iface.launch()app.pyAdded+15