{"id":23651332,"url":"https://github.com/damiancipolat/nodejs-aws-gesture-recognition","last_synced_at":"2026-04-13T01:38:16.867Z","repository":{"id":46063623,"uuid":"209456986","full_name":"damiancipolat/Nodejs-AWS-gesture-recognition","owner":"damiancipolat","description":"Experiment in nodejs to recognize gestures of people in selfie photos","archived":false,"fork":false,"pushed_at":"2023-01-07T09:57:55.000Z","size":1146,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-20T01:13:31.446Z","etag":null,"topics":["aws","cloud-vision-api","face-recognition","id","nodejs","rekognition"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/damiancipolat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-19T03:44:13.000Z","updated_at":"2019-11-05T23:31:50.000Z","dependencies_parsed_at":"2023-02-06T20:46:33.268Z","dependency_job_id":null,"html_url":"https://github.com/damiancipolat/Nodejs-AWS-gesture-recognition","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/damiancipolat/Nodejs-AWS-gesture-recognition","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damiancipolat%2FNodejs-AWS-gesture-recognition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damiancipolat%2FNodejs-AWS-gesture-recognition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damiancipolat%2FNodejs-AWS-gesture-recognition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damiancipolat%2FNodejs-AWS-gesture-recognition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/damiancipolat","download_url":"https://codeload.github.com/damiancipolat/Nodejs-AWS-gesture-recognition/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damiancipolat%2FNodejs-AWS-gesture-recognition/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31736723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-12T22:19:12.206Z","status":"ssl_error","status_checked_at":"2026-04-12T22:18:33.088Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","cloud-vision-api","face-recognition","id","nodejs","rekognition"],"created_at":"2024-12-28T16:37:08.243Z","updated_at":"2026-04-13T01:38:16.842Z","avatar_url":"https://github.com/damiancipolat.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Use Node.js with AWS rekognition to detect gestures in photos.\n\nIn this example I show how to create an api rest state-less using nodejs + express with an integration with AWS REKOGNITION.\n\n\u003cimg src=\"https://github.com/damiancipolat/Nodejs-AWS-gesture-recognition/blob/master/resources/meme.jpeg?raw=true\" width=\"300px\" align=\"right\" /\u003e\n\n### Face Analysis:\nI use AWS rekognition api to detect gestures and if the photo is from a human. You can read more info in this links https://docs.aws.amazon.com/es_es/rekognition/latest/dg/what-is.html.\n\nAws api response example:\n\n```javascript\n{\n    \"FaceDetails\": [\n        {\n            \"BoundingBox\": {\n                \"Width\": 0.20394515991210938,\n                \"Height\": 0.4204871356487274,\n                \"Left\": 0.1556132435798645,\n                \"Top\": 0.11629478633403778\n            },\n            \"AgeRange\": {\n                \"Low\": 17,\n                \"High\": 29\n            },\n            \"Smile\": {\n                \"Value\": true,\n                \"Confidence\": 91.7283706665039\n            },\n            \"Eyeglasses\": {\n                \"Value\": true,\n                \"Confidence\": 99.88982391357422\n            },\n            \"Sunglasses\": {\n                \"Value\": true,\n                \"Confidence\": 92.23440551757812\n            },\n            \"Gender\": {\n                \"Value\": \"Female\",\n                \"Confidence\": 99.97311401367188\n            },\n            \"Beard\": {\n                \"Value\": false,\n                \"Confidence\": 99.83840942382812\n            },\n            \"Mustache\": {\n                \"Value\": false,\n                \"Confidence\": 99.95821380615234\n            },\n            \"EyesOpen\": {\n                \"Value\": true,\n                \"Confidence\": 99.99461364746094\n            },\n            \"MouthOpen\": {\n                \"Value\": true,\n                \"Confidence\": 99.51335906982422\n            },\n            \"Emotions\": [\n                {\n                    \"Type\": \"CALM\",\n                    \"Confidence\": 0.1430344581604004\n                },\n                {\n                    \"Type\": \"CONFUSED\",\n                    \"Confidence\": 0.11641046404838562\n                },\n                {\n                    \"Type\": \"SURPRISED\",\n                    \"Confidence\": 0.1008024662733078\n                },\n                {\n                    \"Type\": \"DISGUSTED\",\n                    \"Confidence\": 0.018225016072392464\n                },\n                {\n                    \"Type\": \"SAD\",\n                    \"Confidence\": 0.003681173315271735\n                },\n                {\n                    \"Type\": \"FEAR\",\n                    \"Confidence\": 0.004482289310544729\n                },\n                {\n                    \"Type\": \"HAPPY\",\n                    \"Confidence\": 99.58031463623047\n                },\n                {\n                    \"Type\": \"ANGRY\",\n                    \"Confidence\": 0.03304917365312576\n                }\n            ],\n            \"Landmarks\": [\n                {\n                    \"Type\": \"eyeLeft\",\n                    \"X\": 0.23311273753643036,\n                    \"Y\": 0.28700149059295654\n                },\n                {\n                    \"Type\": \"eyeRight\",\n                    \"X\": 0.32564252614974976,\n                    \"Y\": 0.27746525406837463\n                },\n                {\n                    \"Type\": \"mouthLeft\",\n                    \"X\": 0.24938040971755981,\n                    \"Y\": 0.4339939057826996\n                },\n                {\n                    \"Type\": \"mouthRight\",\n                    \"X\": 0.3259195387363434,\n                    \"Y\": 0.42571786046028137\n                },\n                {\n                    \"Type\": \"nose\",\n                    \"X\": 0.2994106709957123,\n                    \"Y\": 0.3559057116508484\n                },\n                {\n                    \"Type\": \"leftEyeBrowLeft\",\n                    \"X\": 0.1898277848958969,\n                    \"Y\": 0.258786678314209\n                },\n                {\n                    \"Type\": \"leftEyeBrowRight\",\n                    \"X\": 0.25588130950927734,\n                    \"Y\": 0.23913364112377167\n                },\n                {\n                    \"Type\": \"leftEyeBrowUp\",\n                    \"X\": 0.22465303540229797,\n                    \"Y\": 0.2357855588197708\n                },\n                {\n                    \"Type\": \"rightEyeBrowLeft\",\n                    \"X\": 0.3103598654270172,\n                    \"Y\": 0.23413047194480896\n                },\n                {\n                    \"Type\": \"rightEyeBrowRight\",\n                    \"X\": 0.3547131419181824,\n                    \"Y\": 0.2416505664587021\n                },\n                {\n                    \"Type\": \"rightEyeBrowUp\",\n                    \"X\": 0.3345111012458801,\n                    \"Y\": 0.22470000386238098\n                },\n                {\n                    \"Type\": \"leftEyeLeft\",\n                    \"X\": 0.21419213712215424,\n                    \"Y\": 0.28888216614723206\n                },\n                {\n                    \"Type\": \"leftEyeRight\",\n                    \"X\": 0.25064346194267273,\n                    \"Y\": 0.2863885760307312\n                },\n                {\n                    \"Type\": \"leftEyeUp\",\n                    \"X\": 0.23293153941631317,\n                    \"Y\": 0.2798457145690918\n                },\n                {\n                    \"Type\": \"leftEyeDown\",\n                    \"X\": 0.23377712070941925,\n                    \"Y\": 0.2934091091156006\n                },\n                {\n                    \"Type\": \"rightEyeLeft\",\n                    \"X\": 0.305652916431427,\n                    \"Y\": 0.28061890602111816\n                },\n                {\n                    \"Type\": \"rightEyeRight\",\n                    \"X\": 0.33733639121055603,\n                    \"Y\": 0.27545079588890076\n                },\n                {\n                    \"Type\": \"rightEyeUp\",\n                    \"X\": 0.32426485419273376,\n                    \"Y\": 0.2699545621871948\n                },\n                {\n                    \"Type\": \"rightEyeDown\",\n                    \"X\": 0.3238048255443573,\n                    \"Y\": 0.28349214792251587\n                },\n                {\n                    \"Type\": \"noseLeft\",\n                    \"X\": 0.2737899422645569,\n                    \"Y\": 0.377468079328537\n                },\n                {\n                    \"Type\": \"noseRight\",\n                    \"X\": 0.3063475489616394,\n                    \"Y\": 0.3736012876033783\n                },\n                {\n                    \"Type\": \"mouthUp\",\n                    \"X\": 0.2932463586330414,\n                    \"Y\": 0.41005250811576843\n                },\n                {\n                    \"Type\": \"mouthDown\",\n                    \"X\": 0.29297494888305664,\n                    \"Y\": 0.4546877443790436\n                },\n                {\n                    \"Type\": \"leftPupil\",\n                    \"X\": 0.23311273753643036,\n                    \"Y\": 0.28700149059295654\n                },\n                {\n                    \"Type\": \"rightPupil\",\n                    \"X\": 0.32564252614974976,\n                    \"Y\": 0.27746525406837463\n                },\n                {\n                    \"Type\": \"upperJawlineLeft\",\n                    \"X\": 0.14420086145401,\n                    \"Y\": 0.304552286863327\n                },\n                {\n                    \"Type\": \"midJawlineLeft\",\n                    \"X\": 0.17792876064777374,\n                    \"Y\": 0.46004292368888855\n                },\n                {\n                    \"Type\": \"chinBottom\",\n                    \"X\": 0.28907808661460876,\n                    \"Y\": 0.5331214666366577\n                },\n                {\n                    \"Type\": \"midJawlineRight\",\n                    \"X\": 0.34408921003341675,\n                    \"Y\": 0.44162437319755554\n                },\n                {\n                    \"Type\": \"upperJawlineRight\",\n                    \"X\": 0.35112330317497253,\n                    \"Y\": 0.28181537985801697\n                }\n            ],\n            \"Pose\": {\n                \"Roll\": -3.4967963695526123,\n                \"Yaw\": 4.581802845001221,\n                \"Pitch\": 21.05695152282715\n            },\n            \"Quality\": {\n                \"Brightness\": 69.75423431396484,\n                \"Sharpness\": 95.51618957519531\n            },\n            \"Confidence\": 99.99998474121094\n        }\n    ]\n}\n```\n\n#### Configuration\nGo to /config/default.json file and set the configuration values.\n\n- Set server ports.\n- Aws credentials.\n\n### Gesture Recognition in photos\nGo to ./services/face-expression-functions.js in this filre there are bunch of js functions that using the aws response detect a custom gesture.\n\nIn this project there are 3 endpoint to gesture analysis.\n- POST / http://127.0.0.1:3000/gestures/eyes-open\n- POST / http://127.0.0.1:3000/gestures/eyes-closed\n- POST / http://127.0.0.1:3000/gestures/smiling\n- POST / http://127.0.0.1:3000/gestures/complete\n\nSend in the body request form-data: the field \"picture\" as a FILE type.\n\n**POST - complete**\n\nUse this request to detect all the gestures in the same request.\n\n#### Api response\n```javascript\n{\n    \"gestures\": [\n        {\n            \"name\": \"likeAface\",\n            \"match\": true\n        },\n        {\n            \"name\": \"isSmiling\",\n            \"match\": true\n        },\n        {\n            \"name\": \"isHappy\",\n            \"match\": true\n        }\n    ],\n    \"match\": true\n}\n```\n\n### How to use\nFollow this steps.\n\n1) Set configuration values.\n2) Run the server with the command **npm start**.\n3) Make a post request, import api-gestures.postman_collection to test the api using postman.\n4) There are some picture of me :p in ./respurces folder\n5) In other console run the webserver cmd /web and run **npm start** and open a browser in http://127.0.0.1:5000\n6) Have fun.\n\n#### Commands:\n```sh\n#In one console run\nnpm start\n\n#In other console run:\ncmd /web\nnpm start\n```\n\n### INTERACTIVE WEB\nOpen a browser in http://127.0.0.1:5000, follow the instructrion. The orange box is the current gesture to make, if fail a error beep will sound. When the recognition is sucedd a short beep wil be reproduced.\n\n\u003cimg src=\"https://github.com/damiancipolat/Nodejs-AWS-gesture-recognition/blob/master/resources/web.png?raw=true\"  align=\"center\" /\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdamiancipolat%2Fnodejs-aws-gesture-recognition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdamiancipolat%2Fnodejs-aws-gesture-recognition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdamiancipolat%2Fnodejs-aws-gesture-recognition/lists"}