Spaces:
Running
Running
seawolf2357
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -6,45 +6,46 @@ st.set_page_config(layout="wide")
|
|
6 |
# μ¬μ΄λλ° νμ΄ν μ€μ
|
7 |
st.sidebar.title("ViDraft")
|
8 |
|
9 |
-
# 'Home'
|
10 |
if st.sidebar.button('Home'):
|
11 |
-
|
|
|
12 |
selected_sub_menu = None
|
13 |
else:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
selected_menu = None
|
15 |
selected_sub_menu = None
|
16 |
|
17 |
-
#
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
# κ° λ©λ΄λ³ νλΆ λ©λ΄λ₯Ό νΌμΉ¨
|
27 |
-
for menu_name, sub_menus in menus.items():
|
28 |
-
with st.sidebar.expander(menu_name):
|
29 |
-
# νλΆ λ©λ΄λ₯Ό μ νν μ μλ selectbox μμ±
|
30 |
-
selected = st.selectbox(f"Select {menu_name} option", [""] + sub_menus, key=menu_name)
|
31 |
-
if selected:
|
32 |
-
selected_menu = menu_name
|
33 |
-
selected_sub_menu = selected
|
34 |
|
35 |
# μ νλ λ©λ΄μ νλΆ λ©λ΄μ λ°λ₯Έ λ΄μ© νμ
|
36 |
-
if selected_menu
|
|
|
|
|
|
|
37 |
st.subheader(f"{selected_menu} > {selected_sub_menu}")
|
38 |
# μ¬κΈ°μ μ νλ λ©λ΄μ λ°λ₯Έ μ½ν
μΈ νμ λ‘μ§ μΆκ°
|
39 |
|
40 |
-
# '
|
41 |
-
if selected_menu ==
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
# 'Template Video'κ° μ νλμμ λ λΉλμ€ κ°€λ¬λ¦¬λ₯Ό νμ
|
46 |
-
if selected_menu == "Free Stock" and selected_sub_menu == "Template Video":
|
47 |
-
st.subheader("Template Videos")
|
48 |
|
49 |
# λΉλμ€ νμΌ κ²½λ‘ μ€μ
|
50 |
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"]
|
@@ -54,3 +55,4 @@ if selected_menu == "Free Stock" and selected_sub_menu == "Template Video":
|
|
54 |
for index, video_file in enumerate(video_files):
|
55 |
with cols[index % 2]:
|
56 |
st.video(video_file)
|
|
|
|
6 |
# μ¬μ΄λλ° νμ΄ν μ€μ
|
7 |
st.sidebar.title("ViDraft")
|
8 |
|
9 |
+
# 'Home' λ²νΌ μΆκ°
|
10 |
if st.sidebar.button('Home'):
|
11 |
+
# 'Home' λ²νΌμ λλ₯΄λ©΄ μ΄κΈ° νλ©΄μΌλ‘ μ€μ
|
12 |
+
selected_menu = "Home"
|
13 |
selected_sub_menu = None
|
14 |
else:
|
15 |
+
# λ©λ΄ νλͺ©κ³Ό νμ νλͺ© μ μ
|
16 |
+
menus = {
|
17 |
+
"Free Stock": ["Template Video", "Template Image", "Search Video", "Search Image"],
|
18 |
+
"Image": ["Generation", "Face ID", "Inpainting", "Remove Background", "Studio"],
|
19 |
+
"Video": ["Generation", "Talking Face", "Remove Background", "Studio"],
|
20 |
+
"Sound": ["Video SFX", "Video Music", "TTS(Voice)", "Voice Clone", "Image SFX", "Image Music"],
|
21 |
+
"Scripts": ["Script"]
|
22 |
+
}
|
23 |
+
|
24 |
+
# μ νλ λ©λ΄ λ° νλΆ λ©λ΄ μ΄κΈ°ν
|
25 |
selected_menu = None
|
26 |
selected_sub_menu = None
|
27 |
|
28 |
+
# κ° λ©λ΄λ³ νλΆ λ©λ΄λ₯Ό νΌμΉ¨
|
29 |
+
for menu_name, sub_menus in menus.items():
|
30 |
+
with st.sidebar.expander(menu_name):
|
31 |
+
# νλΆ λ©λ΄λ₯Ό μ νν μ μλ selectbox μμ±
|
32 |
+
selected = st.selectbox(f"Select {menu_name} option", [""] + sub_menus, key=menu_name)
|
33 |
+
if selected:
|
34 |
+
selected_menu = menu_name
|
35 |
+
selected_sub_menu = selected
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
# μ νλ λ©λ΄μ νλΆ λ©λ΄μ λ°λ₯Έ λ΄μ© νμ
|
38 |
+
if selected_menu == "Home" or selected_menu is None:
|
39 |
+
st.title("Welcome to ViDraft")
|
40 |
+
st.write("This is the Home page. Select an option from the sidebar to get started.")
|
41 |
+
elif selected_menu and selected_sub_menu:
|
42 |
st.subheader(f"{selected_menu} > {selected_sub_menu}")
|
43 |
# μ¬κΈ°μ μ νλ λ©λ΄μ λ°λ₯Έ μ½ν
μΈ νμ λ‘μ§ μΆκ°
|
44 |
|
45 |
+
# μμ: 'Template Video'κ° μ νλμμ λ λΉλμ€ κ°€λ¬λ¦¬λ₯Ό νμ
|
46 |
+
if selected_menu == "Free Stock" and selected_sub_menu == "Template Video":
|
47 |
+
st.subheader("Template Videos")
|
48 |
+
# λΉλμ€ νμΌ κ²½λ‘ μ€μ λ° λΉλμ€ νμ λ‘μ§ μΆκ°
|
|
|
|
|
|
|
|
|
49 |
|
50 |
# λΉλμ€ νμΌ κ²½λ‘ μ€μ
|
51 |
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"]
|
|
|
55 |
for index, video_file in enumerate(video_files):
|
56 |
with cols[index % 2]:
|
57 |
st.video(video_file)
|
58 |
+
|