Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ def detect_fruit(image):
|
|
24 |
detections = model.predict(source=image_cv, conf=0.5)
|
25 |
|
26 |
# проверка на наличие детекций
|
27 |
-
if len(
|
28 |
return image_cv, None
|
29 |
|
30 |
result_np_image = detections[0].plot()
|
|
|
24 |
detections = model.predict(source=image_cv, conf=0.5)
|
25 |
|
26 |
# проверка на наличие детекций
|
27 |
+
if len(detections[0].boxes.cls) == 0:
|
28 |
return image_cv, None
|
29 |
|
30 |
result_np_image = detections[0].plot()
|