Skip to content

Instantly share code, notes, and snippets.

@SalvoCozzubo
Last active July 10, 2022 12:14
Show Gist options
  • Save SalvoCozzubo/5d3732efe6b16d73278426cbee88bdc8 to your computer and use it in GitHub Desktop.
Save SalvoCozzubo/5d3732efe6b16d73278426cbee88bdc8 to your computer and use it in GitHub Desktop.
Detect Labels with AWS Rekognition
const { RekognitionClient, DetectLabelsCommand } = require('@aws-sdk/client-rekognition');
const client = new RekognitionClient({});
const getLabels = async (picture) => {
const params = {
Image: {
Bytes: picture,
},
MaxLabels: 20,
MinConfidence: 75,
};
const response = await client.send(new DetectLabelsCommand(params));
return response.Labels;
};
module.exports = { getLabels };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment