This repository was archived by the owner on Dec 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Added aws Rekognition #70
Open
Programmerryoki
wants to merge
46
commits into
master
Choose a base branch
from
aws_rekognition
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
01d5716
Merge pull request #1 from jerrylee17/jerry
jerrylee17 c78083c
Added Directories + Update README
evanugarte 704057f
Merge pull request #2 from jerrylee17/evan
jerrylee17 dab91f1
Jerry (#3)
jerrylee17 3aaa0dc
Added proto field for encoded and modified printme to take raw data (#4)
jerrylee17 76428d0
Modified README (#5)
jerrylee17 9182f2f
Added Auto Generated Code to JS Client (#6)
evanugarte 54a9f93
Moved Print Client and Server to Unique Directory (#8)
evanugarte 993268f
Added LED Sign RPC (#9)
evanugarte 415ed97
made print_client callable (#10)
jerrylee17 2cd2391
Added setup, requirements, package (#11)
jerrylee17 d5b99f5
Split Led Sign Client into Functions (#12)
evanugarte 488c154
Added Promises to LED Sign API (#13)
evanugarte c3996bc
Added IP Address Parameter to Sign Client (#15)
evanugarte e27e651
Added Function to Determine Print Job (#16)
evanugarte c36baf6
Add Setup .bat File (#18)
evanugarte 8e6b735
Fixed Printer For Loop Issue (#19)
evanugarte e6d19f3
Updated Instructions for Code Generation (#20)
evanugarte 68e4805
3D printing RPC with decoder/encoer file (#22)
law-nguyen acccf5a
saving rpcs (#24)
hsorathia 88f2f5b
Printing Client returns promise (#26)
jerrylee17 cfb088e
Added default values for initial response (#30)
hsorathia 4fc3e6e
reverting changes in #30 (#31)
hsorathia 0c82bd0
updated README (#27)
jerrylee17 af34c27
Rename 3d Printing Protocol Buffers (#36)
evanugarte 9863302
Make Servers Listen on Different Ports (#38)
evanugarte 0a9b407
Correctly Format package.json (#41)
evanugarte 6d5e7f9
add eslint styling. Resolves #42 (#45)
law-nguyen 7dfd080
add eslint styling. Resolves #42 (#46)
law-nguyen 99c0267
Add RPC Client API (#44)
evanugarte 162f647
AddMessageToQueue and ClearMessageQueue (#47)
nanarboursal eef2acc
Add Slash to Path to Prevent Server Crashing (#48)
evanugarte 04d505f
Add 2D Printer HealthCheck RPC (#52)
Annabel1054 a404723
Refactored API tests wth SceRpcTester (#58)
law-nguyen 3f201d5
server returns which printer was used instead of printed (#61)
1234momo 9a5cd0a
Bump lodash from 4.17.15 to 4.17.19 (#57)
dependabot[bot] 8da34cf
Update setup.sh (#62)
6kerokerotm9 7b5f48d
Update setup.sh (#63)
6kerokerotm9 ed5faad
changed pylint to flake8 (#64)
6kerokerotm9 e4456de
Make destination optional in sendPrintRequest (#67)
jerrylee17 813f349
Printer Health Check RPC (routes and tests) (#56)
Annabel1054 3cdc0ad
Merge branch 'master' of https://github.com/SCE-Development/SCE-RPC i…
Programmerryoki dfcf25c
Added aws Rekognition
Programmerryoki 944186b
Added config files and made changes to server file
Programmerryoki 2aebc4c
Changing to have message
Programmerryoki 59882df
Changed rpc to return width and height of the image
Programmerryoki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,3 +3,4 @@ __pycache__/ | |
| modules/ | ||
| node_modules | ||
| config.js | ||
| config.json | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| const express = require('express'); | ||
| const router = express.Router(); | ||
| const { detectFace } = require('../aws_rekognition/aws_rekognition_client'); | ||
| const { OK, BAD_REQUEST, NOT_FOUND } = require('../config/config'); | ||
| const { addSignLog } = require('../util/logging-helpers'); | ||
|
|
||
| router.post('/AWS_rekognition', (req, res) => { | ||
| const { base64bytes } = req.body; | ||
| // const base64bytes = getBase64Image(faceImage); | ||
| // detectFace(faceImage) | ||
| detectFace(base64bytes) | ||
| .then((response) => { | ||
| return res.status(OK).send({ ...response }); | ||
| }) | ||
| .catch((error) => { | ||
| return res.status(BAD_REQUEST).send({ ...error }); | ||
| }); | ||
| }); | ||
|
|
||
| // function getBase64Image(img) { | ||
| // let canvas = document.createElement('canvas'); | ||
| // canvas.width = img.width; | ||
| // canvas.height = img.height; | ||
| // let ctx = canvas.getContext('2d'); | ||
| // ctx.drawImage(img, 0, 0); | ||
|
|
||
| // let dataURL = canvas.toDataURL('image/png'); | ||
|
|
||
| // return dataURL.replace(/^data:image\/(png|jpg);base64,/, ''); | ||
| // } | ||
|
|
||
| module.exports = router; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| const grpc = require('grpc'); | ||
| const messages = require('./aws_rekognition_pb'); | ||
| const services = require('./aws_rekognition_grpc_pb'); | ||
|
|
||
| function detectFace(faceImageBytes) { | ||
| const client = new services.FaceImageClient( | ||
| 'localhost:50051', | ||
| grpc.credentials.createInsecure() | ||
| ); | ||
|
|
||
| const faceCoordinateRequest = new messages.FaceCoordinateRequest(); | ||
| faceCoordinateRequest.setFaceimage(faceImageBytes); | ||
| return new Promise((resolve, reject) => { | ||
| client.requestFaceCoordinate(faceCoordinateRequest, (err, response) => { | ||
| if (err || !response) { | ||
| reject({ message: err, error: true }); | ||
| } else { | ||
| resolve({ message: response, error: false }); | ||
| } | ||
| }); | ||
| }); | ||
| } | ||
|
|
||
| module.exports = { detectFace }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| // GENERATED CODE -- DO NOT EDIT! | ||
|
|
||
| 'use strict'; | ||
| var grpc = require('grpc'); | ||
| var aws_rekognition_pb = require('./aws_rekognition_pb.js'); | ||
|
|
||
| function serialize_FaceCoordinateRequest(arg) { | ||
| if (!(arg instanceof aws_rekognition_pb.FaceCoordinateRequest)) { | ||
| throw new Error('Expected argument of type FaceCoordinateRequest'); | ||
| } | ||
| return Buffer.from(arg.serializeBinary()); | ||
| } | ||
|
|
||
| function deserialize_FaceCoordinateRequest(buffer_arg) { | ||
| return aws_rekognition_pb.FaceCoordinateRequest.deserializeBinary(new Uint8Array(buffer_arg)); | ||
| } | ||
|
|
||
| function serialize_FaceCoordinateResponse(arg) { | ||
| if (!(arg instanceof aws_rekognition_pb.FaceCoordinateResponse)) { | ||
| throw new Error('Expected argument of type FaceCoordinateResponse'); | ||
| } | ||
| return Buffer.from(arg.serializeBinary()); | ||
| } | ||
|
|
||
| function deserialize_FaceCoordinateResponse(buffer_arg) { | ||
| return aws_rekognition_pb.FaceCoordinateResponse.deserializeBinary(new Uint8Array(buffer_arg)); | ||
| } | ||
|
|
||
|
|
||
| var FaceImageService = exports.FaceImageService = { | ||
| requestFaceCoordinate: { | ||
| path: '/FaceImage/RequestFaceCoordinate', | ||
| requestStream: false, | ||
| responseStream: false, | ||
| requestType: aws_rekognition_pb.FaceCoordinateRequest, | ||
| responseType: aws_rekognition_pb.FaceCoordinateResponse, | ||
| requestSerialize: serialize_FaceCoordinateRequest, | ||
| requestDeserialize: deserialize_FaceCoordinateRequest, | ||
| responseSerialize: serialize_FaceCoordinateResponse, | ||
| responseDeserialize: deserialize_FaceCoordinateResponse, | ||
| }, | ||
| }; | ||
|
|
||
| exports.FaceImageClient = grpc.makeGenericClientConstructor(FaceImageService); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sure to remove these :)