Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -54,12 +54,11 @@ def run():
|
|
54 |
|
55 |
if upload is not None:
|
56 |
img = Image.open(upload)
|
57 |
-
img = img.resize((224, 224
|
58 |
img_array = np.array(img)
|
59 |
img_array = img_array / 255.0
|
60 |
img_array = np.expand_dims(img_array, axis=0)
|
61 |
-
|
62 |
-
|
63 |
# Model inference
|
64 |
images = np.vstack([img_array])
|
65 |
classes = model_cnn.predict(images)
|
|
|
54 |
|
55 |
if upload is not None:
|
56 |
img = Image.open(upload)
|
57 |
+
img = img.resize((224, 224)).convert("RGB")
|
58 |
img_array = np.array(img)
|
59 |
img_array = img_array / 255.0
|
60 |
img_array = np.expand_dims(img_array, axis=0)
|
61 |
+
|
|
|
62 |
# Model inference
|
63 |
images = np.vstack([img_array])
|
64 |
classes = model_cnn.predict(images)
|