| 1 | import type * as rekognition from "@distilled.cloud/aws/rekognition"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `rekognition:CompareFaces` — compare the largest face in a source image against faces in a target image and return match confidence. |
| 7 | * |
| 8 | * The binding takes no arguments and grants the function |
| 9 | * `rekognition:CompareFaces` on `*` (Rekognition data-plane resources such |
| 10 | * as collections, users, and jobs are routinely created at runtime, so |
| 11 | * their identifiers are unknown at deploy time). Provide the |
| 12 | * implementation with `Effect.provide(AWS.Rekognition.CompareFacesHttp)`. |
| 13 | * |
| 14 | * ### Image Analysis |
| 15 | * **Example:** Compare Two Face Images |
| 16 | * ```typescript |
| 17 | * // init |
| 18 | * const compareFaces = yield* AWS.Rekognition.CompareFaces(); |
| 19 | * |
| 20 | * // runtime |
| 21 | * const result = yield* compareFaces({ |
| 22 | * SourceImage: { S3Object: { Bucket: "photos", Name: "id-card.jpg" } }, |
| 23 | * TargetImage: { S3Object: { Bucket: "photos", Name: "selfie.jpg" } }, |
| 24 | * SimilarityThreshold: 90, |
| 25 | * }); |
| 26 | * const matches = result.FaceMatches ?? []; |
| 27 | * ``` |
| 28 | * |
| 29 | * @binding |
| 30 | */ |
| 31 | export interface CompareFaces extends Binding.Service< |
| 32 | CompareFaces, |
| 33 | "AWS.Rekognition.CompareFaces", |
| 34 | () => Effect.Effect< |
| 35 | ( |
| 36 | request: rekognition.CompareFacesRequest, |
| 37 | ) => Effect.Effect< |
| 38 | rekognition.CompareFacesResponse, |
| 39 | rekognition.CompareFacesError |
| 40 | > |
| 41 | > |
| 42 | > {} |
| 43 | export const CompareFaces = Binding.Service<CompareFaces>( |
| 44 | "AWS.Rekognition.CompareFaces", |
| 45 | ); |