GEMRec-Gallery / pages /2_๐ŸŽ–๏ธ_Ranking.py
Ricercar's picture
new version! multiple pages!
bca2bcb
raw
history blame
No virus
954 Bytes
import streamlit as st
import numpy as np
import pandas as pd
from streamlit_extras.switch_page_button import switch_page
if __name__ == "__main__":
st.set_page_config(page_title="Personal Image Ranking", page_icon="๐ŸŽ–๏ธ๏ธ", layout="wide")
if 'user_id' not in st.session_state:
st.warning('Please log in first.')
home_btn = st.button('Go to Home Page')
if home_btn:
switch_page("home")
else:
all_checked = 0
for key, value in st.session_state.selected_dict.items():
for v in value:
all_checked += 1
if all_checked == 0:
st.info('You have not checked any image yet. Please go back to the gallery page and check some images.')
gallery_btn = st.button('Go to Gallery')
if gallery_btn:
switch_page('gallery')
else:
st.write('You have checked ' + str(all_checked) + ' images.')