Fix bug with YOLO receiving file_path correctly
Browse files
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(
|
| 14 |
# Run inference on the input image
|
| 15 |
-
results = model(
|
| 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="
|
| 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,
|