Skip to content

Instantly share code, notes, and snippets.

@juandc
Forked from wagyu298/detectmotionurl.js
Created August 14, 2018 15:40
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juandc/a8eabf17e4ca197fa1fcc6e8c42b85b1 to your computer and use it in GitHub Desktop.
Save juandc/a8eabf17e4ca197fa1fcc6e8c42b85b1 to your computer and use it in GitHub Desktop.
AWS Rekognition detectModerationLabels example for Node.js
#!/usr/bin/env node
const request = require('request');
const AWS = require('aws-sdk');
const rekognition = new AWS.Rekognition({
// Detect moderation labels is available on AWS region us-east-1, us-west-2 and eu-west-1
region: "us-west-2",
accessKeyId: "YOUR accessKeyId",
secretAccessKey: "YOUR secretAccessKey"
});
const url = process.argv[2];
request({
method: "GET",
url: url,
encoding: null
}, (err, response, body) => {
if (err) {
console.error(err);
process.exit(1);
}
rekognition.detectModerationLabels({
Image: {
Bytes: body,
},
MinConfidence: 0.0
}, (err, data) => {
if (err) {
console.log(err);
process.exit(1);
}
console.log(data);
process.exit(0);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment