Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|