Skip to content

DetectLabels

Source: src/AWS/Rekognition/DetectLabels.ts

Runtime binding for rekognition:DetectLabels — detect real-world entities (objects, scenes, concepts) in a JPEG or PNG image.

Rekognition is a pure pay-per-call service with no resource to manage: the binding takes no arguments and grants the function rekognition:DetectLabels (the action has no resource-level IAM). Pass the image as raw bytes (Image.Bytes) or as an S3 object reference (Image.S3Object) — raw distilled types, no marshalling. Provide the implementation with Effect.provide(AWS.Rekognition.DetectLabelsHttp).

// init
const detectLabels = yield* AWS.Rekognition.DetectLabels();
// runtime
const result = yield* detectLabels({
Image: { Bytes: imageBytes },
MaxLabels: 10,
MinConfidence: 50,
});
const names = (result.Labels ?? []).map((label) => label.Name);