Skip to content

Commit 0ffd995

Browse files
author
awstools
committed
feat(client-rekognition): This release adds support for Face Liveness APIs in Amazon Rekognition. Updates UpdateStreamProcessor to return ResourceInUseException Exception. Minor updates to API documentation.
1 parent db95943 commit 0ffd995

21 files changed

+2319
-888
lines changed

clients/client-rekognition/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,14 @@ CreateDataset
560560

561561
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rekognition/classes/createdatasetcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rekognition/interfaces/createdatasetcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rekognition/interfaces/createdatasetcommandoutput.html)
562562

563+
</details>
564+
<details>
565+
<summary>
566+
CreateFaceLivenessSession
567+
</summary>
568+
569+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rekognition/classes/createfacelivenesssessioncommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rekognition/interfaces/createfacelivenesssessioncommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rekognition/interfaces/createfacelivenesssessioncommandoutput.html)
570+
563571
</details>
564572
<details>
565573
<summary>
@@ -768,6 +776,14 @@ GetFaceDetection
768776

769777
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rekognition/classes/getfacedetectioncommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rekognition/interfaces/getfacedetectioncommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rekognition/interfaces/getfacedetectioncommandoutput.html)
770778

779+
</details>
780+
<details>
781+
<summary>
782+
GetFaceLivenessSessionResults
783+
</summary>
784+
785+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rekognition/classes/getfacelivenesssessionresultscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rekognition/interfaces/getfacelivenesssessionresultscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-rekognition/interfaces/getfacelivenesssessionresultscommandoutput.html)
786+
771787
</details>
772788
<details>
773789
<summary>

clients/client-rekognition/src/Rekognition.ts

