Emiloz12 commited on
Commit
46d4b3a
·
verified ·
1 Parent(s): 8df5c0e

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -0
app.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import cv2
2
+ import numpy as np
3
+ import gradio as gr
4
+
5
+ from ultralytics import YOLO
6
+
7
+ def predict(path:str):
8
+ model = YOLO("yolo11s.yaml")
9
+ model = YOLO("constellation_best.pt")
10
+ imagen = cv2.imread(path)
11
+ results = model.predict(source=path)
12
+
13
+ for r in results:
14
+ return r.plot()
15
+
16
+
17
+
18
+ gr.Interface(fn=predict,
19
+ inputs=gr.components.Image(type="filepath", label="Input"),
20
+ outputs=gr.components.Image(type="numpy", label="Output")).launch(debug=False)