Food_Classifier / image_classifier.py
nabeel857's picture
Upload 6 files
dd5ae0f verified
raw
history blame contribute delete
280 Bytes
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"]