import gradio as gr from ultralytics import YOLO # Load the YOLO model model = YOLO('best.pt') def predict(img): results = model(img) annotated_frame = results[0].plot() return annotated_frame # Create the Gradio interface iface = gr.Interface( fn=predict, inputs=gr.Image(label="Input Image", type="filepath"), outputs="image", title="Rat Paw Detector", description="Upload an image to detect rat paws" ) # Launch the Gradio interface iface.launch(share=True)