mp-02 commited on
Commit
a0b35de
1 Parent(s): 670eda8

Update inference.py

Browse files
Files changed (1) hide show
  1. inference.py +9 -9
inference.py CHANGED
@@ -68,15 +68,15 @@ def prediction(image):
68
  if "O" in d: d.pop("O")
69
 
70
  if("MENU.NM" in d and "MENU.PRICE" in d):
71
- if(len(d["MENU.NM"].split(", ")) == len(d["MENU.PRICE"].split(", "))):
72
- menu_names = [name.strip() for name in d["MENU.NM"].split(', ')]
73
- menu_prices = [price.strip() for price in d["MENU.PRICE"].split(', ')]
74
-
75
- menu_combined = [{"ITEM": name, "PRICE": price} for name, price in zip(menu_names, menu_prices)]
76
-
77
- d.pop("MENU.NM")
78
- d.pop("MENU.PRICE")
79
- d["MENU"] = menu_combined
80
 
81
  draw = ImageDraw.Draw(image, "RGBA")
82
  font = ImageFont.load_default()
 
68
  if "O" in d: d.pop("O")
69
 
70
  if("MENU.NM" in d and "MENU.PRICE" in d):
71
+ if(len(d["MENU.NM"].split(", ")) == len(d["MENU.PRICE"].split(", "))):
72
+ menu_names = [name.strip() for name in d["MENU.NM"].split(', ')]
73
+ menu_prices = [price.strip() for price in d["MENU.PRICE"].split(', ')]
74
+
75
+ menu_combined = [{"ITEM": name, "PRICE": price} for name, price in zip(menu_names, menu_prices)]
76
+
77
+ d.pop("MENU.NM")
78
+ d.pop("MENU.PRICE")
79
+ d["MENU"] = menu_combined
80
 
81
  draw = ImageDraw.Draw(image, "RGBA")
82
  font = ImageFont.load_default()