DDR_Detection / app.py
ammariii08's picture
Update app.py
bbd65ca verified
raw
history blame
622 Bytes
import gradio as gr
from ultralytics import YOLO
import cv2
import numpy as np
def detect_objects(image):
model = YOLO("./ddr.pt") # Load the trained model
results = model(image, conf=0.10) # Run inference with confidence threshold
output_image = results[0].plot() # Get the image with bounding boxes
return output_image
iface = gr.Interface(
fn=detect_objects,
inputs=gr.Image(type="numpy"),
outputs=gr.Image(type="numpy"),
title="DDR-Detection",
description="Upload an image, and the model will detect objects using YOLO11.",
)
if __name__ == "__main__":
iface.launch()