File size: 489 Bytes
46d4b3a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import cv2
import numpy as np
import gradio as gr

from ultralytics import YOLO

def predict(path:str):
    model = YOLO("yolo11s.yaml")
    model = YOLO("constellation_best.pt")
    imagen = cv2.imread(path)
    results = model.predict(source=path)

    for r in results:
        return r.plot()



gr.Interface(fn=predict,
             inputs=gr.components.Image(type="filepath", label="Input"),
             outputs=gr.components.Image(type="numpy", label="Output")).launch(debug=False)