aje6 commited on
Commit
a25049c
·
verified ·
1 Parent(s): 0dafd93

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -251,6 +251,10 @@ def predict(image):
251
  # Normalize the image
252
  mean = [0.485, 0.456, 0.406]
253
  std = [0.229, 0.224, 0.225]
 
 
 
 
254
  image = (image / 255.0 - mean)/std
255
 
256
  print("normalized image:", image.shape)
 
251
  # Normalize the image
252
  mean = [0.485, 0.456, 0.406]
253
  std = [0.229, 0.224, 0.225]
254
+
255
+ mean = np.expand_dims(mean, axis=(1,2))
256
+ std = np.expand_dims(std, axis=(1,2))
257
+
258
  image = (image / 255.0 - mean)/std
259
 
260
  print("normalized image:", image.shape)