File size: 372 Bytes
8cc50cf
 
6cd9e92
8cc50cf
6cd9e92
 
8cc50cf
6cd9e92
 
 
 
8cc50cf
6cd9e92
 
 
8cc50cf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import gradio as gr
import torch
from ultralytics import YOLO

# Load YOLO model
model = YOLO("yolov9c-seg.pt")

# Define function to perform prediction
def predict_image(image):
    result = model.predict(image, show=True, save=True)
    return result

# Create Gradio interface
image_input = gr.inputs.Image()
gr.Interface(predict_image, image_input, "image").launch()