Update app.py
Browse files
app.py
CHANGED
@@ -24,44 +24,145 @@ components.html(ga_code, height=0)
|
|
24 |
# ๋ฐ์ํ ๋์์ธ์ ์ํ CSS
|
25 |
css = """
|
26 |
<style>
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
}
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
|
|
36 |
font-size: 20px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
font-weight: bold;
|
38 |
text-align: center;
|
39 |
margin-top: 10px;
|
40 |
-
|
41 |
-
display: block;
|
42 |
}
|
43 |
-
|
44 |
-
|
45 |
-
|
|
|
|
|
|
|
46 |
}
|
47 |
-
|
48 |
-
.center-align {
|
49 |
text-align: center;
|
|
|
50 |
}
|
51 |
-
|
52 |
.stButton button {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
display: block;
|
54 |
-
margin: 0 auto;
|
55 |
}
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
font-size: 16px;
|
64 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
}
|
66 |
</style>
|
67 |
"""
|
@@ -138,45 +239,30 @@ if uploaded_file is not None:
|
|
138 |
# Save the original image as a numpy array
|
139 |
image_np = np.array(image)
|
140 |
|
141 |
-
st.
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
st.markdown('</div>', unsafe_allow_html=True)
|
147 |
-
|
148 |
-
st.markdown('<div class="center-align">', unsafe_allow_html=True)
|
149 |
-
st.image(image, use_column_width=True)
|
150 |
-
st.markdown('<div class="custom-caption-1">ํํฐ๋ฅผ ์
ํ ์ด๋ฏธ์ง</div>', unsafe_allow_html=True)
|
151 |
-
st.markdown('</div>', unsafe_allow_html=True)
|
152 |
|
153 |
-
|
|
|
|
|
154 |
|
155 |
-
button_clicked = st.button("์๋จ์ ๋ ์ฌ์ง์ ๋ฅํ์ดํฌ ๋ชจ๋ธ์ ํ์ต์ํค๊ธฐ"
|
|
|
|
|
|
|
156 |
|
157 |
if button_clicked:
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
st.markdown('<div class="custom-caption-2">์๋ณธ ์ด๋ฏธ์ง๋ฅผ ๋ฅํ์ดํฌ ๋ชจ๋ธ์ ๋ฃ์์ ๊ฒฝ์ฐ</div>', unsafe_allow_html=True)
|
164 |
-
st.markdown("<span>์ดํด๋ฅผ ๋๊ธฐ ์ํด ์ฌ์ง์ ๋
ธ๋์์ ์
ํ๋ ๋ฅํ์ดํฌ ์๊ณ ๋ฆฌ์ฆ ์ ์ฉ. ์๋ณธ ์ด๋ฏธ์ง๋ ๋ฅํ์ดํฌ ์๊ณ ๋ฆฌ์ฆ์ ์ํฅ์ ๋ฐ์.</span>", unsafe_allow_html=True)
|
165 |
-
st.markdown('</div>', unsafe_allow_html=True)
|
166 |
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
st.markdown('</div>', unsafe_allow_html=True)
|
173 |
-
|
174 |
-
st.markdown('</div>', unsafe_allow_html=True)
|
175 |
-
|
176 |
-
# ์ธํฐ๋ทฐ ๊ด๋ จ ๋ฌธ๊ตฌ๋ฅผ ๋ฒํผ ํด๋ฆญ ํ ์๋์ ํ์
|
177 |
-
st.markdown('<p class="survey">์ ์๋น์ค๋ฅผ ์ฌ์ฉํด ๋ณด์
จ๊ฑฐ๋, ์ ํฌ ๊ธฐ์ ์ ์๋ฆฌ์ ๊ด์ฌ์ด ์์ผ์ ๋ถ๋ค๊ป์ ์๋์ ๊ฐ๋จํ ์ธํฐ๋ทฐ์ ์ฐธ์ฌํด ์ฃผ์๋ฉด ์ง์ฌ์ผ๋ก ๊ฐ์ฌ๋๋ฆฌ๊ฒ ์ต๋๋ค.</p>', unsafe_allow_html=True)
|
178 |
-
st.markdown('<p class="survey-1"><a href="https://docs.google.com/forms/d/e/1FAIpQLSdzRtuvQyp3CQDhlxEag40v2yDM7u9NYpJ2gv5kgwuNbo1gUA/viewform?usp=sf_link" target="_blank" class="a-tag">์ฌ๊ธฐ๋ฅผ ํด๋ฆญํ์ฌ ์ธํฐ๋ทฐ์ ์ํด ์ฃผ์ ๋ค๋ฉด ํฐ ๋์์ด ๋ ๊ฒ ๊ฐ์ต๋๋ค!!</a></p>', unsafe_allow_html=True)
|
179 |
-
st.markdown('<p class="survey-2">์๋น์ค๋ฅผ ์ด์ฉํด ์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค! ์ข์ ํ๋ฃจ ๋ณด๋ด์ธ์!</p>', unsafe_allow_html=True)
|
180 |
-
|
181 |
-
# ์ฌ๋ฐฑ์ ์ถ๊ฐ
|
182 |
-
st.markdown('<div class="bottom-space"></div>', unsafe_allow_html=True)
|
|
|
24 |
# ๋ฐ์ํ ๋์์ธ์ ์ํ CSS
|
25 |
css = """
|
26 |
<style>
|
27 |
+
/* ๊ณตํต ์คํ์ผ */
|
28 |
+
.stFileUploader label,
|
29 |
+
.stRadio label,
|
30 |
+
.stButton button,
|
31 |
+
.survey-1 {
|
32 |
+
transition: all 0.3s ease;
|
33 |
}
|
34 |
+
.stFileUploader label {
|
35 |
+
font-size: 20px;
|
36 |
+
font-weight: 500;
|
37 |
+
color: #1f77b4;
|
38 |
+
}
|
39 |
+
.stRadio label {
|
40 |
font-size: 20px;
|
41 |
+
font-weight: 500;
|
42 |
+
color: #1f77b4;
|
43 |
+
}
|
44 |
+
.stRadio div {
|
45 |
+
display: flex;
|
46 |
+
gap: 20px;
|
47 |
+
}
|
48 |
+
.custom-caption-1 {
|
49 |
+
font-size: 36px;
|
50 |
font-weight: bold;
|
51 |
text-align: center;
|
52 |
margin-top: 10px;
|
53 |
+
padding: 0 0 20px 0;
|
|
|
54 |
}
|
55 |
+
.custom-caption-2 {
|
56 |
+
font-size: 36px;
|
57 |
+
font-weight: bold;
|
58 |
+
text-align: center;
|
59 |
+
margin-top: 10px;
|
60 |
+
padding: 0 0 30px 0;
|
61 |
}
|
62 |
+
.button-container {
|
|
|
63 |
text-align: center;
|
64 |
+
margin-top: 30px;
|
65 |
}
|
|
|
66 |
.stButton button {
|
67 |
+
width: 50%;
|
68 |
+
font-size: 25px;
|
69 |
+
padding: 10px 20px;
|
70 |
+
background-color: #FFFFFF;
|
71 |
+
font-weight: bold;
|
72 |
+
color: black;
|
73 |
+
opacity: 0.8;
|
74 |
+
border: 3px solid black;
|
75 |
+
border-radius: 5px;
|
76 |
+
cursor: pointer;
|
77 |
+
margin: 0 auto 50px auto;
|
78 |
display: block;
|
|
|
79 |
}
|
80 |
+
.stButton button:hover {
|
81 |
+
background-color: #FFFFFF;
|
82 |
+
border: 3px solid #FF0080;
|
83 |
+
color: #FF0080;
|
84 |
+
opacity: 1;
|
85 |
+
}
|
86 |
+
.survey {
|
87 |
+
text-align: center;
|
88 |
+
margin-top: 10px
|
89 |
+
}
|
90 |
+
.survey-1 {
|
91 |
+
font-size: 25px;
|
92 |
+
text-align: center;
|
93 |
+
margin-top: 10px;
|
94 |
+
font-weight: bold;
|
95 |
+
}
|
96 |
+
.survey-2 {
|
97 |
+
text-align: center;
|
98 |
+
margin-top: 10px;
|
99 |
+
font-weight: bold;
|
100 |
+
padding: 0 auto 50px auto;
|
101 |
+
}
|
102 |
+
.a-tag {
|
103 |
+
color: #FF0080;
|
104 |
+
text-decoration: none;
|
105 |
+
}
|
106 |
+
a:hover {
|
107 |
+
color: #FF0080;
|
108 |
+
text-decoration: none;
|
109 |
+
}
|
110 |
+
|
111 |
+
/* ์ค๋งํธํฐ ํ๋ฉด ์คํ์ผ */
|
112 |
+
@media only screen and (max-width: 600px) {
|
113 |
+
.stFileUploader label,
|
114 |
+
.stRadio label,
|
115 |
+
.stButton button,
|
116 |
+
.survey-1 {
|
117 |
font-size: 16px;
|
118 |
}
|
119 |
+
.custom-caption-1,
|
120 |
+
.custom-caption-2 {
|
121 |
+
font-size: 24px;
|
122 |
+
padding: 0 0 20px 0;
|
123 |
+
}
|
124 |
+
.stButton button {
|
125 |
+
width: 100%;
|
126 |
+
font-size: 18px;
|
127 |
+
}
|
128 |
+
}
|
129 |
+
|
130 |
+
/* ํ๋ธ๋ฆฟ ํ๋ฉด ์คํ์ผ */
|
131 |
+
@media only screen and (min-width: 601px) and (max-width: 1024px) {
|
132 |
+
.stFileUploader label,
|
133 |
+
.stRadio label,
|
134 |
+
.stButton button,
|
135 |
+
.survey-1 {
|
136 |
+
font-size: 18px;
|
137 |
+
}
|
138 |
+
.custom-caption-1,
|
139 |
+
.custom-caption-2 {
|
140 |
+
font-size: 28px;
|
141 |
+
padding: 0 0 40px 0;
|
142 |
+
}
|
143 |
+
.stButton button {
|
144 |
+
width: 75%;
|
145 |
+
font-size: 20px;
|
146 |
+
}
|
147 |
+
}
|
148 |
+
|
149 |
+
/* ๋ฐ์คํฌํฑ ํ๋ฉด ์คํ์ผ */
|
150 |
+
@media only screen and (min-width: 1025px) {
|
151 |
+
.stFileUploader label,
|
152 |
+
.stRadio label,
|
153 |
+
.stButton button,
|
154 |
+
.survey-1 {
|
155 |
+
font-size: 20px;
|
156 |
+
}
|
157 |
+
.custom-caption-1,
|
158 |
+
.custom-caption-2 {
|
159 |
+
font-size: 36px;
|
160 |
+
padding: 0 0 200px 0;
|
161 |
+
}
|
162 |
+
.stButton button {
|
163 |
+
width: 50%;
|
164 |
+
font-size: 25px;
|
165 |
+
}
|
166 |
}
|
167 |
</style>
|
168 |
"""
|
|
|
239 |
# Save the original image as a numpy array
|
240 |
image_np = np.array(image)
|
241 |
|
242 |
+
col1, col2 = st.columns(2)
|
243 |
+
|
244 |
+
with col1:
|
245 |
+
st.image(image, use_column_width=True)
|
246 |
+
st.markdown('<div class="custom-caption-1">์
๋ก๋ํ ์ด๋ฏธ์ง</div>', unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
|
248 |
+
with col2:
|
249 |
+
st.image(image, use_column_width=True)
|
250 |
+
st.markdown('<div class="custom-caption-1">ํํฐ๋ฅผ ์
ํ ์ด๋ฏธ์ง</div>', unsafe_allow_html=True)
|
251 |
|
252 |
+
button_clicked = st.button("์๋จ์ ๋ ์ฌ์ง์ ๋ฅํ์ดํฌ ๋ชจ๋ธ์ ํ์ต์ํค๊ธฐ")
|
253 |
+
st.markdown('<p class="survey">์ ์๋น์ค๋ฅผ ์ฌ์ฉํด ๋ณด์
จ๊ฑฐ๋, ์ ํฌ ๊ธฐ์ ์ ์๋ฆฌ์ ๊ด์ฌ์ด ์์ผ์ ๋ถ๋ค๊ป์ ์๋์ ๊ฐ๋จํ ์ธํฐ๋ทฐ์ ์ฐธ์ฌํด ์ฃผ์๋ฉด ์ง์ฌ์ผ๋ก ๊ฐ์ฌ๋๋ฆฌ๊ฒ ์ต๋๋ค.</p>', unsafe_allow_html=True)
|
254 |
+
st.markdown('<p class="survey-1"><a href="https://docs.google.com/forms/d/e/1FAIpQLSdzRtuvQyp3CQDhlxEag40v2yDM7u9NYpJ2gv5kgwuNbo1gUA/viewform?usp=sf_link" target="_blank" class="a-tag">์ฌ๊ธฐ๋ฅผ ํด๋ฆญํ์ฌ ์ธํฐ๋ทฐ์ ์ํด ์ฃผ์ ๋ค๋ฉด ํฐ ๋์์ด ๋ ๊ฒ ๊ฐ์ต๋๋ค!!</a></p>', unsafe_allow_html=True)
|
255 |
+
st.markdown('<p class="survey-2">์๋น์ค๋ฅผ ์ด์ฉํด ์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค! ์ข์ ํ๋ฃจ ๋ณด๋ด์ธ์!</p>', unsafe_allow_html=True)
|
256 |
|
257 |
if button_clicked:
|
258 |
+
with col1:
|
259 |
+
processed_image = change_hair_to_blonde(image)
|
260 |
+
st.image(processed_image, use_column_width=True)
|
261 |
+
st.markdown('<div class="custom-caption-2">์๋ณธ ์ด๋ฏธ์ง๋ฅผ ๋ฅํ์ดํฌ ๋ชจ๋ธ์ ๋ฃ์์ ๊ฒฝ์ฐ</div>', unsafe_allow_html=True)
|
262 |
+
st.markdown("<span>์ดํด๋ฅผ ๋๊ธฐ ์ํด ์ฌ์ง์ ๋
ธ๋์์ ์
ํ๋ ๋ฅํ์ดํฌ ์๊ณ ๋ฆฌ์ฆ ์ ์ฉ. ์๋ณธ ์ด๋ฏธ์ง๋ ๋ฅํ์ดํฌ ์๊ณ ๋ฆฌ์ฆ์ ์ํฅ์ ๋ฐ์.</span>", unsafe_allow_html=True)
|
|
|
|
|
|
|
263 |
|
264 |
+
with col2:
|
265 |
+
deepfake_image = add_noise(image)
|
266 |
+
st.image(deepfake_image, use_column_width=True)
|
267 |
+
st.markdown('<div class="custom-caption-2">์ฌ์ ๋ฐฉ์ง ํํฐ ์ด๋ฏธ์ง๋ฅผ ๋ฅํ์ดํฌ ๋ชจ๋ธ์ ๋ฃ์์ ๊ฒฝ์ฐ</div>', unsafe_allow_html=True)
|
268 |
+
st.markdown("<span>์ฌ์ ๋ฐฉ์ง ํํฐ๋ฅผ ์
ํ ์ด๋ฏธ์ง๋ ๋ฅํ์ดํฌ ์๊ณ ๋ฆฌ์ฆ์ ์ํฅ์ ๋ฐ์ง ์๊ณ ๋
ธ์ด์ฆ ์ฒ๋ฆฌ๊ฐ ๋์ด ์์๋ณด๊ธฐ ํ๋ ์ฌ์ง์ ์ถ๋ ฅ. ์ฆ, ๋ฅํ์ดํฌ ์ฌ์ง ํฉ์ฑ์ ๋ฐฉํดํจ.</span>", unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|