Spaces:
Sleeping
Sleeping
File size: 1,834 Bytes
cead143 79d2b6a 70d8d2a 6e8c858 cebb418 70d8d2a cebb418 70d8d2a 6e8c858 f47671d 84b6b16 f47671d 84b6b16 f47671d 6d50abd e105dd1 70d8d2a cebb418 eda5aa3 5c0e140 cebb418 eda5aa3 84b6b16 eda5aa3 e105dd1 eda5aa3 |
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 33 34 35 36 37 38 39 40 41 42 43 44 |
import streamlit as st
# ์ฌ์ด๋๋ฐ ํ์ดํ ์ค์
st.sidebar.title("ViDraft")
# ๋ฉ๋ด ํญ๋ชฉ๊ณผ ํ์ ํญ๋ชฉ ์ ์
menus = {
"Free Stock": ["Template Video", "Template Image", "Search Video", "Search Image"],
"Image": ["Generation", "Face ID", "Inpainting", "Remove Background", "Studio"],
"Video": ["Generation", "Talking Face", "Remove Background", "Studio"],
"Sound": ["Video SFX", "Video Music", "TTS(Voice)", "Voice Clone", "Image SFX", "Image Music"],
"Scripts": ["Script"]
}
# ๋ฉ๋ด ์์ฑ
for menu, sub_menus in menus.items():
with st.sidebar.expander(menu):
for sub_menu in sub_menus:
# ๊ณ ์ ํ key ์์ฑ์ ์ํด menu์ sub_menu ๊ฐ์ ๊ฒฐํฉ
button_key = f"{menu}_{sub_menu}"
if st.button(sub_menu, key=button_key):
selected_menu = menu
selected_sub_menu = sub_menu
# ์ ํ๋ ๋ฉ๋ด์ ์๋ธ ๋ฉ๋ด์ ๋ํ ์ฒ๋ฆฌ ๋ก์ง์ ์ฌ๊ธฐ์ ์ถ๊ฐ
# ์ ํ๋ ๋ฉ๋ด ๋ฐ ์๋ธ๋ฉ๋ด์ ๋ฐ๋ผ ๋ด์ฉ ํ์
if selected_menu == "Free Stock" and selected_sub_menu == "Template Video":
st.subheader("Template Videos")
# ๋น๋์ค ํ์ผ๊ณผ ์ธ๋ค์ผ ์ด๋ฏธ์ง ๊ฒฝ๋ก ์ค์
video_files = ["ex1.mp4", "ex2.mp4", "ex3.mp4", "ex4.mp4", "ex5.mp4", "ex6.mp4"]
thumbnails = ["thum1.png", "thum2.png", "thum3.png", "thum4.png", "thum5.png", "thum6.png"]
# ๊ฐค๋ฌ๋ฆฌ ํํ๋ก ์ธ๋ค์ผ ํ์
cols = st.columns(3)
for index, thumbnail in enumerate(thumbnails):
with cols[index % 3]:
st.image(thumbnail, width=200, caption=f"Video {index+1}")
# 'Play Video' ๋ฒํผ ์ถ๊ฐ
if st.button(f"Play Video {index+1}", key=f"play_{index}"):
# ์ ํ๋ ๋น๋์ค ์ฌ์
st.video(video_files[index])
|