Ali-Maq commited on
Commit
5a95d7c
1 Parent(s): 610db13

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -38,9 +38,15 @@ def get_nutrition_info(food_name):
38
  #Parse response and return relevant information
39
  data = response.json()
40
  response = data["branded"][0]["photo"]["thumb"]
41
-
 
 
 
 
 
 
42
  # Open the image using PIL
43
- output = json.dumps(response, indent=2, sort_keys=True)
44
  return output,response
45
 
46
  def volume_estimations(ali):
 
38
  #Parse response and return relevant information
39
  data = response.json()
40
  response = data["branded"][0]["photo"]["thumb"]
41
+ val = {
42
+ "food_name": data["branded"][0]["food_name"],
43
+ "calories": data["branded"][0]["nf_calories"],
44
+ "serving_size": data["branded"][0]["serving_qty"],
45
+ "serving_unit": data["branded"][0]["serving_unit"],
46
+ #"images": data["branded"][0]["photo"]
47
+ }
48
  # Open the image using PIL
49
+ output = json.dumps(val, indent=2, sort_keys=True)
50
  return output,response
51
 
52
  def volume_estimations(ali):