Skip to content

DetectModerationLabels

Source: src/AWS/Rekognition/DetectModerationLabels.ts

Runtime binding for rekognition:DetectModerationLabels — detect unsafe or inappropriate content (explicit nudity, violence, etc.) in an image for content moderation.

The binding takes no arguments and grants the function rekognition:DetectModerationLabels on * (Rekognition data-plane resources such as collections, users, and jobs are routinely created at runtime, so their identifiers are unknown at deploy time). Provide the implementation with Effect.provide(AWS.Rekognition.DetectModerationLabelsHttp).

// init
const detectModerationLabels = yield* AWS.Rekognition.DetectModerationLabels();
// runtime
const result = yield* detectModerationLabels({
Image: { Bytes: imageBytes },
MinConfidence: 60,
});
const flagged = (result.ModerationLabels ?? []).length > 0;