from transformers import pipeline | |
from PIL import Image | |
# Function to classify food using the pipeline | |
def classify_food_with_pipeline(image: Image): | |
pipe = pipeline("image-classification", model="nateraw/food") | |
result = pipe(image) | |
return result[0]["label"] | |