PicFinder / app.py
osanchik's picture
added setup.py
55315c3
raw
history blame
746 Bytes
import streamlit as st
from main import *
from PIL import Image
def display(search_request, search_result) :
#put your own image here
lorax = Image.open('img/Lorax.jpg')
print(lorax.width, lorax.height)
st.image(lorax, width = 250)
st.header("\"" +search_request+ "\" reminds me of :")
i = 0
for row in range(0, 2):
for col in st.columns(2) :
image_name, comment = search_result[i]
col.image("img/"+image_name, width = 300)
col.header(comment)
i = i + 1
return
st.title('Find my pic!')
search_request = st.text_input('', 'Search ...')
if st.button('Find!'):
search_result = search(search_request)
display(search_request, search_result)