Spaces:
Sleeping
Sleeping
seawolf2357
commited on
Commit
β’
edfc9c4
1
Parent(s):
c187d44
Update app.py
Browse files
app.py
CHANGED
@@ -3,47 +3,128 @@ 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 |
-
menu_items = ["Home", "Free Stock", "Image", "Video", "Sound", "Scripts"]
|
11 |
-
selected_menu = st.sidebar.radio("Menu", menu_items)
|
12 |
-
|
13 |
-
# λ©λ΄μ λ°λ₯Έ νμ λ©λ΄ νλͺ© μ μ
|
14 |
sub_menus = {
|
15 |
"Free Stock": ["Template Video", "Template Image", "Search Video", "Search Image"],
|
16 |
"Image": ["Generation", "Face ID", "Inpainting", "Remove Background", "Studio"],
|
17 |
"Video": ["Generation", "Talking Face", "Remove Background", "Studio"],
|
18 |
"Sound": ["Video SFX", "Video Music", "TTS(Voice)", "Voice Clone", "Image SFX", "Image Music"],
|
19 |
-
"Scripts": [] # μμ: 'Scripts'μλ νμ λ©λ΄κ° μλ€κ³ κ°μ
|
20 |
}
|
21 |
|
22 |
-
#
|
23 |
-
if
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
else:
|
26 |
-
|
27 |
|
28 |
-
#
|
29 |
if selected_menu == "Home":
|
30 |
-
st.
|
31 |
-
st.write("
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
|
39 |
|
40 |
-
|
41 |
-
# λΉλμ€ νμΌ κ²½λ‘ μ€μ
|
42 |
-
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"]
|
43 |
|
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 |
|
|
|
3 |
# νμ΄μ§ μ€μ
|
4 |
st.set_page_config(page_title="ViDraft", layout="wide")
|
5 |
|
6 |
+
# μ¬μ΄λλ° νμ΄ν μ€μ λ° λ©λ΄ μ μ
|
7 |
st.sidebar.title("ViDraft")
|
8 |
+
menu = ["Home", "Free Stock", "Image", "Video", "Sound", "Scripts"]
|
|
|
|
|
|
|
|
|
|
|
9 |
sub_menus = {
|
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)", "Voice Clone", "Image SFX", "Image Music"],
|
|
|
14 |
}
|
15 |
|
16 |
+
# μΈμ
μν μ΄κΈ°ν
|
17 |
+
if 'current_menu' not in st.session_state:
|
18 |
+
st.session_state['current_menu'] = 'Home'
|
19 |
+
if 'current_sub_menu' not in st.session_state:
|
20 |
+
st.session_state['current_sub_menu'] = ''
|
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.")
|
56 |
+
elif st.session_state['current_sub_menu'] == "Search Video":
|
57 |
+
st.header("Search Videos")
|
58 |
+
st.write("Search through our extensive video library to find exactly what you need.")
|
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")
|
68 |
+
st.write("Generate images using AI.")
|
69 |
+
elif st.session_state['current_sub_menu'] == "Face ID":
|
70 |
+
st.header("Face ID")
|
71 |
+
st.write("Identify and analyze faces in images.")
|
72 |
+
elif st.session_state['current_sub_menu'] == "Inpainting":
|
73 |
+
st.header("Inpainting")
|
74 |
+
st.write("Fill in missing parts of images.")
|
75 |
+
elif st.session_state['current_sub_menu'] == "Remove Background":
|
76 |
+
st.header("Remove Background")
|
77 |
+
st.write("Easily remove backgrounds from images.")
|
78 |
+
elif st.session_state['current_sub_menu'] == "Studio":
|
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")
|
86 |
+
st.write("Create videos with our generation tools.")
|
87 |
+
elif st.session_state['current_sub_menu'] == "Talking Face":
|
88 |
+
st.header("Talking Face Videos")
|
89 |
+
st.write("Generate talking face videos from images.")
|
90 |
+
elif st.session_state['current_sub_menu'] == "Remove Background":
|
91 |
+
st.header("Video Background Removal")
|
92 |
+
st.write("Remove backgrounds from your videos effortlessly.")
|
93 |
+
elif st.session_state['current_sub_menu'] == "Studio":
|
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")
|
101 |
+
st.write("Enhance your videos with sound effects.")
|
102 |
+
elif st.session_state['current_sub_menu'] == "Video Music":
|
103 |
+
st.header("Video Music")
|
104 |
+
st.write("Find the perfect music for your video content.")
|
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.")
|
114 |
+
elif st.session_state['current_sub_menu'] == "Image Music":
|
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 |
|