Search in sources :

Example 1 with StartPersonTrackingResponse

use of software.amazon.awssdk.services.rekognition.model.StartPersonTrackingResponse in project aws-doc-sdk-examples by awsdocs.

the class VideoPersonDetection method startPersonLabels.

// snippet-start:[rekognition.java2.recognize_video_person.main]
public static void startPersonLabels(RekognitionClient rekClient, NotificationChannel channel, String bucket, String video) {
    try {
        S3Object s3Obj = S3Object.builder().bucket(bucket).name(video).build();
        Video vidOb = Video.builder().s3Object(s3Obj).build();
        StartPersonTrackingRequest personTrackingRequest = StartPersonTrackingRequest.builder().jobTag("DetectingLabels").video(vidOb).notificationChannel(channel).build();
        StartPersonTrackingResponse labelDetectionResponse = rekClient.startPersonTracking(personTrackingRequest);
        startJobId = labelDetectionResponse.jobId();
    } catch (RekognitionException e) {
        System.out.println(e.getMessage());
        System.exit(1);
    }
}
Also used : RekognitionException(software.amazon.awssdk.services.rekognition.model.RekognitionException) Video(software.amazon.awssdk.services.rekognition.model.Video) StartPersonTrackingRequest(software.amazon.awssdk.services.rekognition.model.StartPersonTrackingRequest) S3Object(software.amazon.awssdk.services.rekognition.model.S3Object) StartPersonTrackingResponse(software.amazon.awssdk.services.rekognition.model.StartPersonTrackingResponse)

Aggregations

RekognitionException (software.amazon.awssdk.services.rekognition.model.RekognitionException)1 S3Object (software.amazon.awssdk.services.rekognition.model.S3Object)1 StartPersonTrackingRequest (software.amazon.awssdk.services.rekognition.model.StartPersonTrackingRequest)1 StartPersonTrackingResponse (software.amazon.awssdk.services.rekognition.model.StartPersonTrackingResponse)1 Video (software.amazon.awssdk.services.rekognition.model.Video)1