Spaces:
Sleeping
Sleeping
Commit
·
cb4bf9a
1
Parent(s):
4adb8b7
Update app.py
Browse files
app.py
CHANGED
@@ -9,13 +9,14 @@ from ultralytics import YOLO
|
|
9 |
def predict(path:str):
|
10 |
model = YOLO("yolov8s.yaml")
|
11 |
model = YOLO("best.pt")
|
12 |
-
imagen = cv2.imread(path)
|
13 |
results = model.predict(source=path)
|
14 |
|
15 |
for r in results:
|
16 |
return r.plot(show_conf=True, line_width=None, font_size=None, pil=False, example='abc')
|
17 |
|
18 |
|
19 |
-
gr.Interface(
|
|
|
20 |
inputs=gr.components.Image(type="filepath", label="Input"),
|
21 |
outputs=gr.components.Image(type="numpy", label="Output")).launch()
|
|
|
9 |
def predict(path:str):
|
10 |
model = YOLO("yolov8s.yaml")
|
11 |
model = YOLO("best.pt")
|
12 |
+
#imagen = cv2.imread(path)
|
13 |
results = model.predict(source=path)
|
14 |
|
15 |
for r in results:
|
16 |
return r.plot(show_conf=True, line_width=None, font_size=None, pil=False, example='abc')
|
17 |
|
18 |
|
19 |
+
gr.Interface(title='Generación 16, Módulo 4',
|
20 |
+
fn=predict,
|
21 |
inputs=gr.components.Image(type="filepath", label="Input"),
|
22 |
outputs=gr.components.Image(type="numpy", label="Output")).launch()
|