lfernandopg commited on
Commit
35203cd
1 Parent(s): 8e1216a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -1,5 +1,6 @@
1
  import streamlit as st
2
  from PIL import Image
 
3
  import tensorflow as tf
4
  import matplotlib.pyplot as plt
5
  import numpy as np
@@ -9,7 +10,8 @@ model = tf.keras.models.load_model('modelo.h5')
9
  file = st.file_uploader("Por favor suba una imagen de ropa (jpg, png, jpeg)", type=['jpg','png','jpeg'])
10
  if file is not None:
11
  bytes_data = file.read()
12
- x = np.array(Image.open(BytesIO(bytes_data)))
 
13
  x = x / 255.00
14
  plt.figure()
15
  plt.imshow(imagen, cmap=plt.cm.binary)
 
1
  import streamlit as st
2
  from PIL import Image
3
+ from io import BytesIO
4
  import tensorflow as tf
5
  import matplotlib.pyplot as plt
6
  import numpy as np
 
10
  file = st.file_uploader("Por favor suba una imagen de ropa (jpg, png, jpeg)", type=['jpg','png','jpeg'])
11
  if file is not None:
12
  bytes_data = file.read()
13
+ x = np.array(Image.open(BytesIO(bytes_data).convert('L')))
14
+ print(x.shape)
15
  x = x / 255.00
16
  plt.figure()
17
  plt.imshow(imagen, cmap=plt.cm.binary)