fernandobarranco commited on
Commit
d9b5e92
·
verified ·
1 Parent(s): 915f21f

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
+
8
+ def predict(path:str):
9
+ model = YOLO("yolo11s.yaml")
10
+ model = YOLO("best-carvana.pt")
11
+ imagen = cv2.imread(path)
12
+ results = model.predict(source=path)
13
+
14
+ for r in results:
15
+ return r.plot()
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)