Showing
6 changed files
with
41 additions
and
15 deletions
| ... | @@ -13,9 +13,9 @@ var bucketName = "kindofyourdogimage"; | ... | @@ -13,9 +13,9 @@ var bucketName = "kindofyourdogimage"; |
| 13 | // s3 버킷의 엔드 포인트 | 13 | // s3 버킷의 엔드 포인트 |
| 14 | var bucketRegion = 'ap-northeast-2'; | 14 | var bucketRegion = 'ap-northeast-2'; |
| 15 | // access key | 15 | // access key |
| 16 | -var accessId= 'your_accessId'; | 16 | +var accessId= 'your_Id'; |
| 17 | // access secret key | 17 | // access secret key |
| 18 | -var secretKey = 'yout_secretKey'; | 18 | +var secretKey = 'your_secretId'; |
| 19 | // AWS Cognito 인증 | 19 | // AWS Cognito 인증 |
| 20 | AWS.config.update({ | 20 | AWS.config.update({ |
| 21 | region:bucketRegion, | 21 | region:bucketRegion, |
| ... | @@ -35,7 +35,7 @@ app.use(logger('dev')); | ... | @@ -35,7 +35,7 @@ app.use(logger('dev')); |
| 35 | app.use(express.json()); | 35 | app.use(express.json()); |
| 36 | app.use(express.urlencoded({ extended: false })); | 36 | app.use(express.urlencoded({ extended: false })); |
| 37 | app.use(cookieParser()); | 37 | app.use(cookieParser()); |
| 38 | -app.use(express.static(path.join(__dirname, 'public'))); | 38 | +app.use(express.static(__dirname)); |
| 39 | 39 | ||
| 40 | 40 | ||
| 41 | // image 올리는 화면 | 41 | // image 올리는 화면 |
| ... | @@ -88,15 +88,13 @@ app.post('/upload_receiver', function(req,res){ | ... | @@ -88,15 +88,13 @@ app.post('/upload_receiver', function(req,res){ |
| 88 | client.detectLabels(params, function(err, response) { | 88 | client.detectLabels(params, function(err, response) { |
| 89 | console.log(params); | 89 | console.log(params); |
| 90 | response.Labels.some(label => { | 90 | response.Labels.some(label => { |
| 91 | + // 강아지 종류 추출 작업 | ||
| 91 | if(label.Parents.length > 4 && label.Name != 'Puppy') { | 92 | if(label.Parents.length > 4 && label.Name != 'Puppy') { |
| 92 | - console.log(label.Name); | ||
| 93 | dogKind = label.Name; | 93 | dogKind = label.Name; |
| 94 | - console.log(dogKind); | ||
| 95 | res.render('kind',{dogKind:dogKind}); | 94 | res.render('kind',{dogKind:dogKind}); |
| 96 | return true; | 95 | return true; |
| 97 | } | 96 | } |
| 98 | }); | 97 | }); |
| 99 | - | ||
| 100 | }); | 98 | }); |
| 101 | result = `<img src="${data.Location}>`; | 99 | result = `<img src="${data.Location}>`; |
| 102 | console.log(result); | 100 | console.log(result); | ... | ... |
package.json
0 → 100644
| 1 | +{ | ||
| 2 | + "name": "oss-project", | ||
| 3 | + "version": "1.0.0", | ||
| 4 | + "description": "AWS Rekognition을 이용한 강아지 종류 분석입니다.", | ||
| 5 | + "main": "app.js", | ||
| 6 | + "dependencies": { | ||
| 7 | + "aws-sdk": "^2.703.0", | ||
| 8 | + "cookie-parser": "^1.4.5", | ||
| 9 | + "ejs": "^3.1.3", | ||
| 10 | + "express": "^4.17.1", | ||
| 11 | + "formidable": "^1.2.2", | ||
| 12 | + "image-to-base64": "^2.1.0", | ||
| 13 | + "mocha-jsdom": "^2.0.0", | ||
| 14 | + "morgan": "^1.10.0", | ||
| 15 | + "multer": "^1.4.2", | ||
| 16 | + "nodemon": "^2.0.4" | ||
| 17 | + }, | ||
| 18 | + "devDependencies": {}, | ||
| 19 | + "scripts": { | ||
| 20 | + "test": "echo \"Error: no test specified\" && exit 1", | ||
| 21 | + "start" : "node bin/www" | ||
| 22 | + }, | ||
| 23 | + "repository": { | ||
| 24 | + "type": "git", | ||
| 25 | + "url": "ssh://git@khuhub.khu.ac.kr:12959/2016101156/OSS-Project.git" | ||
| 26 | + }, | ||
| 27 | + "author": "", | ||
| 28 | + "license": "Apache License 2.0" | ||
| 29 | +} |
| 1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
| 2 | <html> | 2 | <html> |
| 3 | <head> | 3 | <head> |
| 4 | - <title>KindOfYourDog</title> | ||
| 5 | <meta charset="utf-8" /> | 4 | <meta charset="utf-8" /> |
| 6 | - <link rel="stylesheet" href="stylesheets/style.css"> | 5 | + <link rel="stylesheet" href="public/stylesheets/style.css"> |
| 6 | + <title>KindOfYourDog</title> | ||
| 7 | </head> | 7 | </head> |
| 8 | <body> | 8 | <body> |
| 9 | <h1>Kind of Your Dog</h1> | 9 | <h1>Kind of Your Dog</h1> |
| 10 | <div> | 10 | <div> |
| 11 | <img src = "puppy.jpg"> | 11 | <img src = "puppy.jpg"> |
| 12 | - | ||
| 13 | </div> | 12 | </div> |
| 14 | <div> | 13 | <div> |
| 15 | <form enctype="multipart/form-data" method="post" action="upload_receiver"> | 14 | <form enctype="multipart/form-data" method="post" action="upload_receiver"> |
| ... | @@ -18,7 +17,7 @@ | ... | @@ -18,7 +17,7 @@ |
| 18 | </form> | 17 | </form> |
| 19 | </div> | 18 | </div> |
| 20 | <div> | 19 | <div> |
| 21 | - <h2>이 개의 종류는</h2> | 20 | + <h2>종류를 알고 싶은 개의 사진을 올리세요</h2> |
| 22 | </div> | 21 | </div> |
| 23 | </body> | 22 | </body> |
| 24 | </html> | 23 | </html> | ... | ... |
| 1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
| 2 | <html> | 2 | <html> |
| 3 | <head> | 3 | <head> |
| 4 | - <title>KindOfYourDog</title> | ||
| 5 | <meta charset="utf-8" /> | 4 | <meta charset="utf-8" /> |
| 6 | - <link rel="stylesheet" href="stylesheets/style.css"> | 5 | + <link rel="stylesheet" href="public/stylesheets/style.css"> |
| 6 | + <title>KindOfYourDog</title> | ||
| 7 | </head> | 7 | </head> |
| 8 | <body> | 8 | <body> |
| 9 | <h1>Kind of Your Dog</h1> | 9 | <h1>Kind of Your Dog</h1> |
| ... | @@ -14,8 +14,8 @@ | ... | @@ -14,8 +14,8 @@ |
| 14 | </form> | 14 | </form> |
| 15 | </div> | 15 | </div> |
| 16 | <div> | 16 | <div> |
| 17 | - <h2>이 개의 종류는</h2> | 17 | + <h3>이 개의 종류는</h3> |
| 18 | - <h3><%=dogKind%></h3> | 18 | + <h2><%=dogKind%></h2> |
| 19 | </div> | 19 | </div> |
| 20 | </body> | 20 | </body> |
| 21 | </html> | 21 | </html> | ... | ... |
views/optimize.jpg
0 → 100644
85.2 KB
-
Please register or login to post a comment