Skip to content

SearchFacesByImage

Source: src/AWS/Rekognition/SearchFacesByImage.ts

Runtime binding for rekognition:SearchFacesByImage — search a face collection for faces matching the largest face in a supplied image.

The binding takes no arguments and grants the function rekognition:SearchFacesByImage 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.SearchFacesByImageHttp).

// init
const searchFacesByImage = yield* AWS.Rekognition.SearchFacesByImage();
// runtime
const result = yield* searchFacesByImage({
CollectionId: "tenant-42",
Image: { Bytes: imageBytes },
FaceMatchThreshold: 95,
});
const bestMatch = result.FaceMatches?.[0]?.Face?.ExternalImageId;