Sayandip commited on
Commit
e54ba43
·
verified ·
1 Parent(s): 3f55ef6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -14,6 +14,8 @@ model = load_model()
14
 
15
  # Preprocessing function
16
  def preprocess_image(image):
 
 
17
  image = image.resize((224, 224))
18
  image_array = np.array(image) / 255.0
19
  image_array = np.expand_dims(image_array, axis=0) # Add batch dimension
 
14
 
15
  # Preprocessing function
16
  def preprocess_image(image):
17
+ # Convert to RGB to ensure 3 channels
18
+ image = image.convert("RGB")
19
  image = image.resize((224, 224))
20
  image_array = np.array(image) / 255.0
21
  image_array = np.expand_dims(image_array, axis=0) # Add batch dimension