fernandobarranco commited on
Commit
586e9f7
·
1 Parent(s): cb4bf9a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -6,17 +6,16 @@ import gradio as gr
6
  from ultralytics import YOLO
7
 
8
 
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()
 
6
  from ultralytics import YOLO
7
 
8
 
9
+ def predict(path):
10
  model = YOLO("yolov8s.yaml")
11
  model = YOLO("best.pt")
 
12
  results = model.predict(source=path)
13
 
14
  for r in results:
15
+ return r.plot(show_conf=True, line_width=None, font_size=None, pil=False)
16
 
17
 
18
+ gr.Interface(title='Generación 16 - Módulo 4',
19
  fn=predict,
20
  inputs=gr.components.Image(type="filepath", label="Input"),
21
  outputs=gr.components.Image(type="numpy", label="Output")).launch()