Update app.py
Browse files
app.py
CHANGED
@@ -127,7 +127,7 @@ def update_thumbnails(video, start_time_str, end_time_str):
|
|
127 |
return start_thumb, end_thumb
|
128 |
|
129 |
# -------------------------------
|
130 |
-
# Custom CSS
|
131 |
# -------------------------------
|
132 |
custom_css = """
|
133 |
/* ์ ์ฒด ์ปจํ
์ด๋ ํญ์ 70%๋ก ์ค์ */
|
@@ -136,93 +136,102 @@ custom_css = """
|
|
136 |
margin: 0 auto;
|
137 |
}
|
138 |
|
139 |
-
/*
|
|
|
|
|
|
|
|
|
|
|
140 |
.custom-title {
|
141 |
-
font-size:
|
142 |
font-weight: bold;
|
143 |
margin: 20px 0;
|
144 |
color: #2c3e50;
|
145 |
text-align: left;
|
146 |
}
|
147 |
.custom-user-guide {
|
148 |
-
font-size: 1.
|
149 |
margin-bottom: 20px;
|
150 |
color: #34495e;
|
151 |
text-align: left;
|
152 |
}
|
153 |
|
154 |
-
/* ์ฌ์ฉ๊ฐ์ด๋ ๋ฐ์ค ์คํ์ผ */
|
155 |
.guide-box {
|
156 |
border: 2px solid #3498db;
|
157 |
border-radius: 10px;
|
158 |
padding: 15px;
|
159 |
-
background-color: #d6eaf8;
|
160 |
margin: 20px 0;
|
161 |
text-align: left;
|
162 |
}
|
163 |
|
164 |
-
/* ํ๋ ์ ์คํ์ผ
|
165 |
.frame {
|
166 |
border: 2px solid #888;
|
167 |
border-radius: 20px;
|
168 |
padding: 20px;
|
169 |
-
background-color: #fff;
|
170 |
margin: 10px;
|
171 |
-
|
172 |
}
|
173 |
|
174 |
/* ๊ฐ ํ๋ ์ ์ ๋ชฉ ํฌ๊ฒ */
|
175 |
-
.frame h3 {
|
176 |
-
font-size:
|
177 |
margin-bottom: 15px;
|
178 |
text-align: left;
|
179 |
}
|
180 |
|
181 |
-
/* ํ ๋ ์ด์์ */
|
182 |
.row-container {
|
183 |
display: flex;
|
184 |
justify-content: space-between;
|
185 |
}
|
186 |
-
|
187 |
-
/* ์ปฌ๋ผ ๋ ์ด์์ */
|
188 |
.column {
|
189 |
flex: 1;
|
190 |
margin: 10px;
|
191 |
}
|
192 |
|
193 |
-
/* ๋ฒํผ
|
194 |
.gif-button {
|
195 |
margin-top: 30px;
|
196 |
-
padding:
|
197 |
-
font-size: 1.
|
|
|
|
|
|
|
|
|
|
|
198 |
}
|
199 |
|
200 |
-
/* ์ฌ๋ผ์ด๋ ์คํ์ผ (๊ธ์์ ๋ฐ
|
201 |
input[type=range] {
|
202 |
-
height:
|
203 |
}
|
204 |
input[type=range]::-webkit-slider-thumb {
|
205 |
-
height:
|
206 |
-
width:
|
207 |
}
|
208 |
.slider-label {
|
209 |
-
font-size: 1.
|
210 |
margin-bottom: 5px;
|
211 |
}
|
|
|
|
|
|
|
212 |
"""
|
213 |
|
214 |
# -------------------------------
|
215 |
# Gradio UI ๊ตฌ์ฑ (HTML/CSS ์ปค์คํฐ๋ง์ด์ง)
|
216 |
# -------------------------------
|
217 |
with gr.Blocks(css=custom_css, title="์์ -> GIF ๋ณํ ์๋น์ค") as demo:
|
218 |
-
# ์ ๋ชฉ๊ณผ ์ฌ์ฉ๊ฐ์ด๋(์ผ์ชฝ
|
219 |
gr.HTML("<div class='custom-title'>๐ฌ ์์์ GIF๋ณํํ๊ธฐ</div>")
|
220 |
gr.HTML("<div class='guide-box'><strong>์ฌ์ฉ๊ฐ์ด๋:</strong><br>"
|
221 |
"1. ์ข์ธก ์
๋ ฅ๋ถ์์ ์์์ ์
๋ก๋ํ๊ณ ์ต์
์ ์ ํํ์ธ์.<br>"
|
222 |
"2. ํ๋จ ์์
์ธ๋ค์ผ๋ฏธ๋ฆฌ๋ณด๊ธฐ์์ ์์/์ข
๋ฃ ์๊ฐ์ ์
๋ ฅํด ์ธ๋ค์ผ์ ํ์ธํ์ธ์.<br>"
|
223 |
"3. โจ GIF ์์ฑํ๊ธฐ ๋ฒํผ์ ๋๋ฌ GIF๋ฅผ ์์ฑํ๊ณ , ์ฐ์ธก ์ถ๋ ฅ๋ถ์์ ๊ฒฐ๊ณผ๋ฅผ ํ์ธ ๋ฐ ๋ค์ด๋ก๋ํ์ธ์. ๐</div>")
|
224 |
|
225 |
-
#
|
226 |
with gr.Row(elem_classes="row-container"):
|
227 |
with gr.Column(elem_classes="column"):
|
228 |
with gr.Group(elem_classes="frame"):
|
@@ -247,8 +256,8 @@ with gr.Blocks(css=custom_css, title="์์ -> GIF ๋ณํ ์๋น์ค") as demo:
|
|
247 |
gif_preview_output = gr.Image(label="GIF ๊ฒฐ๊ณผ ๋ฏธ๋ฆฌ๋ณด๊ธฐ")
|
248 |
download_output = gr.File(label="GIF ๋ค์ด๋ก๋")
|
249 |
|
250 |
-
#
|
251 |
-
with gr.Group(elem_classes="frame
|
252 |
gr.Markdown("### ๐ผ๏ธ ์์
์ธ๋ค์ผ๋ฏธ๋ฆฌ๋ณด๊ธฐ")
|
253 |
with gr.Row():
|
254 |
start_time_tb = gr.Textbox(label="์์ ์๊ฐ (์: 00:00:05)", value="00:00:00")
|
|
|
127 |
return start_thumb, end_thumb
|
128 |
|
129 |
# -------------------------------
|
130 |
+
# Custom CSS (HTML/CSS ๊ธฐ๋ฐ ์ UI)
|
131 |
# -------------------------------
|
132 |
custom_css = """
|
133 |
/* ์ ์ฒด ์ปจํ
์ด๋ ํญ์ 70%๋ก ์ค์ */
|
|
|
136 |
margin: 0 auto;
|
137 |
}
|
138 |
|
139 |
+
/* ๊ธฐ๋ณธ ํฐํธ ํฌ๊ธฐ ์ฆ๊ฐ */
|
140 |
+
body {
|
141 |
+
font-size: 1.3em;
|
142 |
+
}
|
143 |
+
|
144 |
+
/* ์ ๋ชฉ ๋ฐ ์ฌ์ฉ๊ฐ์ด๋ ์ผ์ชฝ ์ ๋ ฌ, ๊ธ์ ํฌ๊ฒ */
|
145 |
.custom-title {
|
146 |
+
font-size: 3em;
|
147 |
font-weight: bold;
|
148 |
margin: 20px 0;
|
149 |
color: #2c3e50;
|
150 |
text-align: left;
|
151 |
}
|
152 |
.custom-user-guide {
|
153 |
+
font-size: 1.5em;
|
154 |
margin-bottom: 20px;
|
155 |
color: #34495e;
|
156 |
text-align: left;
|
157 |
}
|
158 |
|
159 |
+
/* ์ฌ์ฉ๊ฐ์ด๋ ๋ฐ์ค ์คํ์ผ (๋ฐฐ๊ฒฝ ์ฑ์ฐ๊ธฐ ์ ๊ฑฐํ๊ณ ํ
๋๋ฆฌ๋ง) */
|
160 |
.guide-box {
|
161 |
border: 2px solid #3498db;
|
162 |
border-radius: 10px;
|
163 |
padding: 15px;
|
|
|
164 |
margin: 20px 0;
|
165 |
text-align: left;
|
166 |
}
|
167 |
|
168 |
+
/* ํ๋ ์ ์คํ์ผ - ๋ฐฐ๊ฒฝ ์ ๊ฑฐ, ํ
๋๋ฆฌ๋ง */
|
169 |
.frame {
|
170 |
border: 2px solid #888;
|
171 |
border-radius: 20px;
|
172 |
padding: 20px;
|
|
|
173 |
margin: 10px;
|
174 |
+
background-color: transparent;
|
175 |
}
|
176 |
|
177 |
/* ๊ฐ ํ๋ ์ ์ ๋ชฉ ํฌ๊ฒ */
|
178 |
+
.frame h3, .frame > h3 {
|
179 |
+
font-size: 2em;
|
180 |
margin-bottom: 15px;
|
181 |
text-align: left;
|
182 |
}
|
183 |
|
184 |
+
/* ํ ๋ฐ ์ด ๋ ์ด์์ */
|
185 |
.row-container {
|
186 |
display: flex;
|
187 |
justify-content: space-between;
|
188 |
}
|
|
|
|
|
189 |
.column {
|
190 |
flex: 1;
|
191 |
margin: 10px;
|
192 |
}
|
193 |
|
194 |
+
/* GIF ์์ฑํ๊ธฐ ๋ฒํผ ์คํ์ผ (ํฌ์ธํธ์ ์ ์ฉ) */
|
195 |
.gif-button {
|
196 |
margin-top: 30px;
|
197 |
+
padding: 15px 25px;
|
198 |
+
font-size: 1.5em;
|
199 |
+
background-color: #e67e22;
|
200 |
+
color: #fff;
|
201 |
+
border: none;
|
202 |
+
border-radius: 10px;
|
203 |
+
cursor: pointer;
|
204 |
}
|
205 |
|
206 |
+
/* ์ฌ๋ผ์ด๋ ๋ฐ ์ ํ ์์ญ ์คํ์ผ (๊ธ์์ ๋ฐ ํฌ๊ฒ, ๋๊ป๊ฒ) */
|
207 |
input[type=range] {
|
208 |
+
height: 25px;
|
209 |
}
|
210 |
input[type=range]::-webkit-slider-thumb {
|
211 |
+
height: 25px;
|
212 |
+
width: 25px;
|
213 |
}
|
214 |
.slider-label {
|
215 |
+
font-size: 1.5em;
|
216 |
margin-bottom: 5px;
|
217 |
}
|
218 |
+
.gradio-radio label {
|
219 |
+
font-size: 1.5em !important;
|
220 |
+
}
|
221 |
"""
|
222 |
|
223 |
# -------------------------------
|
224 |
# Gradio UI ๊ตฌ์ฑ (HTML/CSS ์ปค์คํฐ๋ง์ด์ง)
|
225 |
# -------------------------------
|
226 |
with gr.Blocks(css=custom_css, title="์์ -> GIF ๋ณํ ์๋น์ค") as demo:
|
227 |
+
# ์ ๋ชฉ๊ณผ ์ฌ์ฉ๊ฐ์ด๋ (์ผ์ชฝ ์ ๋ ฌ)
|
228 |
gr.HTML("<div class='custom-title'>๐ฌ ์์์ GIF๋ณํํ๊ธฐ</div>")
|
229 |
gr.HTML("<div class='guide-box'><strong>์ฌ์ฉ๊ฐ์ด๋:</strong><br>"
|
230 |
"1. ์ข์ธก ์
๋ ฅ๋ถ์์ ์์์ ์
๋ก๋ํ๊ณ ์ต์
์ ์ ํํ์ธ์.<br>"
|
231 |
"2. ํ๋จ ์์
์ธ๋ค์ผ๋ฏธ๋ฆฌ๋ณด๊ธฐ์์ ์์/์ข
๋ฃ ์๊ฐ์ ์
๋ ฅํด ์ธ๋ค์ผ์ ํ์ธํ์ธ์.<br>"
|
232 |
"3. โจ GIF ์์ฑํ๊ธฐ ๋ฒํผ์ ๋๋ฌ GIF๋ฅผ ์์ฑํ๊ณ , ์ฐ์ธก ์ถ๋ ฅ๋ถ์์ ๊ฒฐ๊ณผ๋ฅผ ํ์ธ ๋ฐ ๋ค์ด๋ก๋ํ์ธ์. ๐</div>")
|
233 |
|
234 |
+
# ์ฒซ ๋ฒ์งธ ํ: ์
๋ ฅ๋ถ (์ข์ธก) / ์ถ๋ ฅ๋ถ (์ฐ์ธก)
|
235 |
with gr.Row(elem_classes="row-container"):
|
236 |
with gr.Column(elem_classes="column"):
|
237 |
with gr.Group(elem_classes="frame"):
|
|
|
256 |
gif_preview_output = gr.Image(label="GIF ๊ฒฐ๊ณผ ๋ฏธ๋ฆฌ๋ณด๊ธฐ")
|
257 |
download_output = gr.File(label="GIF ๋ค์ด๋ก๋")
|
258 |
|
259 |
+
# ๋ ๋ฒ์งธ ํ: ์์
์ธ๋ค์ผ๋ฏธ๋ฆฌ๋ณด๊ธฐ (์ ์ฒด ๋๋น)
|
260 |
+
with gr.Group(elem_classes="frame"):
|
261 |
gr.Markdown("### ๐ผ๏ธ ์์
์ธ๋ค์ผ๋ฏธ๋ฆฌ๋ณด๊ธฐ")
|
262 |
with gr.Row():
|
263 |
start_time_tb = gr.Textbox(label="์์ ์๊ฐ (์: 00:00:05)", value="00:00:00")
|