import gradio as gr from PIL import Image from model.load_model import process_image, clear_memory # force rebuild def predict(image): clear_memory() result = process_image(image) return result iface = gr.Interface( fn=predict, inputs=gr.Image(type="pil"), outputs=gr.Image(type="pil"), title="Brain Tumor Detector - PaliGemma", description="Upload an MRI brain image. The model will detect and mark tumor areas (if any).", allow_flagging="never" ) iface.launch()