Spaces:
Running
Running
seawolf2357
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,59 +1,44 @@
|
|
1 |
import streamlit as st
|
|
|
2 |
|
3 |
-
# μ¬μ΄λλ° νμ΄ν
|
4 |
-
st.sidebar.title("
|
5 |
|
6 |
# λ©λ΄ νλͺ©κ³Ό νμ νλͺ© μ μ
|
7 |
menus = {
|
8 |
-
"
|
9 |
-
"
|
10 |
-
"
|
11 |
-
"
|
12 |
-
"
|
13 |
}
|
14 |
|
|
|
15 |
selected_menu = None
|
|
|
16 |
|
17 |
-
#
|
18 |
-
|
19 |
-
|
20 |
-
for sub_menu in menus[menu]:
|
21 |
-
if st.button(sub_menu, key=sub_menu): # κ³ μ ν keyλ₯Ό μ 곡νμ¬ κ° λ²νΌμ ꡬλ³
|
22 |
-
selected_menu = sub_menu
|
23 |
-
break
|
24 |
|
25 |
-
#
|
26 |
-
if
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
st.
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
button_clicked = st.button('Hit me')
|
47 |
-
checkbox_checked = st.checkbox('Check me out')
|
48 |
-
radio_option = st.radio('Pick one:', ['nose', 'ear'])
|
49 |
-
selectbox_option = st.selectbox('Select', [1, 2, 3])
|
50 |
-
multiselect_options = st.multiselect('Multiselect', [1, 2, 3])
|
51 |
-
slider_value = st.slider('Slide me', min_value=0, max_value=10)
|
52 |
-
select_slider_option = st.select_slider('Slide to select', options=[1, '2'])
|
53 |
-
text_input = st.text_input('Enter some text')
|
54 |
-
number_input = st.number_input('Enter a number')
|
55 |
-
text_area = st.text_area('Area for textual entry')
|
56 |
-
date_input = st.date_input('Date input')
|
57 |
-
time_input = st.time_input('Time entry')
|
58 |
-
file_uploader = st.file_uploader('File uploader')
|
59 |
-
color_picker = st.color_picker('Pick a color')
|
|
|
1 |
import streamlit as st
|
2 |
+
import os
|
3 |
|
4 |
+
# μ¬μ΄λλ° νμ΄ν μ€μ
|
5 |
+
st.sidebar.title("ViDraft")
|
6 |
|
7 |
# λ©λ΄ νλͺ©κ³Ό νμ νλͺ© μ μ
|
8 |
menus = {
|
9 |
+
"Free Stock": ["Template Video", "Template Image", "Search Video", "Search Image"],
|
10 |
+
"Image": ["Generation", "Face ID", "Inpainting", "Remove Background", "Studio"],
|
11 |
+
"Video": ["Generation", "Talking Face", "Remove Background", "Studio"],
|
12 |
+
"Sound": ["Video SFX", "Video Music", "TTS(Voice)", "Voice Clone", "Image SFX", "Image Music"],
|
13 |
+
"Scripts": ["Script"]
|
14 |
}
|
15 |
|
16 |
+
# μ νλ λ©λ΄ νλͺ©μ μ μ₯ν λ³μ
|
17 |
selected_menu = None
|
18 |
+
selected_sub_menu = None
|
19 |
|
20 |
+
# λ©λ΄ μμ±
|
21 |
+
selected_menu = st.sidebar.selectbox("Menu", list(menus.keys()))
|
22 |
+
selected_sub_menu = st.sidebar.selectbox("Sub Menu", menus[selected_menu])
|
|
|
|
|
|
|
|
|
23 |
|
24 |
+
# λ©λ΄ μ νμ λ°λ₯Έ λμ ꡬν
|
25 |
+
if selected_menu == "Free Stock" and selected_sub_menu == "Template Video":
|
26 |
+
# λΉλμ€ νμΌμ΄ μλ λλ ν 리 κ²½λ‘ μ€μ
|
27 |
+
video_directory = "/path/to/your/videos" # κ²½λ‘λ₯Ό μ€μ λΉλμ€ νμΌμ΄ μλ κ²½λ‘λ‘ λ³κ²½νμΈμ.
|
28 |
+
|
29 |
+
# λλ ν 리 λ΄μ λͺ¨λ νμΌ λͺ©λ‘μ κ°μ Έμ΄
|
30 |
+
files = os.listdir(video_directory)
|
31 |
+
|
32 |
+
# MP4 νμΌλ§ νν°λ§
|
33 |
+
video_files = [file for file in files if file.endswith(".mp4")]
|
34 |
+
|
35 |
+
# κ° λΉλμ€ νμΌμ λν΄ μ€νΈλ¦Όλ¦Ώ λΉλμ€ μμ ― μμ±
|
36 |
+
for video_file in video_files:
|
37 |
+
# νμΌμ μ 체 κ²½λ‘ μμ±
|
38 |
+
video_path = os.path.join(video_directory, video_file)
|
39 |
+
|
40 |
+
# λΉλμ€ μ λͺ©μ μΆλ ₯
|
41 |
+
st.subheader(video_file)
|
42 |
+
|
43 |
+
# λΉλμ€ νμΌμ μ€νΈλ¦Όλ¦Ώμ ν΅ν΄ νμ
|
44 |
+
st.video(video_path)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|