jaydemirandilla commited on
Commit
e8442c5
1 Parent(s): 0762203

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -9,9 +9,12 @@ def classify_food_vs_nonfood(image):
9
  try:
10
  # Preprocess image
11
  #image_size = (224, 224)
12
- image = image.resize(image, [224, 224])
13
- image_np = np.array(image) / 255.0
14
- image_np_expanded = np.expand_dims(image_np, axis=0)
 
 
 
15
 
16
  # Make prediction
17
  prediction = model.predict(image_np_expanded)
 
9
  try:
10
  # Preprocess image
11
  #image_size = (224, 224)
12
+ #image = image.resize(image_size)
13
+ #image_np = np.array(image) / 255.0
14
+ #image_np_expanded = np.expand_dims(image_np, axis=0)
15
+
16
+ image_np_expanded = np.expand_dims(np.array(image.resize((224, 224))) / 255.0, axis=0)
17
+
18
 
19
  # Make prediction
20
  prediction = model.predict(image_np_expanded)