Search in sources :

Example 1 with StartCelebrityRecognitionResponse

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

the class VideoCelebrityDetection method StartCelebrityDetection.

// snippet-start:[rekognition.java2.recognize_video_celebrity.main]
public static void StartCelebrityDetection(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();
        StartCelebrityRecognitionRequest recognitionRequest = StartCelebrityRecognitionRequest.builder().jobTag("Celebrities").notificationChannel(channel).video(vidOb).build();
        StartCelebrityRecognitionResponse startCelebrityRecognitionResult = rekClient.startCelebrityRecognition(recognitionRequest);
        startJobId = startCelebrityRecognitionResult.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) StartCelebrityRecognitionResponse(software.amazon.awssdk.services.rekognition.model.StartCelebrityRecognitionResponse) S3Object(software.amazon.awssdk.services.rekognition.model.S3Object) StartCelebrityRecognitionRequest(software.amazon.awssdk.services.rekognition.model.StartCelebrityRecognitionRequest)

Aggregations

RekognitionException (software.amazon.awssdk.services.rekognition.model.RekognitionException)1 S3Object (software.amazon.awssdk.services.rekognition.model.S3Object)1 StartCelebrityRecognitionRequest (software.amazon.awssdk.services.rekognition.model.StartCelebrityRecognitionRequest)1 StartCelebrityRecognitionResponse (software.amazon.awssdk.services.rekognition.model.StartCelebrityRecognitionResponse)1 Video (software.amazon.awssdk.services.rekognition.model.Video)1