Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -88,17 +88,24 @@ def main_page(furniture_data):
|
|
| 88 |
|
| 89 |
if filtered_images:
|
| 90 |
for image_name in filtered_images:
|
| 91 |
-
st.image('./images/'+image_name, width=150)
|
| 92 |
-
|
| 93 |
source_video = images_data[image_name].get("source_video")
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
else:
|
| 103 |
st.write("Not Trending")
|
| 104 |
|
|
|
|
| 88 |
|
| 89 |
if filtered_images:
|
| 90 |
for image_name in filtered_images:
|
|
|
|
|
|
|
| 91 |
source_video = images_data[image_name].get("source_video")
|
| 92 |
+
col1, col2, col3 = st.columns([1, 3, 5])
|
| 93 |
+
with col1:
|
| 94 |
+
st.image('./images/'+image_name, width=150)
|
| 95 |
+
with col2:
|
| 96 |
+
if source_video and source_video in videos_data:
|
| 97 |
+
video_url = videos_data[source_video]["url"]
|
| 98 |
+
if st.button(f'Play Video for {image_name}', key=image_name):
|
| 99 |
+
st.video(video_url)
|
| 100 |
+
with col3:
|
| 101 |
+
if source_video and source_video in videos_data:
|
| 102 |
+
with st.expander(f"Show Metadata for {image_name}"):
|
| 103 |
+
video_metadata = videos_data[source_video]
|
| 104 |
+
print(video_metadata)
|
| 105 |
+
# Convert the metadata dictionary to a list of lists for st.table
|
| 106 |
+
metadata_for_table = [[key, value] for key, value in video_metadata.items()]
|
| 107 |
+
st.table(metadata_for_table)
|
| 108 |
+
|
| 109 |
else:
|
| 110 |
st.write("Not Trending")
|
| 111 |
|