Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -33,7 +33,7 @@ def detect_fruit(image):
|
|
33 |
detected_fruit = None
|
34 |
|
35 |
for det in detections:
|
36 |
-
label = model.names[int(det.boxes.cls)] # название фрукта
|
37 |
if label in fruits_data:
|
38 |
detected_fruit = label
|
39 |
break
|
@@ -50,7 +50,7 @@ def create_receipt(detected_fruit, weight):
|
|
50 |
draw = ImageDraw.Draw(receipt_img)
|
51 |
|
52 |
try:
|
53 |
-
font = ImageFont.truetype("
|
54 |
except IOError:
|
55 |
font = ImageFont.load_default()
|
56 |
|
|
|
33 |
detected_fruit = None
|
34 |
|
35 |
for det in detections:
|
36 |
+
label = model.names[int(det.boxes.cls[0])] # название фрукта
|
37 |
if label in fruits_data:
|
38 |
detected_fruit = label
|
39 |
break
|
|
|
50 |
draw = ImageDraw.Draw(receipt_img)
|
51 |
|
52 |
try:
|
53 |
+
font = ImageFont.truetype("DejaVuSans.ttf", 18)
|
54 |
except IOError:
|
55 |
font = ImageFont.load_default()
|
56 |
|