Update app.py
Browse files"grid๋ก ๋ฐ์ํ ๋ง๋ค์ด๋ณด๊ธฐ"
app.py
CHANGED
@@ -24,144 +24,29 @@ components.html(ga_code, height=0)
|
|
24 |
# ๋ฐ์ํ ๋์์ธ์ ์ํ CSS
|
25 |
css = """
|
26 |
<style>
|
27 |
-
|
28 |
-
|
29 |
-
|
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 |
-
|
49 |
-
|
50 |
-
font-
|
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 |
-
|
95 |
}
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
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 |
-
|
163 |
-
|
164 |
-
font-size:
|
165 |
}
|
166 |
}
|
167 |
</style>
|
@@ -239,15 +124,19 @@ if uploaded_file is not None:
|
|
239 |
# Save the original image as a numpy array
|
240 |
image_np = np.array(image)
|
241 |
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
|
248 |
-
|
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)
|
@@ -255,14 +144,20 @@ if uploaded_file is not None:
|
|
255 |
st.markdown('<p class="survey-2">์๋น์ค๋ฅผ ์ด์ฉํด ์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค! ์ข์ ํ๋ฃจ ๋ณด๋ด์ธ์!</p>', unsafe_allow_html=True)
|
256 |
|
257 |
if button_clicked:
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
|
|
|
|
|
|
263 |
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
|
|
|
|
|
|
|
24 |
# ๋ฐ์ํ ๋์์ธ์ ์ํ CSS
|
25 |
css = """
|
26 |
<style>
|
27 |
+
.container {
|
28 |
+
display: grid;
|
29 |
+
grid-template-columns: 1fr 1fr;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
gap: 20px;
|
31 |
+
align-items: center;
|
32 |
+
justify-items: center;
|
33 |
}
|
34 |
+
|
35 |
+
.custom-caption-1, .custom-caption-2 {
|
36 |
+
font-size: 20px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
font-weight: bold;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
text-align: center;
|
39 |
margin-top: 10px;
|
40 |
+
color: white;
|
41 |
}
|
42 |
+
|
43 |
+
@media only screen and (max-width: 768px) {
|
44 |
+
.container {
|
45 |
+
grid-template-columns: 1fr;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
}
|
47 |
+
|
48 |
+
.custom-caption-1, .custom-caption-2 {
|
49 |
+
font-size: 16px;
|
50 |
}
|
51 |
}
|
52 |
</style>
|
|
|
124 |
# Save the original image as a numpy array
|
125 |
image_np = np.array(image)
|
126 |
|
127 |
+
st.markdown('<div class="container">', unsafe_allow_html=True)
|
128 |
+
|
129 |
+
st.markdown('<div>', unsafe_allow_html=True)
|
130 |
+
st.image(image, use_column_width=True)
|
131 |
+
st.markdown('<div class="custom-caption-1">์
๋ก๋ํ ์ด๋ฏธ์ง</div>', unsafe_allow_html=True)
|
132 |
+
st.markdown('</div>', unsafe_allow_html=True)
|
133 |
+
|
134 |
+
st.markdown('<div>', unsafe_allow_html=True)
|
135 |
+
st.image(image, use_column_width=True)
|
136 |
+
st.markdown('<div class="custom-caption-1">ํํฐ๋ฅผ ์
ํ ์ด๋ฏธ์ง</div>', unsafe_allow_html=True)
|
137 |
+
st.markdown('</div>', unsafe_allow_html=True)
|
138 |
|
139 |
+
st.markdown('</div>', unsafe_allow_html=True)
|
|
|
|
|
140 |
|
141 |
button_clicked = st.button("์๋จ์ ๏ฟฝ๏ฟฝ๏ฟฝ ์ฌ์ง์ ๋ฅํ์ดํฌ ๋ชจ๋ธ์ ํ์ต์ํค๊ธฐ")
|
142 |
st.markdown('<p class="survey">์ ์๋น์ค๋ฅผ ์ฌ์ฉํด ๋ณด์
จ๊ฑฐ๋, ์ ํฌ ๊ธฐ์ ์ ์๋ฆฌ์ ๊ด์ฌ์ด ์์ผ์ ๋ถ๋ค๊ป์ ์๋์ ๊ฐ๋จํ ์ธํฐ๋ทฐ์ ์ฐธ์ฌํด ์ฃผ์๋ฉด ์ง์ฌ์ผ๋ก ๊ฐ์ฌ๋๋ฆฌ๊ฒ ์ต๋๋ค.</p>', unsafe_allow_html=True)
|
|
|
144 |
st.markdown('<p class="survey-2">์๋น์ค๋ฅผ ์ด์ฉํด ์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค! ์ข์ ํ๋ฃจ ๋ณด๋ด์ธ์!</p>', unsafe_allow_html=True)
|
145 |
|
146 |
if button_clicked:
|
147 |
+
st.markdown('<div class="container">', unsafe_allow_html=True)
|
148 |
+
|
149 |
+
st.markdown('<div>', unsafe_allow_html=True)
|
150 |
+
processed_image = change_hair_to_blonde(image)
|
151 |
+
st.image(processed_image, use_column_width=True)
|
152 |
+
st.markdown('<div class="custom-caption-2">์๋ณธ ์ด๋ฏธ์ง๋ฅผ ๋ฅํ์ดํฌ ๋ชจ๋ธ์ ๋ฃ์์ ๊ฒฝ์ฐ</div>', unsafe_allow_html=True)
|
153 |
+
st.markdown("<span>์ดํด๋ฅผ ๋๊ธฐ ์ํด ์ฌ์ง์ ๋
ธ๋์์ ์
ํ๋ ๋ฅํ์ดํฌ ์๊ณ ๋ฆฌ์ฆ ์ ์ฉ. ์๋ณธ ์ด๋ฏธ์ง๋ ๋ฅํ์ดํฌ ์๊ณ ๋ฆฌ์ฆ์ ์ํฅ์ ๋ฐ์.</span>", unsafe_allow_html=True)
|
154 |
+
st.markdown('</div>', unsafe_allow_html=True)
|
155 |
|
156 |
+
st.markdown('<div>', unsafe_allow_html=True)
|
157 |
+
deepfake_image = add_noise(image)
|
158 |
+
st.image(deepfake_image, use_column_width=True)
|
159 |
+
st.markdown('<div class="custom-caption-2">์ฌ์ ๋ฐฉ์ง ํํฐ ์ด๋ฏธ์ง๋ฅผ ๋ฅํ์ดํฌ ๋ชจ๋ธ์ ๋ฃ์์ ๊ฒฝ์ฐ</div>', unsafe_allow_html=True)
|
160 |
+
st.markdown("<span>์ฌ์ ๋ฐฉ์ง ํํฐ๋ฅผ ์
ํ ์ด๋ฏธ์ง๋ ๋ฅํ์ดํฌ ์๊ณ ๋ฆฌ์ฆ์ ์ํฅ์ ๋ฐ์ง ์๊ณ ๋
ธ์ด์ฆ ์ฒ๋ฆฌ๊ฐ ๋์ด ์์๋ณด๊ธฐ ํ๋ ์ฌ์ง์ ์ถ๋ ฅ. ์ฆ, ๋ฅํ์ดํฌ ์ฌ์ง ํฉ์ฑ์ ๋ฐฉํดํจ.</span>", unsafe_allow_html=True)
|
161 |
+
st.markdown('</div>', unsafe_allow_html=True)
|
162 |
+
|
163 |
+
st.markdown('</div>', unsafe_allow_html=True)
|