Nutrition / portion_size_analysis.py
dschandra's picture
Update portion_size_analysis.py
5998a39 verified
raw
history blame contribute delete
375 Bytes
def estimate_portion_size(image):
"""
Estimate portion size based on image dimensions (e.g., bowl/plate size).
"""
width, height = image.size
avg_dimension = (width + height) / 2
if avg_dimension < 300:
return "Small (1 person)"
elif avg_dimension < 600:
return "Medium (1-2 people)"
else:
return "Large (2-4 people)"