import streamlit as st from PIL import Image # x = st.slider('Select a value') # st.write(x, 'squared is', x * x) image = Image.open('demo_image/demo_ballys.jpg') #Brand logo image (optional) #Create two columns with different width col1, col2 = st.columns( [0.8, 0.2]) with col1: # To display the header text using css style st.markdown(""" """, unsafe_allow_html=True) st.markdown('

Upload your photo here...

', unsafe_allow_html=True) with col2: # To display brand logo st.image(image, width=150) uploaded_file = st.file_uploader("Choose a file", type=["png", "jpg"]) if uploaded_file is not None: # To read file as bytes: bytes_data = uploaded_file.getvalue() pillowImg = Image.open(uploaded_file) # print("pillowImg shape: ", ) st.write(pillowImg.size) # # To convert to a string based IO: # stringio = StringIO(uploaded_file.getvalue().decode("utf-8")) # st.write(stringio) # # # To read file as string: # string_data = stringio.read() # st.write(string_data) # # # Can be used wherever a "file-like" object is accepted: # dataframe = pd.read_csv(uploaded_file) # st.write(dataframe)