streamlit4c / app.py
seawolf2357's picture
Update app.py
f1a2b12 verified
raw
history blame
1.46 kB
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"]
# 가러리 ν˜•νƒœλ‘œ λΉ„λ””μ˜€ ν‘œμ‹œ
cols = st.columns(3) # 3개의 μ—΄ 생성
index = 0 # λΉ„λ””μ˜€ 인덱슀 μ΄ˆκΈ°ν™”
# 각 열에 λΉ„λ””μ˜€ 배치
for col in cols:
with col:
if index < len(video_files):
st.video(video_files[index])
index += 1
if index < len(video_files):
st.video(video_files[index])
index += 1