Spaces:
Sleeping
Sleeping
Upload app.py
Browse filescorreccion bug
app.py
CHANGED
|
@@ -11,7 +11,7 @@ import numpy as np
|
|
| 11 |
def predict_image(img):
|
| 12 |
img = Image.fromarray(img.astype('uint8')) # Pillow detecta modo automáticamente
|
| 13 |
img = img.resize((224, 224)) # Ahora coincide con lo que tu modelo espera
|
| 14 |
-
|
| 15 |
img_array = np.expand_dims(img_array, axis=0) # Batch dimension
|
| 16 |
prediction = modelo.predict(img_array)
|
| 17 |
if prediction[0] > 0.5:
|
|
|
|
| 11 |
def predict_image(img):
|
| 12 |
img = Image.fromarray(img.astype('uint8')) # Pillow detecta modo automáticamente
|
| 13 |
img = img.resize((224, 224)) # Ahora coincide con lo que tu modelo espera
|
| 14 |
+
img_array = np.array(img) / 1.0 # Normaliza
|
| 15 |
img_array = np.expand_dims(img_array, axis=0) # Batch dimension
|
| 16 |
prediction = modelo.predict(img_array)
|
| 17 |
if prediction[0] > 0.5:
|