김현기

image파일 추가

node_modules/
package.json
\ No newline at end of file
package-lock.json
\ No newline at end of file
......
......@@ -13,9 +13,9 @@ var bucketName = "kindofyourdogimage";
// s3 버킷의 엔드 포인트
var bucketRegion = 'ap-northeast-2';
// access key
var accessId= 'your_accessId';
var accessId= 'your_Id';
// access secret key
var secretKey = 'yout_secretKey';
var secretKey = 'your_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);
......
{
"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"
}
<!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>
......
<!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>
<h2>이 개의 종류는</h2>
<h3><%=dogKind%></h3>
<h3>이 개의 종류는</h3>
<h2><%=dogKind%></h2>
</div>
</body>
</html>
......