Spaces:
Running
Running
import streamlit as st | |
# νμ΄μ§ μ€μ | |
st.set_page_config(page_title="ViDraft", layout="wide") | |
# μ¬μ΄λλ° νμ΄ν μ€μ λ° λ©λ΄ μ μ | |
st.sidebar.title("ViDraft") | |
menu = ["Home", "Free Stock", "Image", "Video", "Sound", "Scripts"] | |
sub_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"], | |
} | |
# μΈμ μν μ΄κΈ°ν | |
if 'current_menu' not in st.session_state: | |
st.session_state['current_menu'] = 'Home' | |
if 'current_sub_menu' not in st.session_state: | |
st.session_state['current_sub_menu'] = '' | |
# λ©μΈ λ©λ΄ μ ν | |
selected_menu = st.sidebar.selectbox("Menu", menu) | |
st.session_state['current_menu'] = selected_menu | |
# νμ λ©λ΄ μ ν (ν΄λΉλλ κ²½μ°) | |
if selected_menu in sub_menus: | |
selected_sub_menu = st.sidebar.selectbox("Sub Menu", [""] + sub_menus[selected_menu]) | |
st.session_state['current_sub_menu'] = selected_sub_menu | |
else: | |
st.session_state['current_sub_menu'] = '' | |
# 'Home' νμ΄μ§ νμ | |
if selected_menu == "Home": | |
st.header("Welcome to ViDraft") | |
st.write("Choose an option from the sidebar to get started.") | |
# 'Free Stock' λ©λ΄ νμ | |
elif selected_menu == "Free Stock": | |
if st.session_state['current_sub_menu'] == "Template Video": | |
st.header("Template Videos") | |
st.write("Explore a variety of video templates.") | |
# λΉλμ€ νμΌ κ²½λ‘ μ€μ λ° λΉλμ€ νμ λ‘μ§ | |
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) | |
elif st.session_state['current_sub_menu'] == "Template Image": | |
st.header("Template Images") | |
st.write("Find the perfect image template for your project.") | |
elif st.session_state['current_sub_menu'] == "Search Video": | |
st.header("Search Videos") | |
st.write("Search through our extensive video library to find exactly what you need.") | |
elif st.session_state['current_sub_menu'] == "Search Image": | |
st.header("Search Images") | |
st.write("Discover images that fit your project's needs with our powerful search tool.") | |
# 'Image' λ©λ΄ νμ | |
elif selected_menu == "Image": | |
if st.session_state['current_sub_menu'] == "Generation": | |
st.header("Image Generation") | |
st.write("Generate images using AI.") | |
elif st.session_state['current_sub_menu'] == "Face ID": | |
st.header("Face ID") | |
st.write("Identify and analyze faces in images.") | |
elif st.session_state['current_sub_menu'] == "Inpainting": | |
st.header("Inpainting") | |
st.write("Fill in missing parts of images.") | |
elif st.session_state['current_sub_menu'] == "Remove Background": | |
st.header("Remove Background") | |
st.write("Easily remove backgrounds from images.") | |
elif st.session_state['current_sub_menu'] == "Studio": | |
st.header("Image Studio") | |
st.write("Access a suite of image editing tools.") | |
# 'Video' λ©λ΄ νμ | |
elif selected_menu == "Video": | |
if st.session_state['current_sub_menu'] == "Generation": | |
st.header("Video Generation") | |
st.write("Create videos with our generation tools.") | |
elif st.session_state['current_sub_menu'] == "Talking Face": | |
st.header("Talking Face Videos") | |
st.write("Generate talking face videos from images.") | |
elif st.session_state['current_sub_menu'] == "Remove Background": | |
st.header("Video Background Removal") | |
st.write("Remove backgrounds from your videos effortlessly.") | |
elif st.session_state['current_sub_menu'] == "Studio": | |
st.header("Video Studio") | |
st.write("Explore our video editing studio for advanced editing.") | |
# 'Sound' λ©λ΄ νμ | |
elif selected_menu == "Sound": | |
if st.session_state['current_sub_menu'] == "Video SFX": | |
st.header("Video Sound Effects") | |
st.write("Enhance your videos with sound effects.") | |
elif st.session_state['current_sub_menu'] == "Video Music": | |
st.header("Video Music") | |
st.write("Find the perfect music for your video content.") | |
elif st.session_state['current_sub_menu'] == "TTS(Voice)": | |
st.header("Text-to-Speech") | |
st.write("Convert your text into natural-sounding voice.") | |
elif st.session_state['current_sub_menu'] == "Voice Clone": | |
st.header("Voice Cloning") | |
st.write("Clone any voice for your projects.") | |
elif st.session_state['current_sub_menu'] == "Image SFX": | |
st.header("Image Sound Effects") | |
st.write("Add sound effects to your images.") | |
elif st.session_state['current_sub_menu'] == "Image Music": | |
st.header("Image Music") | |
st.write("Associate music tracks with your images.") | |
# 'Scripts' λ©λ΄λ νμ λ©λ΄κ° μμΌλ―λ‘ μ§μ μ²λ¦¬ | |
elif selected_menu == "Scripts": | |
st.header("Scripts") | |
st.write("Script writing tools and resources.") | |
# μ΄ κ΅¬μ‘°λ₯Ό μ¬μ©νμ¬ λ€λ₯Έ λ©λ΄ λ° νμ λ©λ΄μ λν μ½ν μΈ λ₯Ό μΆκ°ν μ μμ΅λλ€. | |