malihoseini commited on
Commit
52a4c27
·
verified ·
1 Parent(s): 0e71c42

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -10,6 +10,7 @@ with open(join(current_dir, 'image_labels.json')) as labels_file:
10
 
11
  mobile_net = tf.keras.applications.MobileNetV2()
12
  def image_classifier(img):
 
13
  arr = np.expand_dims(img, axis=0)
14
  arr = tf.keras.applications.mobilenet.preprocess_input(arr)
15
  prediction = mobile_net.predict(arr).flatten()
 
10
 
11
  mobile_net = tf.keras.applications.MobileNetV2()
12
  def image_classifier(img):
13
+ img = cv2.resize(img, (224,224))
14
  arr = np.expand_dims(img, axis=0)
15
  arr = tf.keras.applications.mobilenet.preprocess_input(arr)
16
  prediction = mobile_net.predict(arr).flatten()