Spaces:
Sleeping
Sleeping
seawolf2357
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -3,53 +3,49 @@ import streamlit as st
|
|
3 |
# νμ΄μ§ μ€μ
|
4 |
st.set_page_config(page_title="ViDraft", layout="wide")
|
5 |
|
6 |
-
# μ¬μ΄λλ° νμ΄ν μ€μ
|
7 |
st.sidebar.title("ViDraft")
|
8 |
-
|
9 |
-
|
|
|
|
|
10 |
"Free Stock": ["Template Video", "Template Image", "Search Video", "Search Image"],
|
11 |
"Image": ["Generation", "Face ID", "Inpainting", "Remove Background", "Studio"],
|
12 |
"Video": ["Generation", "Talking Face", "Remove Background", "Studio"],
|
13 |
-
"Sound": ["Video SFX", "Video Music", "TTS(Voice)", "
|
|
|
14 |
}
|
15 |
|
16 |
-
#
|
17 |
-
|
18 |
-
st.
|
19 |
-
if
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
-
# λ©μΈ λ©λ΄ μ ν
|
23 |
-
selected_menu = st.sidebar.selectbox("Menu", menu)
|
24 |
-
st.session_state['current_menu'] = selected_menu
|
25 |
|
26 |
-
# νμ λ©λ΄ μ ν (ν΄λΉλλ κ²½μ°)
|
27 |
-
if selected_menu in sub_menus:
|
28 |
-
selected_sub_menu = st.sidebar.selectbox("Sub Menu", [""] + sub_menus[selected_menu])
|
29 |
-
st.session_state['current_sub_menu'] = selected_sub_menu
|
30 |
-
else:
|
31 |
-
st.session_state['current_sub_menu'] = ''
|
32 |
|
33 |
# 'Home' νμ΄μ§ νμ
|
34 |
if selected_menu == "Home":
|
35 |
st.header("Welcome to ViDraft")
|
36 |
st.write("Choose an option from the sidebar to get started.")
|
37 |
-
|
38 |
-
# 'Free Stock' λ©λ΄ νμ
|
39 |
elif selected_menu == "Free Stock":
|
|
|
40 |
if st.session_state['current_sub_menu'] == "Template Video":
|
41 |
st.header("Template Videos")
|
42 |
st.write("Explore a variety of video templates.")
|
43 |
-
|
44 |
# λΉλμ€ νμΌ κ²½λ‘ μ€μ λ° λΉλμ€ νμ λ‘μ§
|
45 |
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"]
|
46 |
-
|
47 |
# κ°€λ¬λ¦¬ ννλ‘ λΉλμ€ νμ
|
48 |
cols = st.columns(2) # 2κ°μ μ΄λ‘ λκ² λ°°μΉ
|
49 |
for index, video_file in enumerate(video_files):
|
50 |
with cols[index % 2]:
|
51 |
st.video(video_file)
|
52 |
-
|
53 |
elif st.session_state['current_sub_menu'] == "Template Image":
|
54 |
st.header("Template Images")
|
55 |
st.write("Find the perfect image template for your project.")
|
@@ -59,9 +55,13 @@ elif selected_menu == "Free Stock":
|
|
59 |
elif st.session_state['current_sub_menu'] == "Search Image":
|
60 |
st.header("Search Images")
|
61 |
st.write("Discover images that fit your project's needs with our powerful search tool.")
|
|
|
62 |
|
|
|
|
|
|
|
63 |
|
64 |
-
# 'Image' λ©λ΄
|
65 |
elif selected_menu == "Image":
|
66 |
if st.session_state['current_sub_menu'] == "Generation":
|
67 |
st.header("Image Generation")
|
@@ -79,7 +79,7 @@ elif selected_menu == "Image":
|
|
79 |
st.header("Image Studio")
|
80 |
st.write("Access a suite of image editing tools.")
|
81 |
|
82 |
-
# 'Video' λ©λ΄
|
83 |
elif selected_menu == "Video":
|
84 |
if st.session_state['current_sub_menu'] == "Generation":
|
85 |
st.header("Video Generation")
|
@@ -94,7 +94,7 @@ elif selected_menu == "Video":
|
|
94 |
st.header("Video Studio")
|
95 |
st.write("Explore our video editing studio for advanced editing.")
|
96 |
|
97 |
-
# 'Sound' λ©λ΄
|
98 |
elif selected_menu == "Sound":
|
99 |
if st.session_state['current_sub_menu'] == "Video SFX":
|
100 |
st.header("Video Sound Effects")
|
@@ -105,9 +105,6 @@ elif selected_menu == "Sound":
|
|
105 |
elif st.session_state['current_sub_menu'] == "TTS(Voice)":
|
106 |
st.header("Text-to-Speech")
|
107 |
st.write("Convert your text into natural-sounding voice.")
|
108 |
-
elif st.session_state['current_sub_menu'] == "Voice Clone":
|
109 |
-
st.header("Voice Cloning")
|
110 |
-
st.write("Clone any voice for your projects.")
|
111 |
elif st.session_state['current_sub_menu'] == "Image SFX":
|
112 |
st.header("Image Sound Effects")
|
113 |
st.write("Add sound effects to your images.")
|
@@ -115,16 +112,7 @@ elif selected_menu == "Sound":
|
|
115 |
st.header("Image Music")
|
116 |
st.write("Associate music tracks with your images.")
|
117 |
|
118 |
-
|
119 |
-
# 'Scripts' λ©λ΄λ νμ λ©λ΄κ° μμΌλ―λ‘ μ§μ μ²λ¦¬
|
120 |
elif selected_menu == "Scripts":
|
121 |
st.header("Scripts")
|
122 |
st.write("Script writing tools and resources.")
|
123 |
-
|
124 |
-
# μ΄ κ΅¬μ‘°λ₯Ό μ¬μ©νμ¬ λ€λ₯Έ λ©λ΄ λ° νμ λ©λ΄μ λν μ½ν
μΈ λ₯Ό μΆκ°ν μ μμ΅λλ€.
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
|
|
3 |
# νμ΄μ§ μ€μ
|
4 |
st.set_page_config(page_title="ViDraft", layout="wide")
|
5 |
|
6 |
+
# μ¬μ΄λλ° νμ΄ν μ€μ
|
7 |
st.sidebar.title("ViDraft")
|
8 |
+
|
9 |
+
# λ©λ΄ λ° νμ λ©λ΄ μ μ
|
10 |
+
menus = {
|
11 |
+
"Home": [],
|
12 |
"Free Stock": ["Template Video", "Template Image", "Search Video", "Search Image"],
|
13 |
"Image": ["Generation", "Face ID", "Inpainting", "Remove Background", "Studio"],
|
14 |
"Video": ["Generation", "Talking Face", "Remove Background", "Studio"],
|
15 |
+
"Sound": ["Video SFX", "Video Music", "TTS(Voice)", "Image SFX", "Image Music"],
|
16 |
+
"Scripts": []
|
17 |
}
|
18 |
|
19 |
+
# λͺ¨λ λ©λ΄ λ° νμ λ©λ΄λ₯Ό νΌμ³μ 보μ¬μ£ΌκΈ° μν λ‘μ§
|
20 |
+
for menu_name, sub_menus in menus.items():
|
21 |
+
with st.sidebar.expander(menu_name):
|
22 |
+
if sub_menus: # νμ λ©λ΄κ° μλ κ²½μ°
|
23 |
+
for sub_menu in sub_menus:
|
24 |
+
st.button(sub_menu) # νμ λ©λ΄ μ΄λ¦μΌλ‘ λ²νΌ μμ±
|
25 |
+
else:
|
26 |
+
st.write("No sub menus") # νμ λ©λ΄κ° μλ κ²½μ° λ©μμ§ νμ
|
27 |
+
|
28 |
+
# λ³Έλ¬Έμμ μ¬μ©μκ° μ νν λ©λ΄μ λ°λ₯Έ 컨ν
μΈ λ₯Ό 보μ¬μ£Όλ λ‘μ§μ μλ΅
|
29 |
+
|
30 |
|
|
|
|
|
|
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
# 'Home' νμ΄μ§ νμ
|
34 |
if selected_menu == "Home":
|
35 |
st.header("Welcome to ViDraft")
|
36 |
st.write("Choose an option from the sidebar to get started.")
|
|
|
|
|
37 |
elif selected_menu == "Free Stock":
|
38 |
+
# 'Free Stock' λ©λ΄ μ ν μ μ²λ¦¬ λ‘μ§
|
39 |
if st.session_state['current_sub_menu'] == "Template Video":
|
40 |
st.header("Template Videos")
|
41 |
st.write("Explore a variety of video templates.")
|
|
|
42 |
# λΉλμ€ νμΌ κ²½λ‘ μ€μ λ° λΉλμ€ νμ λ‘μ§
|
43 |
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"]
|
|
|
44 |
# κ°€λ¬λ¦¬ ννλ‘ λΉλμ€ νμ
|
45 |
cols = st.columns(2) # 2κ°μ μ΄λ‘ λκ² λ°°μΉ
|
46 |
for index, video_file in enumerate(video_files):
|
47 |
with cols[index % 2]:
|
48 |
st.video(video_file)
|
|
|
49 |
elif st.session_state['current_sub_menu'] == "Template Image":
|
50 |
st.header("Template Images")
|
51 |
st.write("Find the perfect image template for your project.")
|
|
|
55 |
elif st.session_state['current_sub_menu'] == "Search Image":
|
56 |
st.header("Search Images")
|
57 |
st.write("Discover images that fit your project's needs with our powerful search tool.")
|
58 |
+
# μ΄ν μ½λλ μμ λμΌν ν¨ν΄μΌλ‘ 'Image', 'Video', 'Sound', 'Scripts' λ©λ΄λ₯Ό μ²λ¦¬ν©λλ€.
|
59 |
|
60 |
+
elif st.session_state['current_sub_menu'] == "Search Image":
|
61 |
+
st.header("Search Images")
|
62 |
+
st.write("Discover images that fit your project's needs with our powerful search tool.")
|
63 |
|
64 |
+
# 'Image' λ©λ΄ μ ν μ μ²λ¦¬ λ‘μ§
|
65 |
elif selected_menu == "Image":
|
66 |
if st.session_state['current_sub_menu'] == "Generation":
|
67 |
st.header("Image Generation")
|
|
|
79 |
st.header("Image Studio")
|
80 |
st.write("Access a suite of image editing tools.")
|
81 |
|
82 |
+
# 'Video' λ©λ΄ μ ν μ μ²λ¦¬ λ‘μ§
|
83 |
elif selected_menu == "Video":
|
84 |
if st.session_state['current_sub_menu'] == "Generation":
|
85 |
st.header("Video Generation")
|
|
|
94 |
st.header("Video Studio")
|
95 |
st.write("Explore our video editing studio for advanced editing.")
|
96 |
|
97 |
+
# 'Sound' λ©λ΄ μ ν μ μ²λ¦¬ λ‘μ§
|
98 |
elif selected_menu == "Sound":
|
99 |
if st.session_state['current_sub_menu'] == "Video SFX":
|
100 |
st.header("Video Sound Effects")
|
|
|
105 |
elif st.session_state['current_sub_menu'] == "TTS(Voice)":
|
106 |
st.header("Text-to-Speech")
|
107 |
st.write("Convert your text into natural-sounding voice.")
|
|
|
|
|
|
|
108 |
elif st.session_state['current_sub_menu'] == "Image SFX":
|
109 |
st.header("Image Sound Effects")
|
110 |
st.write("Add sound effects to your images.")
|
|
|
112 |
st.header("Image Music")
|
113 |
st.write("Associate music tracks with your images.")
|
114 |
|
115 |
+
# 'Scripts' λ©λ΄ μ ν μ μ²λ¦¬ λ‘μ§
|
|
|
116 |
elif selected_menu == "Scripts":
|
117 |
st.header("Scripts")
|
118 |
st.write("Script writing tools and resources.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|