wickedreg commited on
Commit
666ac65
·
verified ·
1 Parent(s): bf54894

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -22,9 +22,9 @@ def detect_fruit(image):
22
 
23
  # детекция
24
  detections = model.predict(source=image_cv, conf=0.5)
25
-
26
  # проверка на наличие детекций
27
- if len(detections) == 0:
28
  return image_cv, None
29
 
30
  result_np_image = detections[0].plot()
 
22
 
23
  # детекция
24
  detections = model.predict(source=image_cv, conf=0.5)
25
+
26
  # проверка на наличие детекций
27
+ if len(results[0].boxes) == 0:
28
  return image_cv, None
29
 
30
  result_np_image = detections[0].plot()