Lines changed: 111 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ import {
2121
CreateDatasetCommandInput,
2222
CreateDatasetCommandOutput,
2323
} from "./commands/CreateDatasetCommand";
24+
import {
25+
CreateFaceLivenessSessionCommand,
26+
CreateFaceLivenessSessionCommandInput,
27+
CreateFaceLivenessSessionCommandOutput,
28+
} from "./commands/CreateFaceLivenessSessionCommand";
2429
import {
2530
CreateProjectCommand,
2631
CreateProjectCommandInput,
@@ -139,6 +144,11 @@ import {
139144
GetFaceDetectionCommandInput,
140145
GetFaceDetectionCommandOutput,
141146
} from "./commands/GetFaceDetectionCommand";
147+
import {
148+
GetFaceLivenessSessionResultsCommand,
149+
GetFaceLivenessSessionResultsCommandInput,
150+
GetFaceLivenessSessionResultsCommandOutput,
151+
} from "./commands/GetFaceLivenessSessionResultsCommand";
142152
import {
143153
GetFaceSearchCommand,
144154
GetFaceSearchCommandInput,
@@ -719,6 +729,7 @@ export class Rekognition extends RekognitionClient {
719729
* <p>Copying a model version takes a while to complete. To get the current status, call <a>DescribeProjectVersions</a> and check the value of <code>Status</code> in the
720730
* <a>ProjectVersionDescription</a> object. The copy operation has finished when
721731
* the value of <code>Status</code> is <code>COPYING_COMPLETED</code>.</p>
732+
* <p>This operation requires permissions to perform the <code>rekognition:CopyProjectVersion</code> action.</p>
722733
*/
723734
public copyProjectVersion(
724735
args: CopyProjectVersionCommandInput,
@@ -847,6 +858,45 @@ export class Rekognition extends RekognitionClient {
847858
}
848859
}
849860

861+
/**
862+
* @public
863+
* <p>This API operation initiates a Face Liveness session. It returns a <code>SessionId</code>,
864+
* which you can use to start streaming Face Liveness video and get the results for a Face
865+
* Liveness session. You can use the <code>OutputConfig</code> option in the Settings parameter
866+
* to provide an Amazon S3 bucket location. The Amazon S3 bucket stores reference images and
867+
* audit images. You can use <code>AuditImagesLimit</code> to limit of audit images returned.
868+
* This number is between 0 and 4. By default, it is set to 0. The limit is best effort and based
869+
* on the duration of the selfie-video. </p>
870+
*/
871+
public createFaceLivenessSession(
872+
args: CreateFaceLivenessSessionCommandInput,
873+
options?: __HttpHandlerOptions
874+
): Promise<CreateFaceLivenessSessionCommandOutput>;
875+
public createFaceLivenessSession(
876+
args: CreateFaceLivenessSessionCommandInput,
877+
cb: (err: any, data?: CreateFaceLivenessSessionCommandOutput) => void
878+
): void;
879+
public createFaceLivenessSession(
880+
args: CreateFaceLivenessSessionCommandInput,
881+
options: __HttpHandlerOptions,
882+
cb: (err: any, data?: CreateFaceLivenessSessionCommandOutput) => void
883+
): void;
884+
public createFaceLivenessSession(
885+
args: CreateFaceLivenessSessionCommandInput,
886+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: CreateFaceLivenessSessionCommandOutput) => void),
887+
cb?: (err: any, data?: CreateFaceLivenessSessionCommandOutput) => void
888+
): Promise<CreateFaceLivenessSessionCommandOutput> | void {
889+
const command = new CreateFaceLivenessSessionCommand(args);
890+
if (typeof optionsOrCb === "function") {
891+
this.send(command, optionsOrCb);
892+
} else if (typeof cb === "function") {
893+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
894+
this.send(command, optionsOrCb || {}, cb);
895+
} else {
896+
return this.send(command, optionsOrCb);
897+
}
898+
}
899+
850900
/**
851901
* @public
852902
* <p>Creates a new Amazon Rekognition Custom Labels project. A project is a group of resources (datasets, model versions)
@@ -950,15 +1000,25 @@ export class Rekognition extends RekognitionClient {
9501000
* <p>Amazon Rekognition Video is a consumer of live video from Amazon Kinesis Video Streams. There are two different settings for stream processors in Amazon Rekognition: detecting faces and detecting labels.</p>
9511001
* <ul>
9521002
* <li>
953-
* <p>If you are creating a stream processor for detecting faces, you provide as input a Kinesis video stream (<code>Input</code>) and a Kinesis data stream (<code>Output</code>) stream. You also specify the
954-
* face recognition criteria in <code>Settings</code>. For example, the collection containing faces that you want to recognize. After you have finished analyzing a streaming video, use <a>StopStreamProcessor</a> to
955-
* stop processing.</p>
1003+
* <p>If you are creating a stream processor for detecting faces, you provide as input a Kinesis video stream
1004+
* (<code>Input</code>) and a Kinesis data stream (<code>Output</code>) stream for receiving
1005+
* the output. You must use the <code>FaceSearch</code> option in
1006+
* <code>Settings</code>, specifying the collection that contains the faces you
1007+
* want to recognize. After you have finished analyzing a streaming video, use
1008+
* <a>StopStreamProcessor</a> to stop processing.</p>
9561009
* </li>
9571010
* <li>
958-
* <p>If you are creating a stream processor to detect labels, you provide as input a Kinesis video stream (<code>Input</code>), Amazon S3 bucket information (<code>Output</code>), and an
959-
* Amazon SNS topic ARN (<code>NotificationChannel</code>). You can also provide a KMS key ID to encrypt the data sent to your Amazon S3 bucket.
960-
* You specify what you want to detect in <code>ConnectedHomeSettings</code>, such as people, packages and people, or pets, people, and packages. You can also specify where in the frame you want Amazon Rekognition to monitor with <code>RegionsOfInterest</code>.
961-
* When you run the <a>StartStreamProcessor</a> operation on a label detection stream processor, you input start and stop information to determine the length of the processing time.</p>
1011+
* <p>If you are creating a stream processor to detect labels, you provide as input a Kinesis video stream
1012+
* (<code>Input</code>), Amazon S3 bucket information (<code>Output</code>), and an
1013+
* Amazon SNS topic ARN (<code>NotificationChannel</code>). You can also provide a KMS
1014+
* key ID to encrypt the data sent to your Amazon S3 bucket. You specify what you want
1015+
* to detect by using the <code>ConnectedHome</code> option in settings, and
1016+
* selecting one of the following: <code>PERSON</code>, <code>PET</code>,
1017+
* <code>PACKAGE</code>, <code>ALL</code> You can also specify where in the
1018+
* frame you want Amazon Rekognition to monitor with <code>RegionsOfInterest</code>. When
1019+
* you run the <a>StartStreamProcessor</a> operation on a label
1020+
* detection stream processor, you input start and stop information to determine
1021+
* the length of the processing time.</p>
9621022
* </li>
9631023
* </ul>
9641024
* <p>
@@ -1151,6 +1211,7 @@ export class Rekognition extends RekognitionClient {
11511211
* @public
11521212
* <p>Deletes an existing project policy.</p>
11531213
* <p>To get a list of project policies attached to a project, call <a>ListProjectPolicies</a>. To attach a project policy to a project, call <a>PutProjectPolicy</a>.</p>
1214+
* <p>This operation requires permissions to perform the <code>rekognition:DeleteProjectPolicy</code> action.</p>
11541215
*/
11551216
public deleteProjectPolicy(
11561217
args: DeleteProjectPolicyCommandInput,
@@ -1575,7 +1636,7 @@ export class Rekognition extends RekognitionClient {
15751636
* <b>Response Elements</b>
15761637
* </p>
15771638
* <p> For each object, scene, and concept the API returns one or more labels. The API
1578-
* returns the following types of information regarding labels:</p>
1639+
* returns the following types of information about labels:</p>
15791640
* <ul>
15801641
* <li>
15811642
* <p> Name - The name of the detected label. </p>
@@ -1654,8 +1715,7 @@ export class Rekognition extends RekognitionClient {
16541715
* <p>If the object detected is a person, the operation doesn't provide the same facial
16551716
* details that the <a>DetectFaces</a> operation provides.</p>
16561717
* </note>
1657-
* <p>This is a stateless API operation. That is, the operation does not persist any
1658-
* data.</p>
1718+
* <p>This is a stateless API operation that doesn't return any data.</p>
16591719
* <p>This operation requires permissions to perform the
16601720
* <code>rekognition:DetectLabels</code> action. </p>
16611721
*/
@@ -2105,6 +2165,44 @@ export class Rekognition extends RekognitionClient {
21052165
}
21062166
}
21072167

2168+
/**
2169+
* @public
2170+
* <p>Retrieves the results of a specific Face Liveness session. It requires the
2171+
* <code>sessionId</code> as input, which was created using
2172+
* <code>CreateFaceLivenessSession</code>. Returns the corresponding Face Liveness confidence
2173+
* score, a reference image that includes a face bounding box, and audit images that also contain
2174+
* face bounding boxes. The Face Liveness confidence score ranges from 0 to 100. The reference
2175+
* image can optionally be returned.</p>
2176+
*/
2177+
public getFaceLivenessSessionResults(
2178+
args: GetFaceLivenessSessionResultsCommandInput,
2179+
options?: __HttpHandlerOptions
2180+
): Promise<GetFaceLivenessSessionResultsCommandOutput>;
2181+
public getFaceLivenessSessionResults(
2182+
args: GetFaceLivenessSessionResultsCommandInput,
2183+
cb: (err: any, data?: GetFaceLivenessSessionResultsCommandOutput) => void
2184+
): void;
2185+
public getFaceLivenessSessionResults(
2186+
args: GetFaceLivenessSessionResultsCommandInput,
2187+
options: __HttpHandlerOptions,
2188+
cb: (err: any, data?: GetFaceLivenessSessionResultsCommandOutput) => void
2189+
): void;
2190+
public getFaceLivenessSessionResults(
2191+
args: GetFaceLivenessSessionResultsCommandInput,
2192+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetFaceLivenessSessionResultsCommandOutput) => void),
2193+
cb?: (err: any, data?: GetFaceLivenessSessionResultsCommandOutput) => void
2194+
): Promise<GetFaceLivenessSessionResultsCommandOutput> | void {
2195+
const command = new GetFaceLivenessSessionResultsCommand(args);
2196+
if (typeof optionsOrCb === "function") {
2197+
this.send(command, optionsOrCb);
2198+
} else if (typeof cb === "function") {
2199+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
2200+
this.send(command, optionsOrCb || {}, cb);
2201+
} else {
2202+
return this.send(command, optionsOrCb);
2203+
}
2204+
}
2205+
21082206
/**
21092207
* @public
21102208
* <p>Gets the face search results for Amazon Rekognition Video face search started by
@@ -2702,6 +2800,7 @@ export class Rekognition extends RekognitionClient {
27022800
* @public
27032801
* <p>Gets a list of the project policies attached to a project.</p>
27042802
* <p>To attach a project policy to a project, call <a>PutProjectPolicy</a>. To remove a project policy from a project, call <a>DeleteProjectPolicy</a>.</p>
2803+
* <p>This operation requires permissions to perform the <code>rekognition:ListProjectPolicies</code> action.</p>
27052804
*/
27062805
public listProjectPolicies(
27072806
args: ListProjectPoliciesCommandInput,
@@ -2816,6 +2915,7 @@ export class Rekognition extends RekognitionClient {
28162915
* <p>To remove a project policy from a project, call <a>DeleteProjectPolicy</a>.
28172916
* To get a list of project policies attached to a project, call <a>ListProjectPolicies</a>. </p>
28182917
* <p>You copy a model version by calling <a>CopyProjectVersion</a>.</p>
2918+
* <p>This operation requires permissions to perform the <code>rekognition:PutProjectPolicy</code> action.</p>
28192919
*/
28202920
public putProjectPolicy(
28212921
args: PutProjectPolicyCommandInput,
@@ -3456,6 +3556,7 @@ export class Rekognition extends RekognitionClient {
34563556
* @public
34573557
* <p>Stops a running model. The operation might take a while to complete. To
34583558
* check the current status, call <a>DescribeProjectVersions</a>. </p>
3559+
* <p>This operation requires permissions to perform the <code>rekognition:StopProjectVersion</code> action.</p>
34593560
*/
34603561
public stopProjectVersion(
34613562
args: StopProjectVersionCommandInput,

clients/client-rekognition/src/RekognitionClient.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ import { CompareFacesCommandInput, CompareFacesCommandOutput } from "./commands/
5353
import { CopyProjectVersionCommandInput, CopyProjectVersionCommandOutput } from "./commands/CopyProjectVersionCommand";
5454
import { CreateCollectionCommandInput, CreateCollectionCommandOutput } from "./commands/CreateCollectionCommand";
5555
import { CreateDatasetCommandInput, CreateDatasetCommandOutput } from "./commands/CreateDatasetCommand";
56+
import {
57+
CreateFaceLivenessSessionCommandInput,
58+
CreateFaceLivenessSessionCommandOutput,
59+
} from "./commands/CreateFaceLivenessSessionCommand";
5660
import { CreateProjectCommandInput, CreateProjectCommandOutput } from "./commands/CreateProjectCommand";
5761
import {
5862
CreateProjectVersionCommandInput,
@@ -115,6 +119,10 @@ import {
115119
GetContentModerationCommandOutput,
116120
} from "./commands/GetContentModerationCommand";
117121
import { GetFaceDetectionCommandInput, GetFaceDetectionCommandOutput } from "./commands/GetFaceDetectionCommand";
122+
import {
123+
GetFaceLivenessSessionResultsCommandInput,
124+
GetFaceLivenessSessionResultsCommandOutput,
125+
} from "./commands/GetFaceLivenessSessionResultsCommand";
118126
import { GetFaceSearchCommandInput, GetFaceSearchCommandOutput } from "./commands/GetFaceSearchCommand";
119127
import { GetLabelDetectionCommandInput, GetLabelDetectionCommandOutput } from "./commands/GetLabelDetectionCommand";
120128
import { GetPersonTrackingCommandInput, GetPersonTrackingCommandOutput } from "./commands/GetPersonTrackingCommand";
@@ -209,6 +217,7 @@ export type ServiceInputTypes =
209217
| CopyProjectVersionCommandInput
210218
| CreateCollectionCommandInput
211219
| CreateDatasetCommandInput
220+
| CreateFaceLivenessSessionCommandInput
212221
| CreateProjectCommandInput
213222
| CreateProjectVersionCommandInput
214223
| CreateStreamProcessorCommandInput
@@ -235,6 +244,7 @@ export type ServiceInputTypes =
235244
| GetCelebrityRecognitionCommandInput
236245
| GetContentModerationCommandInput
237246
| GetFaceDetectionCommandInput
247+
| GetFaceLivenessSessionResultsCommandInput
238248
| GetFaceSearchCommandInput
239249
| GetLabelDetectionCommandInput
240250
| GetPersonTrackingCommandInput
@@ -277,6 +287,7 @@ export type ServiceOutputTypes =
277287
| CopyProjectVersionCommandOutput
278288
| CreateCollectionCommandOutput
279289
| CreateDatasetCommandOutput
290+
| CreateFaceLivenessSessionCommandOutput
280291
| CreateProjectCommandOutput
281292
| CreateProjectVersionCommandOutput
282293
| CreateStreamProcessorCommandOutput
@@ -303,6 +314,7 @@ export type ServiceOutputTypes =
303314
| GetCelebrityRecognitionCommandOutput
304315
| GetContentModerationCommandOutput
305316
| GetFaceDetectionCommandOutput
317+
| GetFaceLivenessSessionResultsCommandOutput
306318
| GetFaceSearchCommandOutput
307319
| GetLabelDetectionCommandOutput
308320
| GetPersonTrackingCommandOutput

clients/client-rekognition/src/commands/CopyProjectVersionCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export interface CopyProjectVersionCommandOutput extends CopyProjectVersionRespo
5151
* <p>Copying a model version takes a while to complete. To get the current status, call <a>DescribeProjectVersions</a> and check the value of <code>Status</code> in the
5252
* <a>ProjectVersionDescription</a> object. The copy operation has finished when
5353
* the value of <code>Status</code> is <code>COPYING_COMPLETED</code>.</p>
54+
* <p>This operation requires permissions to perform the <code>rekognition:CopyProjectVersion</code> action.</p>
5455
* @example
5556
* Use a bare-bones client and the command you need to make an API call.
5657
* ```javascript

0 commit comments

Comments
 (0)