Spaces:
Running
Running
Commit
Β·
c5dd6a1
1
Parent(s):
984fbf2
added food info
Browse files
app.py
CHANGED
@@ -7,6 +7,49 @@ from transformers import AutoModelForImageClassification, AutoImageProcessor
|
|
7 |
image_processor = AutoImageProcessor.from_pretrained("./Mymodel/")
|
8 |
model = AutoModelForImageClassification.from_pretrained("./Mymodel/")
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
def predict(my_image):
|
11 |
|
12 |
image = Image.fromarray(image.astype('uint8'))
|
|
|
7 |
image_processor = AutoImageProcessor.from_pretrained("./Mymodel/")
|
8 |
model = AutoModelForImageClassification.from_pretrained("./Mymodel/")
|
9 |
|
10 |
+
food_info = {
|
11 |
+
'Breakfast Burrito': {
|
12 |
+
'Description': "Wrap up your mornings with a burst of flavor β the breakfast burrito, where every bite is a sunrise in your mouth!",
|
13 |
+
'Calories and Health Info': "The calorie count can vary depending on ingredients, but incorporating whole-grain tortillas, lean proteins, and veggies can make it a balanced and nutritious choice for a hearty breakfast."
|
14 |
+
},
|
15 |
+
'Caesar Salad': {
|
16 |
+
'Description': "Crispy, creamy, and utterly satisfying β the Caesar Salad, where freshness meets indulgence in every crunchy bite!",
|
17 |
+
'Calories and Health Info': "While delicious, be mindful of the dressing and croutons. Opt for a lighter dressing and whole-grain croutons to keep it healthier. Loaded with vitamins and greens, it's a generally nutritious option."
|
18 |
+
},
|
19 |
+
'Chicken Quesadilla': {
|
20 |
+
'Description': "Cheesy, savory, and filled with zest β the chicken quesadilla, because life is better when wrapped in a warm tortilla!",
|
21 |
+
'Calories and Health Info': "Moderation is key. Choose lean chicken and load up on veggies to make it a protein-packed, flavorful treat. Use whole-grain tortillas for added nutritional value."
|
22 |
+
},
|
23 |
+
'Club Sandwich': {
|
24 |
+
'Description': "Layers of delight stacked high β the club sandwich, where every layer tells a story of taste and texture!",
|
25 |
+
'Calories and Health Info': "Opt for whole-grain bread, lean proteins, and plenty of veggies. The club sandwich can be a balanced choice with a mix of carbohydrates, proteins, and essential nutrients."
|
26 |
+
},
|
27 |
+
'Donuts': {
|
28 |
+
'Description': "Ring-shaped bliss, glazed with happiness β donuts, where every bite is a moment of pure joy!",
|
29 |
+
'Calories and Health Info': "A sweet indulgence best enjoyed in moderation. High in sugars and fats, it's a treat for special occasions rather than an everyday choice."
|
30 |
+
},
|
31 |
+
'Fish And Chips': {
|
32 |
+
'Description': "Crispy ocean delights paired with golden perfection β fish and chips, a symphony of crunch and flavor!",
|
33 |
+
'Calories and Health Info': "While delicious, it can be high in calories and fats. Opt for baked or grilled fish and consider sweet potato fries for a healthier twist."
|
34 |
+
},
|
35 |
+
'Hamburger': {
|
36 |
+
'Description': "Juicy, savory, and the epitome of handheld happiness β the hamburger, where every bite is a taste of tradition!",
|
37 |
+
'Calories and Health Info': "Choose lean meats, whole-grain buns, and load up on veggies for a more balanced option. Moderation is key to enjoying this classic."
|
38 |
+
},
|
39 |
+
'Pizza': {
|
40 |
+
'Description': "A slice of heaven in every bite β pizza, where the melding of cheese, sauce, and crust creates an edible masterpiece!",
|
41 |
+
'Calories and Health Info': "Balance is key. Opt for thin crust, load up on veggies, and consider lean protein toppings for a more nutritious pizza experience."
|
42 |
+
},
|
43 |
+
'Samosa': {
|
44 |
+
'Description': "A crispy pocket of delight β samosa, where every fold tells a tale of spices and flavors!",
|
45 |
+
'Calories and Health Info': "While a tasty snack, samosas are often fried. Enjoy in moderation and consider baked versions with a variety of fillings for a healthier option."
|
46 |
+
},
|
47 |
+
'Waffles': {
|
48 |
+
'Description': "Crisp on the outside, fluffy on the inside β waffles, turning breakfast into a golden affair!",
|
49 |
+
'Calories and Health Info': "Opt for whole-grain or alternative flours, and top with fresh fruits or yogurt for added nutrition. Enjoying waffles in moderation can be part of a balanced breakfast."
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
def predict(my_image):
|
54 |
|
55 |
image = Image.fromarray(image.astype('uint8'))
|