epilef68 commited on
Commit
b9291b9
·
verified ·
1 Parent(s): 7634255

Fix bug with YOLO receiving file_path correctly

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -10,9 +10,9 @@ path = ['./data/0068.jpg']
10
  model_path = './best.pt'
11
  model = YOLO(model_path)
12
 
13
- def detect_cheerios(image):
14
  # Run inference on the input image
15
- results = model(image)
16
  image = results[0].plot()
17
 
18
  # # Get the first result (assuming single image input)
@@ -30,7 +30,7 @@ def detect_cheerios(image):
30
 
31
  iface = gr.Interface(
32
  fn=detect_cheerios,
33
- inputs=gr.Image(type="numpy"),
34
  outputs=gr.Image(),
35
  title="Cheerios detector",
36
  examples=path,
 
10
  model_path = './best.pt'
11
  model = YOLO(model_path)
12
 
13
+ def detect_cheerios(image_path):
14
  # Run inference on the input image
15
+ results = model(image_path)
16
  image = results[0].plot()
17
 
18
  # # Get the first result (assuming single image input)
 
30
 
31
  iface = gr.Interface(
32
  fn=detect_cheerios,
33
+ inputs=gr.components.Image(type="filepath", label="Input Image"),
34
  outputs=gr.Image(),
35
  title="Cheerios detector",
36
  examples=path,