Spaces:
Runtime error
Runtime error
Pawel_Mar
commited on
Commit
·
9783e18
1
Parent(s):
7ebb5b1
fix empty inferences
Browse files
app.py
CHANGED
|
@@ -6,9 +6,12 @@ def yoloV8_func(image: gr.Image = None):
|
|
| 6 |
model_path = "models/last.pt"
|
| 7 |
model = YOLO(model_path)
|
| 8 |
results = model.predict(image)
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
-
return str(
|
| 12 |
|
| 13 |
|
| 14 |
yolo_app = gr.Interface(
|
|
|
|
| 6 |
model_path = "models/last.pt"
|
| 7 |
model = YOLO(model_path)
|
| 8 |
results = model.predict(image)
|
| 9 |
+
masks_json = []
|
| 10 |
+
for result in results:
|
| 11 |
+
if result.masks:
|
| 12 |
+
masks_json.append(result.masks.xy)
|
| 13 |
|
| 14 |
+
return str(masks_json)
|
| 15 |
|
| 16 |
|
| 17 |
yolo_app = gr.Interface(
|