MoonChaeyeon

add image

Showing 105 changed files with 269 additions and 183 deletions
{
"cells": [
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"ename": "ModuleNotFoundError",
"evalue": "No module named 'cv2'",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m<ipython-input-6-c9d5b88864a0>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mimport\u001b[0m \u001b[0mcv2\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mos\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mnumpy\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mnp\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mPIL\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mImage\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'cv2'"
]
}
],
"source": [
"import cv2\n",
"import os\n",
"import numpy as np\n",
"from PIL import Image\n",
" \n",
"path = 'Kang'\n",
"imagePaths = [os.path.join(path,file_name) for file_name in os.listdir(path)]\n",
"for imagePath in imagePaths:\n",
" img = Image.open(imagePath).convert('L')\n",
" img_numpy = np.array(img, 'uint8')\n",
" cv2.imwrite(\"Kang\\\\\" + imagePath.split(\"\\\\\")[-1], img_numpy)\n",
"print(\"All Done\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
No preview for this file type
......@@ -4,8 +4,12 @@
<head>
<link rel="stylesheet" href="style.css">
<meta charset="utf-8">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<title>겨울왕국 캐릭터 닮은꼴</title>
<meta name="keywords" content="엘사, 안나, 크리스토프, 한스, 울라프, 스벤, 브루니">
<link href="https://fonts.googleapis.com/css2?family=Jua&display=swap" rel="stylesheet">
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5e64b3727e862b06"></script>
</head>
<body>
......@@ -14,10 +18,14 @@
Frozen
</h1>
<div class="file-upload">
<h2>
나와 닮은 겨울왕국 캐릭터는?
</h2>
<div class="image-upload-wrap">
<input class="file-upload-input" type='file' onchange="readURL(this);" accept="image/*" />
<div class="drag-text">
<h3>얼굴 사진을 업로드 하세요</h3>
<h3>이곳에 얼굴 사진을 업로드 하세요!</h3>
<img src="olaf.png" align="center">
</div>
</div>
<div class="file-upload-content">
......@@ -173,7 +181,7 @@
break;
case "크리스토프":
resultMessage = "크리스토프"
resultExplain = "당신은 코가 크리스토프!"
resultExplain = "당신은 코가 크고 듬직한 크리스토프!"
break;
case "한스":
resultMessage = "한스"
......@@ -181,15 +189,19 @@
break;
case "울라프":
resultMessage = "울라프"
resultExplain = "당신은 최강 귀요미 울라프!"
resultExplain = "헐~ 당신은 눈사람?! 최강 귀요미 울라프!"
break;
case "스벤":
resultMessage = "스벤"
resultExplain = "당신은 순록?!"
resultExplain = "헐~ 당신은 순록?! 크리스토프의 영원한 친구"
break;
case "브루니":
resultMessage = "브루니"
resultExplain = "당신은 귀엽고 미간이 넓은 브루니!"
resultExplain = "헐~ 당신은 도마뱀?! 정말 귀여운 브루니!"
break;
case "트롤":
resultMessage = "트롤"
resultExplain = "헐~ 당신은 트롤?! 2등신 요정!"
break;
default:
resultMessage = "알수없음"
......@@ -230,6 +242,9 @@
case "브루니":
labelTitle = "브루니"
break;
case "트롤":
labelTitle = "트롤"
break;
default:
labelTitle = "알수없음"
}
......
from urllib.request import urlopen
from bs4 import BeautifulSoup as bs
from urllib.parse import quote_plus
baseUrl = 'https://search.naver.com/search.naver?where=image&sm=tab_jum&query='
plusUrl = input('검색어를 입력하세요 : ')
# 한글 검색 자동 변환
url = baseUrl + quote_plus(plusUrl)
html = urlopen(url)
soup = bs(html, "html.parser")
img = soup.find_all(class_='_img', limit = 20)
n = 1
for i in img:
imgUrl = i['data-source']
with urlopen(imgUrl) as f:
with open('사진' + plusUrl + str(n)+'.jpg','wb') as h: # w - write b - binary
img = f.read()
h.write(img)
n += 1
print('다운로드 완료')
\ No newline at end of file

108 KB

......@@ -4,56 +4,54 @@ html,
body {
font-family: 'Jua', sans-serif;
}
/**/
body {
width: 100%;
height: 100%;
background: #177082;
background: -moz-linear-gradient(top, #177082 0%, #52c9e0 100%);
body {
width: 100%;
height: 100%;
background: #177082;
background: -moz-linear-gradient(top, #177082 0%, #52c9e0 100%);
/* FF3.6+ */
background: -webkit-linear-gradient(top, #f0f9ff 0%, #52c9e0 100%);
background: -webkit-linear-gradient(top, #f0f9ff 0%, #52c9e0 100%);
/* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #177082 0%, #52c9e0 100%);
background: -o-linear-gradient(top, #177082 0%, #52c9e0 100%);
/* Opera 11.10+ */
background: -ms-linear-gradient(top, #177082 0%, #52c9e0 100%);
background: -ms-linear-gradient(top, #177082 0%, #52c9e0 100%);
/* IE10+ */
background: linear-gradient(to bottom, #177082 0%, #52c9e0 100%);
background: linear-gradient(to bottom, #177082 0%, #52c9e0 100%);
}
.svg-snowscene {
width: 100%;
.svg-snowscene {
width: 100%;
}
.snow {
fill: #fff;
animation-name: snowing;
animation-duration: 3s;
animation-iteration-count: infinite;
animation-timing-function: ease-out;
.snow {
fill: #fff;
animation-name: snowing;
animation-duration: 3s;
animation-iteration-count: infinite;
animation-timing-function: ease-out;
}
.snow:nth-child(2n) {
animation-delay: 1.5s;
.snow:nth-child(2n) {
animation-delay: 1.5s;
}
.snow:nth-child(3n) {
animation-delay: 2.3s;
animation-duration: 3.3s;
.snow:nth-child(3n) {
animation-delay: 2.3s;
animation-duration: 3.3s;
}
.snow:nth-child(4n) {
animation-delay: 0.8s;
animation-duration: 3.2s;
.snow:nth-child(4n) {
animation-delay: 0.8s;
animation-duration: 3.2s;
}
.snow:nth-child(5n) {
animation-delay: 2.8s;
.snow:nth-child(5n) {
animation-delay: 2.8s;
}
@keyframes snowing {
0% {
fill-opacity: 1;
@keyframes snowing {
0% {
fill-opacity: 1;
}
100% {
fill-opacity: 0;
transform: translateY(200px);
100% {
fill-opacity: 0;
transform: translateY(200px);
}
}
/**/
p {
color: white;
text-align: center;
......@@ -110,14 +108,24 @@ h1 {
font-family: 'frozen', serif;
font-weight: 700;
}
h2 {
font-weight: 100;
font-size: 2.5rem;
color: #d6ffffe8;
text-align: center;
}
img {
margin-bottom: 20%;
}
/* 이미지 업로드 창 */
.file-upload {
width: 500px;
margin: 10% auto;
padding-top: 5%;
padding-right: 15%;
padding-left: 15%;
padding-right: 15%;
padding-left: 15%;
padding-bottom: 10%;
border-radius: 10px;
border-style: hidden;
......@@ -193,190 +201,210 @@ h1 {
}
.navbar-light .navbar-brand {
line-height: 1.68;
text-align: left;
color: #35465d;
line-height: 1.68;
text-align: left;
color: #35465d;
}
.navbar-light .navbar-toggler {
border-color: #ffffff;
border-color: #ffffff;
}
.upload {
width: 20%;
width: 20%;
}
.upload-text {
width: 58%;
font-size: 2rem;
line-height: 1.53;
text-align: center;
color: #35465d;
margin: 0 auto;
width: 58%;
font-size: 2rem;
line-height: 1.53;
text-align: center;
color: #35465d;
margin: 0 auto;
}
/* 막대 그래프 */
.bar-container {
height: 2.7rem;
height: 2.7rem;
}
.엘사-box {
position: relative;
top: 0;
left: 0;
height: 2rem;
border-radius: 10px;
width: 100%;
background-color: rgba(200, 158, 196, 0.3);
position: relative;
top: 0;
left: 0;
height: 2rem;
border-radius: 10px;
width: 100%;
background-color: rgba(200, 158, 196, 0.3);
}
.엘사-bar {
position: relative;
top: -2rem;
left: 0;
height: 2rem;
border-radius: 10px;
background-color: rgba(200, 158, 196, 1);
position: relative;
top: -2rem;
left: 0;
height: 2rem;
border-radius: 10px;
background-color: rgba(200, 158, 196, 1);
}
.안나-box {
position: relative;
top: 0;
left: 0;
height: 2rem;
border-radius: 10px;
width: 100%;
background-color: rgba(255, 201, 82, 0.3);
position: relative;
top: 0;
left: 0;
height: 2rem;
border-radius: 10px;
width: 100%;
background-color: rgba(255, 201, 82, 0.3);
}
.안나-bar {
position: relative;
top: -2rem;
left: 0;
height: 2rem;
border-radius: 10px;
background-color: rgba(255, 201, 82, 1);
position: relative;
top: -2rem;
left: 0;
height: 2rem;
border-radius: 10px;
background-color: rgba(255, 201, 82, 1);
}
.크리스토프-box {
position: relative;
top: 0;
left: 0;
height: 2rem;
border-radius: 10px;
width: 100%;
background-color: rgba(170, 205, 98, 0.3);
position: relative;
top: 0;
left: 0;
height: 2rem;
border-radius: 10px;
width: 100%;
background-color: rgba(170, 205, 98, 0.3);
}
.크리스토프-bar {
position: relative;
top: -2rem;
left: 0;
height: 2rem;
border-radius: 10px;
background-color: rgba(170, 205, 98, 1);
position: relative;
top: -2rem;
left: 0;
height: 2rem;
border-radius: 10px;
background-color: rgba(170, 205, 98, 1);
}
.한스-box {
position: relative;
top: 0;
left: 0;
height: 2rem;
border-radius: 10px;
width: 100%;
background-color: rgba(106, 175, 230, 0.3);
position: relative;
top: 0;
left: 0;
height: 2rem;
border-radius: 10px;
width: 100%;
background-color: rgba(106, 175, 230, 0.3);
}
.한스-bar {
position: relative;
top: -2rem;
left: 0;
height: 2rem;
border-radius: 10px;
background-color: rgba(106, 175, 230, 1);
position: relative;
top: -2rem;
left: 0;
height: 2rem;
border-radius: 10px;
background-color: rgba(106, 175, 230, 1);
}
.울라프-box {
position: relative;
top: 0;
left: 0;
height: 2rem;
border-radius: 10px;
width: 100%;
background-color: rgba(238, 119, 133, 0.3);
position: relative;
top: 0;
left: 0;
height: 2rem;
border-radius: 10px;
width: 100%;
background-color: rgba(238, 119, 133, 0.3);
}
.울라프-bar {
position: relative;
top: -2rem;
left: 0;
height: 2rem;
border-radius: 10px;
background-color: rgba(238, 119, 133, 1);
position: relative;
top: -2rem;
left: 0;
height: 2rem;
border-radius: 10px;
background-color: rgba(238, 119, 133, 1);
}
.스벤-box {
position: relative;
top: 0;
left: 0;
height: 2rem;
border-radius: 10px;
width: 100%;
background-color: rgba(197, 198, 182, 0.3);
position: relative;
top: 0;
left: 0;
height: 2rem;
border-radius: 10px;
width: 100%;
background-color: rgba(197, 198, 182, 0.3);
}
.스벤-bar {
position: relative;
top: -2rem;
left: 0;
height: 2rem;
border-radius: 10px;
background-color: rgba(197, 198, 182, 0.3);
position: relative;
top: -2rem;
left: 0;
height: 2rem;
border-radius: 10px;
background-color: rgba(197, 198, 182, 0.3);
}
.브루니-box {
position: relative;
top: 0;
left: 0;
height: 2rem;
border-radius: 10px;
width: 100%;
background-color: rgba(103, 213, 181, 0.3);
position: relative;
top: 0;
left: 0;
height: 2rem;
border-radius: 10px;
width: 100%;
background-color: rgba(103, 213, 181, 0.3);
}
.브루니-bar {
position: relative;
top: -2rem;
left: 0;
height: 2rem;
border-radius: 10px;
background-color: rgba(103, 213, 181, 1);
position: relative;
top: -2rem;
left: 0;
height: 2rem;
border-radius: 10px;
background-color: rgba(103, 213, 181, 1);
}
.트롤-box {
position: relative;
top: 0;
left: 0;
height: 2rem;
border-radius: 10px;
width: 100%;
background-color: rgba(116, 116, 116, 0.3);
}
.트롤-bar {
position: relative;
top: -2rem;
left: 0;
height: 2rem;
border-radius: 10px;
background-color: rgba(116, 116, 116, 1);
}
.percent-text {
font-size: 1rem;
color: #ffffff;
font-size: 1rem;
color: #ffffff;
}
.frozen-label {
width: 20%;
text-align: left;
height: 2rem;
width: 20%;
text-align: left;
height: 2rem;
font-size: 1.2rem;
}
#label-container {
width: 80%;
margin: 0 auto;
width: 80%;
margin: 0 auto;
}
.result-message {
font-size: 3rem;
font-size: 3rem;
}
.frozen-explain {
font-size: 2rem;
font-size: 2rem;
}
.엘사-frozen-title {
color: #c89ec4;
color: #c89ec4;
}
.안나-frozen-title {
color: #ffc952;
color: #ffc952;
}
.크리스토프-frozen-title {
color: #aacd62;
color: #aacd62;
}
.한스-frozen-title {
color: #6aafe6;
color: #6aafe6;
}
.울라프-frozen-title {
color: #ee7785;
color: #ee7785;
}
.스벤-frozen-title {
color: #c5c6b6;
color: #c5c6b6;
}
.브루니-frozen-title {
color: #67d5b2;
color: #67d5b2;
}
.트롤-frozen-title {
color: #747474;
}
\ No newline at end of file
......