gkdivya commited on
Commit
ac2109d
·
1 Parent(s): 87598e6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -12
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
- brand = st.selectbox('Select Brand', ['IKEA', 'Wayfair', 'Ashley Furniture'])
15
- color = st.multiselect('Select Color', ['Red', 'Blue', 'Green'])
16
- pattern = st.multiselect('Select Pattern', ['Floral', 'Striped', 'Solid'])
17
-
 
 
 
 
 
18
  if st.button('Show Trending TikToks'):
19
  st.write("Display trending TikTok images here...")
20
- # Here you would add the code to display TikTok images
21
- # and links to their videos (considering API availability and legal compliance)
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()