proyecto-final / app.py
lfernandopg's picture
Update app.py
35203cd
raw
history blame
866 Bytes
import streamlit as st
from PIL import Image
from io import BytesIO
import tensorflow as tf
import matplotlib.pyplot as plt
import numpy as np
model = tf.keras.models.load_model('modelo.h5')
file = st.file_uploader("Por favor suba una imagen de ropa (jpg, png, jpeg)", type=['jpg','png','jpeg'])
if file is not None:
bytes_data = file.read()
x = np.array(Image.open(BytesIO(bytes_data).convert('L')))
print(x.shape)
x = x / 255.00
plt.figure()
plt.imshow(imagen, cmap=plt.cm.binary)
plt.colorbar()
plt.grid(False)
plt.show()
col1, col2, col3 = st.columns(3)
with col1:
st.write("")
with col2:
image = Image.open(file)
st.markdown('<p style="text-align: center;">Image</p>',unsafe_allow_html=True)
st.image(image,width=300)
with col3:
st.write("")