Spaces:
Runtime error
Runtime error
Commit ·
57ecf45
1
Parent(s): 9cfd14e
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,8 +11,13 @@ file = st.file_uploader("Por favor suba una imagen de ropa (jpg, png, jpeg)", ty
|
|
| 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(x, cmap=plt.cm.binary)
|
| 18 |
plt.colorbar()
|
|
|
|
| 11 |
if file is not None:
|
| 12 |
bytes_data = file.read()
|
| 13 |
x = np.array(Image.open(BytesIO(bytes_data)).convert('L'))
|
|
|
|
| 14 |
x = x / 255.00
|
| 15 |
+
x = np.expand_dims(x, axis=-1)
|
| 16 |
+
print(x.shape)
|
| 17 |
+
x = tf.image.resize(x [80, 80])
|
| 18 |
+
print(x.shape)
|
| 19 |
+
x = np.repeat(x[:, :, np.newaxis], 3, axis=2)
|
| 20 |
+
print(x.shape)
|
| 21 |
plt.figure()
|
| 22 |
plt.imshow(x, cmap=plt.cm.binary)
|
| 23 |
plt.colorbar()
|