Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김현기
/
KindOfYourDog
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김현기
2020-06-25 15:24:00 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
af9d7ffec591bf55e71418a3a1e45620d50d4146
af9d7ffe
1 parent
2b680bbf
image파일 추가
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
15 deletions
.gitignore
app.js
package.json
views/index.ejs
views/kind.ejs
views/optimize.jpg
.gitignore
View file @
af9d7ff
node_modules/
package.json
\ No newline at end of file
package-lock.json
\ No newline at end of file
...
...
app.js
View file @
af9d7ff
...
...
@@ -13,9 +13,9 @@ var bucketName = "kindofyourdogimage";
// s3 버킷의 엔드 포인트
var
bucketRegion
=
'ap-northeast-2'
;
// access key
var
accessId
=
'your_
access
Id'
;
var
accessId
=
'your_Id'
;
// access secret key
var
secretKey
=
'you
t_secretKey
'
;
var
secretKey
=
'you
r_secretId
'
;
// AWS Cognito 인증
AWS
.
config
.
update
({
region
:
bucketRegion
,
...
...
@@ -35,7 +35,7 @@ app.use(logger('dev'));
app
.
use
(
express
.
json
());
app
.
use
(
express
.
urlencoded
({
extended
:
false
}));
app
.
use
(
cookieParser
());
app
.
use
(
express
.
static
(
path
.
join
(
__dirname
,
'public'
)
));
app
.
use
(
express
.
static
(
__dirname
));
// image 올리는 화면
...
...
@@ -88,15 +88,13 @@ app.post('/upload_receiver', function(req,res){
client
.
detectLabels
(
params
,
function
(
err
,
response
)
{
console
.
log
(
params
);
response
.
Labels
.
some
(
label
=>
{
// 강아지 종류 추출 작업
if
(
label
.
Parents
.
length
>
4
&&
label
.
Name
!=
'Puppy'
)
{
console
.
log
(
label
.
Name
);
dogKind
=
label
.
Name
;
console
.
log
(
dogKind
);
res
.
render
(
'kind'
,{
dogKind
:
dogKind
});
return
true
;
}
});
});
result
=
`<img src="
${
data
.
Location
}
>`
;
console
.
log
(
result
);
...
...
package.json
0 → 100644
View file @
af9d7ff
{
"name"
:
"oss-project"
,
"version"
:
"1.0.0"
,
"description"
:
"AWS Rekognition을 이용한 강아지 종류 분석입니다."
,
"main"
:
"app.js"
,
"dependencies"
:
{
"aws-sdk"
:
"^2.703.0"
,
"cookie-parser"
:
"^1.4.5"
,
"ejs"
:
"^3.1.3"
,
"express"
:
"^4.17.1"
,
"formidable"
:
"^1.2.2"
,
"image-to-base64"
:
"^2.1.0"
,
"mocha-jsdom"
:
"^2.0.0"
,
"morgan"
:
"^1.10.0"
,
"multer"
:
"^1.4.2"
,
"nodemon"
:
"^2.0.4"
},
"devDependencies"
:
{},
"scripts"
:
{
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
,
"start"
:
"node bin/www"
},
"repository"
:
{
"type"
:
"git"
,
"url"
:
"ssh://git@khuhub.khu.ac.kr:12959/2016101156/OSS-Project.git"
},
"author"
:
""
,
"license"
:
"Apache License 2.0"
}
views/index.ejs
View file @
af9d7ff
<!DOCTYPE html>
<html>
<head>
<title>
KindOfYourDog
</title>
<meta
charset=
"utf-8"
/>
<link
rel=
"stylesheet"
href=
"stylesheets/style.css"
>
<link
rel=
"stylesheet"
href=
"public/stylesheets/style.css"
>
<title>
KindOfYourDog
</title>
</head>
<body>
<h1>
Kind of Your Dog
</h1>
<div>
<img
src =
"puppy.jpg"
>
</div>
<div>
<form
enctype=
"multipart/form-data"
method=
"post"
action=
"upload_receiver"
>
...
...
@@ -18,7 +17,7 @@
</form>
</div>
<div>
<h2>
이 개의 종류는
</h2>
<h2>
종류를 알고 싶은 개의 사진을 올리세요
</h2>
</div>
</body>
</html>
...
...
views/kind.ejs
View file @
af9d7ff
<!DOCTYPE html>
<html>
<head>
<title>
KindOfYourDog
</title>
<meta
charset=
"utf-8"
/>
<link
rel=
"stylesheet"
href=
"stylesheets/style.css"
>
<link
rel=
"stylesheet"
href=
"public/stylesheets/style.css"
>
<title>
KindOfYourDog
</title>
</head>
<body>
<h1>
Kind of Your Dog
</h1>
...
...
@@ -14,8 +14,8 @@
</form>
</div>
<div>
<h
2>
이 개의 종류는
</h2
>
<h
3>
<
%=dogKind%>
</h3
>
<h
3>
이 개의 종류는
</h3
>
<h
2>
<
%=dogKind%>
</h2
>
</div>
</body>
</html>
...
...
views/optimize.jpg
0 → 100644
View file @
af9d7ff
85.2 KB
Please
register
or
login
to post a comment