Spaces:
Sleeping
Sleeping
File size: 1,673 Bytes
cead143 70d8d2a 79d2b6a 70d8d2a 6e8c858 70d8d2a 6e8c858 70d8d2a a3b9bb0 70d8d2a a3b9bb0 70d8d2a 6e8c858 70d8d2a |
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 45 |
import streamlit as st
import os
# ์ฌ์ด๋๋ฐ ํ์ดํ ์ค์
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 = None
selected_sub_menu = None
# ๋ฉ๋ด ์์ฑ
selected_menu = st.sidebar.selectbox("Menu", list(menus.keys()))
selected_sub_menu = st.sidebar.selectbox("Sub Menu", menus[selected_menu])
# ๋ฉ๋ด ์ ํ์ ๋ฐ๋ฅธ ๋์ ๊ตฌํ
if selected_menu == "Free Stock" and selected_sub_menu == "Template Video":
# ๋น๋์ค ํ์ผ์ด ์๋ ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก ์ค์
video_directory = "/path/to/your/videos" # ๊ฒฝ๋ก๋ฅผ ์ค์ ๋น๋์ค ํ์ผ์ด ์๋ ๊ฒฝ๋ก๋ก ๋ณ๊ฒฝํ์ธ์.
# ๋๋ ํ ๋ฆฌ ๋ด์ ๋ชจ๋ ํ์ผ ๋ชฉ๋ก์ ๊ฐ์ ธ์ด
files = os.listdir(video_directory)
# MP4 ํ์ผ๋ง ํํฐ๋ง
video_files = [file for file in files if file.endswith(".mp4")]
# ๊ฐ ๋น๋์ค ํ์ผ์ ๋ํด ์คํธ๋ฆผ๋ฆฟ ๋น๋์ค ์์ ฏ ์์ฑ
for video_file in video_files:
# ํ์ผ์ ์ ์ฒด ๊ฒฝ๋ก ์์ฑ
video_path = os.path.join(video_directory, video_file)
# ๋น๋์ค ์ ๋ชฉ์ ์ถ๋ ฅ
st.subheader(video_file)
# ๋น๋์ค ํ์ผ์ ์คํธ๋ฆผ๋ฆฟ์ ํตํด ํ์
st.video(video_path)
|