rekognition-node
This is a fork of node-rekognition by oleurud
Use this if you need to ability to send AWS image bytes
Installation
npm install rekognition-node
Use
Instantiation
const Rekognition = require('rekognition-node');
const AWSParameters = {
accessKeyId: 'XXX',
secretAccessKey: 'XXX',
region: 'XXX',
bucket: 'XXX',
ACL: 'XXX'
};
const rekognition = new Rekognition(AWSParameters);
The ACL is optional and its possible values are: "private", "public-read", "public-read-write", "authenticated-read", "aws-exec-read", "bucket-owner-read", "bucket-owner-full-control" More info
Upload images to S3
Some methods from AWS Rekognition need one or more images uploaded to AWS S3 bucket
const s3Images = await rekognition.uploadToS3(imagePaths, folder)
detectLabels
const imageLabels = await rekognition.detectLabels(image)
detectFaces
const imageFaces = await rekognition.detectFaces(image)
compareFaces
const faceMatches = await rekognition.compareFaces(sourceImage, targetImage, threshold)
detectModerationLabels
const moderationLabels = await rekognition.detectModerationLabels(image, threshold)
createCollection
const collection = await rekognition.createCollection(collectionId)
deleteCollection
const collection = await rekognition.deleteCollection(collectionId)
indexFaces
const facesIndexed = await rekognition.indexFaces(collectionId, s3Image)
listFaces
const faces = await rekognition.listFaces(collectionId)
searchFaces
const faceMatches = await rekognition.searchFacesByFaceId(collectionId, faceId, threshold)
searchFacesByImage
const faceMatches = await rekognition.searchFacesByImage(collectionId, s3Image, threshold)
Test
First of all, you must create a parameters.json file and set your AWS parameters. You have an example file parametrs.json.example
- cp parameters.json.example parameters.json
- vim parameters.json
Then:
Changelog
Releases are documented in the NEWS file
Requirements
node >= 7.10.0
Contributing
You are welcome contribute via pull requests.
More info about AWS Rekognition
http://docs.aws.amazon.com/rekognition/latest/dg/API_Operations.html
http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Rekognition.html