Update app.py
Browse files
app.py
CHANGED
@@ -127,23 +127,22 @@ 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 |
-
|
|
|
|
|
|
|
|
|
134 |
.gradio-container {
|
135 |
width: 70% !important;
|
136 |
margin: 0 auto;
|
137 |
}
|
138 |
|
139 |
-
/*
|
140 |
-
body {
|
141 |
-
font-size: 1.3em;
|
142 |
-
}
|
143 |
-
|
144 |
-
/* ์ ๋ชฉ ๋ฐ ์ฌ์ฉ๊ฐ์ด๋ ์ผ์ชฝ ์ ๋ ฌ, ๊ธ์ ํฌ๊ฒ */
|
145 |
.custom-title {
|
146 |
-
font-size:
|
147 |
font-weight: bold;
|
148 |
margin: 20px 0;
|
149 |
color: #2c3e50;
|
@@ -152,36 +151,38 @@ body {
|
|
152 |
.custom-user-guide {
|
153 |
font-size: 1.5em;
|
154 |
margin-bottom: 20px;
|
155 |
-
color: #
|
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 #
|
171 |
border-radius: 20px;
|
172 |
padding: 20px;
|
|
|
173 |
margin: 10px;
|
174 |
-
|
175 |
}
|
176 |
|
177 |
/* ๊ฐ ํ๋ ์ ์ ๋ชฉ ํฌ๊ฒ */
|
178 |
-
.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;
|
@@ -191,10 +192,10 @@ body {
|
|
191 |
margin: 10px;
|
192 |
}
|
193 |
|
194 |
-
/*
|
195 |
.gif-button {
|
196 |
margin-top: 30px;
|
197 |
-
padding: 15px
|
198 |
font-size: 1.5em;
|
199 |
background-color: #e67e22;
|
200 |
color: #fff;
|
@@ -203,7 +204,7 @@ body {
|
|
203 |
cursor: pointer;
|
204 |
}
|
205 |
|
206 |
-
/* ์ฌ๋ผ์ด๋
|
207 |
input[type=range] {
|
208 |
height: 25px;
|
209 |
}
|
@@ -212,11 +213,13 @@ input[type=range]::-webkit-slider-thumb {
|
|
212 |
width: 25px;
|
213 |
}
|
214 |
.slider-label {
|
215 |
-
font-size: 1.
|
216 |
margin-bottom: 5px;
|
217 |
}
|
218 |
-
|
219 |
-
|
|
|
|
|
220 |
}
|
221 |
"""
|
222 |
|
@@ -224,14 +227,14 @@ input[type=range]::-webkit-slider-thumb {
|
|
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,7 +259,7 @@ with gr.Blocks(css=custom_css, title="์์ -> GIF ๋ณํ ์๋น์ค") as demo:
|
|
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():
|
|
|
127 |
return start_thumb, end_thumb
|
128 |
|
129 |
# -------------------------------
|
130 |
+
# Custom CSS (๊ธ์ ํฌ๊ธฐ ํฌ๊ฒ, ํ์ ์ ๊ฑฐ, ํฌ์ธํธ ๋ฒํผ ๋ฑ)
|
131 |
# -------------------------------
|
132 |
custom_css = """
|
133 |
+
body {
|
134 |
+
font-size: 1.2em;
|
135 |
+
background-color: #ffffff;
|
136 |
+
font-family: 'Arial', sans-serif;
|
137 |
+
}
|
138 |
.gradio-container {
|
139 |
width: 70% !important;
|
140 |
margin: 0 auto;
|
141 |
}
|
142 |
|
143 |
+
/* ์ ๋ชฉ ๋ฐ ์ฌ์ฉ๊ฐ์ด๋ (์ผ์ชฝ ์ ๋ ฌ, ํฌ๊ฒ) */
|
|
|
|
|
|
|
|
|
|
|
144 |
.custom-title {
|
145 |
+
font-size: 3.2em;
|
146 |
font-weight: bold;
|
147 |
margin: 20px 0;
|
148 |
color: #2c3e50;
|
|
|
151 |
.custom-user-guide {
|
152 |
font-size: 1.5em;
|
153 |
margin-bottom: 20px;
|
154 |
+
color: #2c3e50;
|
155 |
text-align: left;
|
156 |
}
|
157 |
|
158 |
+
/* ์ฌ์ฉ๊ฐ์ด๋ ๋ฐ์ค ์คํ์ผ (ํ์ ์ ๊ฑฐ, ํฐ์ ๋ฐฐ๊ฒฝ) */
|
159 |
.guide-box {
|
160 |
border: 2px solid #3498db;
|
161 |
border-radius: 10px;
|
162 |
padding: 15px;
|
163 |
+
background-color: #ffffff;
|
164 |
margin: 20px 0;
|
165 |
text-align: left;
|
166 |
}
|
167 |
|
168 |
+
/* ํ๋ ์ ์คํ์ผ */
|
169 |
.frame {
|
170 |
+
border: 2px solid #3498db;
|
171 |
border-radius: 20px;
|
172 |
padding: 20px;
|
173 |
+
background-color: #ffffff;
|
174 |
margin: 10px;
|
175 |
+
box-shadow: 3px 3px 10px rgba(0,0,0,0.1);
|
176 |
}
|
177 |
|
178 |
/* ๊ฐ ํ๋ ์ ์ ๋ชฉ ํฌ๊ฒ */
|
179 |
+
.frame h3 {
|
180 |
font-size: 2em;
|
181 |
margin-bottom: 15px;
|
182 |
text-align: left;
|
183 |
}
|
184 |
|
185 |
+
/* ํ ๋ฐ ์ปฌ๋ผ ๋ ์ด์์ */
|
186 |
.row-container {
|
187 |
display: flex;
|
188 |
justify-content: space-between;
|
|
|
192 |
margin: 10px;
|
193 |
}
|
194 |
|
195 |
+
/* ํฌ์ธํธ ๋ฒํผ ์คํ์ผ */
|
196 |
.gif-button {
|
197 |
margin-top: 30px;
|
198 |
+
padding: 15px 30px;
|
199 |
font-size: 1.5em;
|
200 |
background-color: #e67e22;
|
201 |
color: #fff;
|
|
|
204 |
cursor: pointer;
|
205 |
}
|
206 |
|
207 |
+
/* ์ฌ๋ผ์ด๋ ์คํ์ผ (๊ธ์์ ๋ฐ ํฌ๊ฒ) */
|
208 |
input[type=range] {
|
209 |
height: 25px;
|
210 |
}
|
|
|
213 |
width: 25px;
|
214 |
}
|
215 |
.slider-label {
|
216 |
+
font-size: 1.4em;
|
217 |
margin-bottom: 5px;
|
218 |
}
|
219 |
+
|
220 |
+
/* ๋ชจ๋ input, select, button ๊ธ์ ํฌ๊ธฐ ํค์ */
|
221 |
+
input, button, select, textarea {
|
222 |
+
font-size: 1.2em;
|
223 |
}
|
224 |
"""
|
225 |
|
|
|
227 |
# Gradio UI ๊ตฌ์ฑ (HTML/CSS ์ปค์คํฐ๋ง์ด์ง)
|
228 |
# -------------------------------
|
229 |
with gr.Blocks(css=custom_css, title="์์ -> GIF ๋ณํ ์๋น์ค") as demo:
|
230 |
+
# ์ ๋ชฉ ๋ฐ ์ฌ์ฉ๊ฐ์ด๋ (์ผ์ชฝ ์ ๋ ฌ)
|
231 |
gr.HTML("<div class='custom-title'>๐ฌ ์์์ GIF๋ณํํ๊ธฐ</div>")
|
232 |
gr.HTML("<div class='guide-box'><strong>์ฌ์ฉ๊ฐ์ด๋:</strong><br>"
|
233 |
"1. ์ข์ธก ์
๋ ฅ๋ถ์์ ์์์ ์
๋ก๋ํ๊ณ ์ต์
์ ์ ํํ์ธ์.<br>"
|
234 |
"2. ํ๋จ ์์
์ธ๋ค์ผ๋ฏธ๋ฆฌ๋ณด๊ธฐ์์ ์์/์ข
๋ฃ ์๊ฐ์ ์
๋ ฅํด ์ธ๋ค์ผ์ ํ์ธํ์ธ์.<br>"
|
235 |
"3. โจ GIF ์์ฑํ๊ธฐ ๋ฒํผ์ ๋๋ฌ GIF๋ฅผ ์์ฑํ๊ณ , ์ฐ์ธก ์ถ๋ ฅ๋ถ์์ ๊ฒฐ๊ณผ๋ฅผ ํ์ธ ๋ฐ ๋ค์ด๋ก๋ํ์ธ์. ๐</div>")
|
236 |
|
237 |
+
# ์ฒซ๋ฒ์งธ ํ: ์
๋ ฅ๋ถ (์ข์ธก) / ์ถ๋ ฅ๋ถ (์ฐ์ธก)
|
238 |
with gr.Row(elem_classes="row-container"):
|
239 |
with gr.Column(elem_classes="column"):
|
240 |
with gr.Group(elem_classes="frame"):
|
|
|
259 |
gif_preview_output = gr.Image(label="GIF ๊ฒฐ๊ณผ ๋ฏธ๋ฆฌ๋ณด๊ธฐ")
|
260 |
download_output = gr.File(label="GIF ๋ค์ด๋ก๋")
|
261 |
|
262 |
+
# ๋๋ฒ์งธ ํ: ์์
์ธ๋ค์ผ๋ฏธ๋ฆฌ๋ณด๊ธฐ (์ ์ฒด ๋๋น)
|
263 |
with gr.Group(elem_classes="frame"):
|
264 |
gr.Markdown("### ๐ผ๏ธ ์์
์ธ๋ค์ผ๋ฏธ๋ฆฌ๋ณด๊ธฐ")
|
265 |
with gr.Row():
|