Last active
July 10, 2022 12:14
-
-
Save SalvoCozzubo/5d3732efe6b16d73278426cbee88bdc8 to your computer and use it in GitHub Desktop.
Detect Labels with AWS Rekognition
This file contains 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
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