seawolf2357 commited on
Commit
edfc9c4
β€’
1 Parent(s): c187d44

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +110 -29
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 selected_menu in sub_menus and sub_menus[selected_menu]:
24
- selected_sub_menu = st.sidebar.selectbox("Select option", [""] + sub_menus[selected_menu])
 
 
 
 
 
 
 
 
 
 
 
25
  else:
26
- selected_sub_menu = None
27
 
28
- # μ„ νƒλœ 메뉴와 ν•˜λΆ€ 메뉴에 λ”°λ₯Έ λ‚΄μš© ν‘œμ‹œ
29
  if selected_menu == "Home":
30
- st.title("Welcome to ViDraft")
31
- st.write("This is the Home page. Select an option from the sidebar to get started.")
32
- elif selected_sub_menu:
33
- st.subheader(f"{selected_menu} > {selected_sub_menu}")
34
- # 여기에 μ„ νƒλœ ν•˜μœ„ 메뉴에 λ”°λ₯Έ μ½˜ν…μΈ  ν‘œμ‹œ 둜직 μΆ”κ°€
35
- else:
36
- st.subheader(selected_menu)
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