wickedreg commited on
Commit
2843311
·
verified ·
1 Parent(s): 85681b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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("arial.ttf", 18)
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