Inoue1 commited on
Commit
4da8345
·
verified ·
1 Parent(s): 4e13890

Update model.py

Browse files
Files changed (1) hide show
  1. model.py +1 -0
model.py CHANGED
@@ -45,6 +45,7 @@ def preprocess_pytorch(img, size=224):
45
  return transform(img).unsqueeze(0)
46
 
47
  def preprocess_keras(img, crop_name):
 
48
  size = KERAS_INPUT_SIZES.get(crop_name, 224)
49
  img = img.resize((size, size))
50
  arr = np.array(img).astype("float32") / 255.0
 
45
  return transform(img).unsqueeze(0)
46
 
47
  def preprocess_keras(img, crop_name):
48
+ img = img.convert("RGB")
49
  size = KERAS_INPUT_SIZES.get(crop_name, 224)
50
  img = img.resize((size, size))
51
  arr = np.array(img).astype("float32") / 255.0