Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,7 @@ from PIL import Image, ExifTags
|
|
7 |
# κ°μ₯ λ¨Όμ set_page_config() νΈμΆ
|
8 |
st.set_page_config(page_title="λ₯νμ΄ν¬ μ¬μ λ°©μ§ νν°(ν
μ€νΈ)", layout="wide")
|
9 |
|
|
|
10 |
ga_code = """
|
11 |
<!-- Global site tag (gtag.js) - Google Analytics -->
|
12 |
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PZPBGNENQG"></script>
|
@@ -21,14 +22,34 @@ ga_code = """
|
|
21 |
# Streamlitμ GA μ½λ μ½μ
|
22 |
components.html(ga_code, height=0)
|
23 |
|
24 |
-
#
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
<style>
|
27 |
/* κ³΅ν΅ μ€νμΌ */
|
28 |
.stFileUploader label,
|
29 |
.stRadio label,
|
|
|
|
|
|
|
|
|
30 |
.stButton button,
|
31 |
-
.survey
|
|
|
|
|
|
|
|
|
32 |
transition: all 0.3s ease;
|
33 |
}
|
34 |
.stFileUploader label {
|
@@ -50,7 +71,7 @@ css = """
|
|
50 |
font-weight: bold;
|
51 |
text-align: center;
|
52 |
margin-top: 10px;
|
53 |
-
padding: 0 0
|
54 |
}
|
55 |
.custom-caption-2 {
|
56 |
font-size: 36px;
|
@@ -90,14 +111,14 @@ css = """
|
|
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
|
101 |
}
|
102 |
.a-tag {
|
103 |
color: #FF0080;
|
@@ -165,21 +186,9 @@ css = """
|
|
165 |
}
|
166 |
}
|
167 |
</style>
|
168 |
-
"""
|
169 |
-
|
170 |
-
|
171 |
-
st.markdown(css, unsafe_allow_html=True)
|
172 |
-
|
173 |
-
st.title("λ₯νμ΄ν¬ μ¬μ λ°©μ§ νν°(ν
μ€νΈ)")
|
174 |
-
st.markdown("")
|
175 |
-
st.markdown("<span style='font-size: 18px;'>μλ
νμΈμ! μ ν¬λ λ₯νμ΄ν¬λ‘λΆν° μ¬λ¬λΆμ μ¬μ§μ 보νΈνλ μ루μ
μ κ°λ°νκ³ μμ΅λλ€.</span>", unsafe_allow_html=True)
|
176 |
-
st.markdown("<span style='font-size: 18px;'>μ ν¬μ λͺ©νλ μ¨λΌμΈμ κ²μλ κ°μΈμ μ¬μ§μ΄ μ
μ± λ₯νμ΄ν¬ μμμ μ¬μ©λμ§ μλλ‘ νλ κ²μ
λλ€. νμ¬λ κ°λ°μ λ§λ¬΄λ¦¬νκ³ μλΉμ€ν νκΈ° μ , μ¬λ¬λΆμ μ견μ λ£κΈ° μν΄ κ°λ¨ν ν
μ€νΈλ₯Ό μ§ννκ³ μμ΅λλ€.</span>", unsafe_allow_html=True)
|
177 |
-
st.markdown("<span style='font-size: 18px;'>μ΅κ·Ό SNSμ μ
λ‘λλ μ΄λ―Έμ§κ° λ₯νμ΄ν¬ ν¬λ₯΄λ
Έλ¬Όμ μ
μ©λλ μ¬λ‘κ° λ§€μΌ λ³΄κ³ λκ³ μμ΅λλ€. λ°λΌμ ν΄κ²°μ±
μ κ°κ΅¬νκΈ° μν΄, μ¬λ¬λΆμ μμ€ν μκ²¬μ΄ νμν©λλ€.</span>", unsafe_allow_html=True)
|
178 |
-
st.markdown("<span style='font-size: 18px;'>μλ λ§ν¬λ₯Ό ν΅ν΄ μ ν¬ μλΉμ€λ₯Ό μ΄μ©ν΄ 보μ ν, μΈν°λ·°μ μ°Έμ¬ν΄ μ£Όμλ©΄ ν° λμμ΄ λκ² μ΅λλ€. μ¬λ¬λΆμ νΌλλ°±μ μλΉμ€ κ°μ μ κ·μ€ν μλ£κ° λ κ²μ
λλ€.</span>", unsafe_allow_html=True)
|
179 |
-
st.markdown("")
|
180 |
-
st.markdown("<span style='font-size: 18px;'>λμ μ리 : 1. μ΄λ―Έμ§λ₯Ό μ
λ‘λνλ©΄, μ¬μ λ°©μ§ νν°κ° μ μ©λ μ΄λ―Έμ§λ₯Ό οΏ½οΏ½οΏ½μ¬λ립λλ€. 2. νλ¨μ ν° λ²νΌμ ν΄λ¦νλ©΄ λ₯νμ΄ν¬ λͺ¨λΈμ ν΅ν΄ μμ±λ κ²°κ³Όλ₯Ό νμΈν μ μμ΅λλ€.</span>", unsafe_allow_html=True)
|
181 |
-
st.markdown("<span style='font-size: 18px;'>μ¬λ¬λΆμ μ°Έμ¬μ κ°μ¬λ립λλ€!</span>", unsafe_allow_html=True)
|
182 |
-
st.markdown("<span style='font-size: 14px;'> *μ¬μ λ°©μ§ νν°λ: μ¬λ¬λΆμ μ¬μ§μ΄ λ₯νμ΄ν¬ λͺ¨λΈμ νμ΅λμ§ λͺ»νλλ‘ λ°©ν΄νλ λ
Έμ΄μ¦(noise)ννμ νν°.</span>", unsafe_allow_html=True)
|
183 |
|
184 |
def change_hair_to_blonde(image):
|
185 |
# Convert to OpenCV format
|
|
|
7 |
# κ°μ₯ λ¨Όμ set_page_config() νΈμΆ
|
8 |
st.set_page_config(page_title="λ₯νμ΄ν¬ μ¬μ λ°©μ§ νν°(ν
μ€νΈ)", layout="wide")
|
9 |
|
10 |
+
|
11 |
ga_code = """
|
12 |
<!-- Global site tag (gtag.js) - Google Analytics -->
|
13 |
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PZPBGNENQG"></script>
|
|
|
22 |
# Streamlitμ GA μ½λ μ½μ
|
23 |
components.html(ga_code, height=0)
|
24 |
|
25 |
+
# λλ¨Έμ§ Streamlit μ½λ
|
26 |
+
st.title("λ₯νμ΄ν¬ μ¬μ λ°©μ§ νν°(ν
μ€νΈ)")
|
27 |
+
st.markdown("")
|
28 |
+
st.markdown("<span style='font-size: 18px;'>μλ
νμΈμ! μ ν¬λ λ₯νμ΄ν¬λ‘λΆν° μ¬λ¬λΆμ μ¬μ§μ 보νΈνλ μ루μ
μ κ°λ°νκ³ μμ΅λλ€.</span>", unsafe_allow_html=True)
|
29 |
+
st.markdown("<span style='font-size: 18px;'>μ ν¬μ λͺ©νλ μ¨λΌμΈμ κ²μλ κ°μΈμ μ¬μ§μ΄ μ
μ± λ₯νμ΄ν¬ μμμ μ¬μ©λμ§ μλλ‘ νλ κ²μ
λλ€. νμ¬λ κ°λ°μ λ§λ¬΄λ¦¬νκ³ μλΉμ€ν νκΈ° μ , μ¬λ¬λΆμ μ견μ λ£κΈ° μν΄ κ°λ¨ν ν
μ€νΈλ₯Ό μ§ννκ³ μμ΅λλ€.</span>", unsafe_allow_html=True)
|
30 |
+
st.markdown("<span style='font-size: 18px;'>μ΅κ·Ό SNSμ μ
λ‘λλ μ΄λ―Έμ§κ° λ₯νμ΄ν¬ ν¬λ₯΄λ
Έλ¬Όμ μ
μ©λλ μ¬λ‘κ° λ§€μΌ λ³΄κ³ λκ³ μμ΅λλ€. λ°λΌμ ν΄κ²°μ±
μ κ°κ΅¬νκΈ° μν΄, μ¬λ¬λΆμ μμ€ν μκ²¬μ΄ νμν©λλ€.</span>", unsafe_allow_html=True)
|
31 |
+
st.markdown("<span style='font-size: 18px;'>μλ λ§ν¬λ₯Ό ν΅ν΄ μ ν¬ μλΉμ€λ₯Ό μ΄μ©ν΄ 보μ ν, μΈν°λ·°μ μ°Έμ¬ν΄ μ£Όμλ©΄ ν° λμμ΄ λκ² μ΅λλ€. μ¬λ¬λΆμ νΌλλ°±μ μλΉμ€ κ°μ μ κ·μ€ν μλ£κ° λ κ²μ
λλ€.</span>", unsafe_allow_html=True)
|
32 |
+
st.markdown("")
|
33 |
+
st.markdown("<span style='font-size: 18px;'>λμ μ리 : 1. μ΄λ―Έμ§λ₯Ό μ
λ‘λνλ©΄, μ¬μ λ°©μ§ νν°κ° μ μ©λ μ΄λ―Έμ§λ₯Ό 보μ¬λ립λλ€. 2. νλ¨μ ν° λ²νΌμ ν΄λ¦νλ©΄ λ₯νμ΄ν¬ λͺ¨λΈμ ν΅ν΄ μμ±λ κ²°κ³Όλ₯Ό νμΈν μ μμ΅λλ€.</span>", unsafe_allow_html=True)
|
34 |
+
st.markdown("<span style='font-size: 18px;'>μ¬λ¬λΆμ μ°Έμ¬μ κ°μ¬λ립λλ€!</span>", unsafe_allow_html=True)
|
35 |
+
st.markdown("<span style='font-size: 14px;'> *μ¬μ λ°©μ§ νν°λ: μ¬λ¬λΆμ μ¬μ§μ΄ λ₯νμ΄ν¬ λͺ¨λΈμ νμ΅λμ§ λͺ»νλλ‘ λ°©ν΄νλ λ
Έμ΄μ¦(noise)ννμ νν°.</span>", unsafe_allow_html=True)
|
36 |
+
st.markdown(
|
37 |
+
"""
|
38 |
+
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet">
|
39 |
<style>
|
40 |
/* κ³΅ν΅ μ€νμΌ */
|
41 |
.stFileUploader label,
|
42 |
.stRadio label,
|
43 |
+
.stRadio div,
|
44 |
+
.custom-caption-1,
|
45 |
+
.custom-caption-2,
|
46 |
+
.button-container,
|
47 |
.stButton button,
|
48 |
+
.survey,
|
49 |
+
.survey-1,
|
50 |
+
.survey-2,
|
51 |
+
.a-tag,
|
52 |
+
a {
|
53 |
transition: all 0.3s ease;
|
54 |
}
|
55 |
.stFileUploader label {
|
|
|
71 |
font-weight: bold;
|
72 |
text-align: center;
|
73 |
margin-top: 10px;
|
74 |
+
padding: 0 0 200px 0;
|
75 |
}
|
76 |
.custom-caption-2 {
|
77 |
font-size: 36px;
|
|
|
111 |
.survey-1 {
|
112 |
font-size: 25px;
|
113 |
text-align: center;
|
114 |
+
margin-top: 10px
|
115 |
font-weight: bold;
|
116 |
}
|
117 |
.survey-2 {
|
118 |
text-align: center;
|
119 |
+
margin-top: 10px
|
120 |
font-weight: bold;
|
121 |
+
padding 0 auto 50px auto
|
122 |
}
|
123 |
.a-tag {
|
124 |
color: #FF0080;
|
|
|
186 |
}
|
187 |
}
|
188 |
</style>
|
189 |
+
""",
|
190 |
+
unsafe_allow_html=True,
|
191 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
|
193 |
def change_hair_to_blonde(image):
|
194 |
# Convert to OpenCV format
|