gusdelact commited on
Commit
7e0c35b
·
verified ·
1 Parent(s): 14d6d4d

Upload app.py

Browse files

correccion bug

Files changed (1) hide show
  1. app.py +1 -1
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
- # img_array = np.array(img) / 255.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:
 
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: