Spaces:
Running
Running
File size: 2,455 Bytes
cead143 79d2b6a 970d605 cf6dcc7 70d8d2a 6e8c858 4e604e3 6e8c858 cebb418 70d8d2a cebb418 70d8d2a 6e8c858 970d605 4e604e3 130998d 4e604e3 |
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 46 47 48 49 50 51 52 53 54 55 56 57 |
import streamlit as st
# νμ΄μ§ μ€μ
st.set_page_config(layout="wide")
# μ¬μ΄λλ° νμ΄ν μ€μ
st.sidebar.title("ViDraft")
# 'Home' λ²νΌμ μ¬μ΄λλ°μ μΆκ°
if st.sidebar.button('Home'):
selected_menu = 'Home'
selected_sub_menu = None
else:
selected_menu = None
selected_sub_menu = None
# λ©λ΄ νλͺ©κ³Ό νμ νλͺ© μ μ, 'Home' λ©λ΄λ λ²νΌμΌλ‘ μ²λ¦¬λλ―λ‘ μ¬κΈ°μλ ν¬ν¨μν€μ§ μμ
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_name, sub_menus in menus.items():
with st.sidebar.expander(menu_name):
# νλΆ λ©λ΄λ₯Ό μ νν μ μλ selectbox μμ±
selected = st.selectbox(f"Select {menu_name} option", [""] + sub_menus, key=menu_name)
if selected:
selected_menu = menu_name
selected_sub_menu = selected
# μ νλ λ©λ΄μ νλΆ λ©λ΄μ λ°λ₯Έ λ΄μ© νμ
if selected_menu and selected_sub_menu:
st.subheader(f"{selected_menu} > {selected_sub_menu}")
# μ¬κΈ°μ μ νλ λ©λ΄μ λ°λ₯Έ μ½ν
μΈ νμ λ‘μ§ μΆκ°
# 'Home' λ©λ΄κ° μ νλμμ λ λλ μ±μ΄ μ΄κΈ° μνμΌ λ νλ©΄μ "ViDraft" μΆλ ₯
if selected_menu == 'Home' or (selected_menu is None and selected_sub_menu is None):
st.title("ViDraft")
st.write("Welcome to ViDraft! Your ultimate platform for video editing, image processing, and sound engineering.")
# '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", "ex7.mp4","ex8.mp4", "ex9.mp4", "ex10.mp4", "ex11.mp4", "ex12.mp4", "ex13.mp4", "ex14.mp4","ex15.mp4", "ex16.mp4", "ex17.mp4", "ex18.mp4"]
# κ°€λ¬λ¦¬ ννλ‘ λΉλμ€ νμ
cols = st.columns(2) # 2κ°μ μ΄λ‘ λκ² λ°°μΉ
for index, video_file in enumerate(video_files):
with cols[index % 2]:
st.video(video_file)
|