Update portion_size_analysis.py
Browse files- portion_size_analysis.py +2 -6
portion_size_analysis.py
CHANGED
|
@@ -1,13 +1,9 @@
|
|
| 1 |
-
import numpy as np
|
| 2 |
-
|
| 3 |
def estimate_portion_size(image):
|
| 4 |
"""
|
| 5 |
-
Estimate
|
| 6 |
"""
|
| 7 |
-
# Assume some logic to detect the size of the plate/bowl
|
| 8 |
-
# For simplicity, hardcoded bowl size detection based on image width
|
| 9 |
width, height = image.size
|
| 10 |
-
avg_dimension = (width + height)
|
| 11 |
|
| 12 |
if avg_dimension < 300:
|
| 13 |
return "Small (1 person)"
|
|
|
|
|
|
|
|
|
|
| 1 |
def estimate_portion_size(image):
|
| 2 |
"""
|
| 3 |
+
Estimate portion size based on image dimensions (e.g., bowl/plate size).
|
| 4 |
"""
|
|
|
|
|
|
|
| 5 |
width, height = image.size
|
| 6 |
+
avg_dimension = (width + height) / 2
|
| 7 |
|
| 8 |
if avg_dimension < 300:
|
| 9 |
return "Small (1 person)"
|