Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,11 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
# Custom CSS to style the buttons
|
| 4 |
st.markdown("""
|
|
@@ -8,23 +15,25 @@ st.markdown("""
|
|
| 8 |
""", unsafe_allow_html=True)
|
| 9 |
|
| 10 |
# Function to display the main page
|
| 11 |
-
def main_page():
|
| 12 |
st.title("Trending TikTok Furniture Showcase")
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
if st.button('Show Trending TikToks'):
|
| 19 |
st.write("Display trending TikTok images here...")
|
| 20 |
-
#
|
| 21 |
-
|
| 22 |
-
|
| 23 |
# Function to display the TikTok video page
|
| 24 |
def tiktok_video_page():
|
| 25 |
st.title("TikTok Video and Metadata")
|
| 26 |
-
|
| 27 |
-
# Placeholder for TikTok video and metadata
|
| 28 |
st.video("URL_of_the_TikTok_video")
|
| 29 |
st.write("Metadata of the TikTok video...")
|
| 30 |
|
|
@@ -32,10 +41,11 @@ def tiktok_video_page():
|
|
| 32 |
main_page()
|
| 33 |
|
| 34 |
# Main app logic
|
|
|
|
| 35 |
if 'page' not in st.session_state:
|
| 36 |
st.session_state.page = 'main'
|
| 37 |
|
| 38 |
if st.session_state.page == 'main':
|
| 39 |
-
main_page()
|
| 40 |
elif st.session_state.page == 'tiktok_video':
|
| 41 |
tiktok_video_page()
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import json
|
| 3 |
+
|
| 4 |
+
# Load furniture categories and attributes from a JSON file
|
| 5 |
+
def load_furniture_data():
|
| 6 |
+
with open('./config/furniture_taxonomy.json', 'r') as file:
|
| 7 |
+
data = json.load(file)
|
| 8 |
+
return data
|
| 9 |
|
| 10 |
# Custom CSS to style the buttons
|
| 11 |
st.markdown("""
|
|
|
|
| 15 |
""", unsafe_allow_html=True)
|
| 16 |
|
| 17 |
# Function to display the main page
|
| 18 |
+
def main_page(furniture_data):
|
| 19 |
st.title("Trending TikTok Furniture Showcase")
|
| 20 |
+
|
| 21 |
+
# Dropdown for selecting furniture category
|
| 22 |
+
categories = list(furniture_data['Furniture'].keys())
|
| 23 |
+
selected_category = st.selectbox('Select Category', categories)
|
| 24 |
+
|
| 25 |
+
# Load attributes based on the selected category
|
| 26 |
+
attributes = furniture_data['Furniture'][selected_category]['attributes']
|
| 27 |
+
for attribute, options in attributes.items():
|
| 28 |
+
st.multiselect(f'Choose {attribute}', options)
|
| 29 |
+
|
| 30 |
if st.button('Show Trending TikToks'):
|
| 31 |
st.write("Display trending TikTok images here...")
|
| 32 |
+
# Display TikTok images and links (implementation depends on data source)
|
| 33 |
+
|
|
|
|
| 34 |
# Function to display the TikTok video page
|
| 35 |
def tiktok_video_page():
|
| 36 |
st.title("TikTok Video and Metadata")
|
|
|
|
|
|
|
| 37 |
st.video("URL_of_the_TikTok_video")
|
| 38 |
st.write("Metadata of the TikTok video...")
|
| 39 |
|
|
|
|
| 41 |
main_page()
|
| 42 |
|
| 43 |
# Main app logic
|
| 44 |
+
furniture_data = load_furniture_data()
|
| 45 |
if 'page' not in st.session_state:
|
| 46 |
st.session_state.page = 'main'
|
| 47 |
|
| 48 |
if st.session_state.page == 'main':
|
| 49 |
+
main_page(furniture_data)
|
| 50 |
elif st.session_state.page == 'tiktok_video':
|
| 51 |
tiktok_video_page()
|