Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -32,9 +32,11 @@ def detect_fruit(image):
|
|
32 |
|
33 |
detected_fruit = None
|
34 |
|
35 |
-
|
|
|
36 |
if label in fruits_data:
|
37 |
detected_fruit = label
|
|
|
38 |
|
39 |
return result_np_image, detected_fruit
|
40 |
|
|
|
32 |
|
33 |
detected_fruit = None
|
34 |
|
35 |
+
for det in detections:
|
36 |
+
label = model.names[int(det[5])] # название фрукта
|
37 |
if label in fruits_data:
|
38 |
detected_fruit = label
|
39 |
+
break
|
40 |
|
41 |
return result_np_image, detected_fruit
|
42 |
|