hasibzunair commited on
Commit
fc938e9
·
1 Parent(s): 602f825
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -31,14 +31,14 @@ def preprocess_image(img_array):
31
  # Convert to 3-channel
32
  img_array = np.stack((img_array, img_array, img_array), axis=-1)
33
  # Convert to array
34
- img_array = cv2.resize(img_array, (224, 224))
35
  return img_array
36
 
37
 
38
  def inference(img):
39
  img = preprocess_image(img)
40
- preds = model.predict(img)
41
  img = np.expand_dims(img, 0)
 
42
  # Predict
43
  preds = model.predict(img)[0]
44
  labels_probs = {labels[i]: float(preds[i]) for i, _ in enumerate(labels)}
 
31
  # Convert to 3-channel
32
  img_array = np.stack((img_array, img_array, img_array), axis=-1)
33
  # Convert to array
34
+ img_array = cv2.resize(img_array, (256, 256))
35
  return img_array
36
 
37
 
38
  def inference(img):
39
  img = preprocess_image(img)
 
40
  img = np.expand_dims(img, 0)
41
+ preds = model.predict(img)
42
  # Predict
43
  preds = model.predict(img)[0]
44
  labels_probs = {labels[i]: float(preds[i]) for i, _ in enumerate(labels)}