fernandobarranco commited on
Commit
83a6506
·
verified ·
1 Parent(s): 2d90331

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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("best-carvana.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
+ gr.Interface(fn=predict,
18
+ inputs=gr.components.Image(type="filepath", label="Input"),
19
+ outputs=gr.components.Image(type="numpy", label="Output")).launch(debug=False)