seawolf2357 commited on
Commit
f7a452e
ยท
verified ยท
1 Parent(s): 60d4a5b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -19
app.py CHANGED
@@ -1,5 +1,4 @@
1
  import streamlit as st
2
- import os
3
 
4
  # ์‚ฌ์ด๋“œ๋ฐ” ํƒ€์ดํ‹€ ์„ค์ •
5
  st.sidebar.title("ViDraft")
@@ -21,24 +20,13 @@ selected_sub_menu = None
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)
 
1
  import streamlit as st
 
2
 
3
  # ์‚ฌ์ด๋“œ๋ฐ” ํƒ€์ดํ‹€ ์„ค์ •
4
  st.sidebar.title("ViDraft")
 
20
  selected_menu = st.sidebar.selectbox("Menu", list(menus.keys()))
21
  selected_sub_menu = st.sidebar.selectbox("Sub Menu", menus[selected_menu])
22
 
23
+ # 'Template Video'๊ฐ€ ์„ ํƒ๋˜์—ˆ์„ ๋•Œ 'example.mp4' ๋น„๋””์˜ค๋ฅผ ํ‘œ์‹œ
24
  if selected_menu == "Free Stock" and selected_sub_menu == "Template Video":
25
+ # ๋น„๋””์˜ค ํŒŒ์ผ์˜ ๊ฒฝ๋กœ ์„ค์ •
26
+ video_path = "example.mp4" # ์ŠคํŽ˜์ด์Šค์˜ ๋ฃจํŠธ ๋””๋ ‰ํ† ๋ฆฌ์— ์œ„์น˜ํ•œ ๊ฒฝ์šฐ
27
 
28
+ # ๋น„๋””์˜ค ์ œ๋ชฉ์„ ์ถœ๋ ฅ
29
+ st.subheader("Example Video")
30
 
31
+ # ๋น„๋””์˜ค ํŒŒ์ผ์„ ์ŠคํŠธ๋ฆผ๋ฆฟ์„ ํ†ตํ•ด ํ‘œ์‹œ
32
+ st.video(video_path)