Spaces:
Sleeping
Sleeping
File size: 1,669 Bytes
cead143 79d2b6a 70d8d2a 6e8c858 cebb418 70d8d2a cebb418 70d8d2a 6e8c858 4cebd8f 6d50abd cebb418 70d8d2a cebb418 70d8d2a eda5aa3 cebb418 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 |
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"]
}
# ์ ํ๋ ๋ฉ๋ด ํญ๋ชฉ์ ์ ์ฅํ ๋ณ์
selected_menu = st.sidebar.selectbox("Menu", list(menus.keys()))
selected_sub_menu = st.sidebar.selectbox("Sub Menu", menus[selected_menu])
# 'Template Video'๊ฐ ์ ํ๋์์ ๋ ๋น๋์ค ๊ฐค๋ฌ๋ฆฌ๋ฅผ ํ์
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.jpg", "thum2.jpg", "thum3.jpg", "thum4.jpg", "thum5.jpg", "thum6.jpg"]
# ๊ฐค๋ฌ๋ฆฌ ํํ๋ก ์ธ๋ค์ผ ํ์
cols = st.columns(3)
for index in range(len(thumbnails)):
with cols[index % 3]:
st.image(thumbnails[index], width=100, caption=f"Video {index+1}")
if st.button(f"Play Video {index+1}", key=f"video{index+1}"):
# ์ ํ๋ ๋น๋์ค ์ฌ์
st.video(video_files[index])
# ์ฐธ๊ณ : Streamlit์ ํ์ฌ ์ด๋ฏธ์ง ํด๋ฆญ ์ด๋ฒคํธ๋ฅผ ์ง์ ์ฒ๋ฆฌํ ์ ์์ผ๋ฏ๋ก,
# ๋น๋์ค ์ฌ์์ ์ํ ๋ฒํผ์ ์ ๊ณตํฉ๋๋ค.
|