dschandra commited on
Commit
5998a39
·
verified ·
1 Parent(s): e5a7e53

Update portion_size_analysis.py

Browse files
Files changed (1) hide show
  1. 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 the portion size based on the size of bowls/plates in the image.
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) // 2
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)"