File size: 746 Bytes
f7b6c7e 5381f67 55315c3 f7b6c7e 8df0b72 55315c3 8df0b72 55315c3 8df0b72 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
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) |