Food_Classifier_and_Recipe_Finder / image_classifier.py
Muhammad Nabeel
Upload 5 files
bd8472c 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"]