Search in sources :

Example 6 with S3Object

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

the class VideoDetectFaces method StartFaceDetection.

public String StartFaceDetection(String bucket, String video) {
    String startJobId = "";
    try {
        RekognitionClient rekClient = getRecClient();
        software.amazon.awssdk.services.rekognition.model.S3Object s3Obj = S3Object.builder().bucket(bucket).name(video).build();
        Video vidOb = Video.builder().s3Object(s3Obj).build();
        StartFaceDetectionRequest faceDetectionRequest = StartFaceDetectionRequest.builder().jobTag("Faces").notificationChannel(getChannel()).faceAttributes(FaceAttributes.ALL).video(vidOb).build();
        StartFaceDetectionResponse startLabelDetectionResult = rekClient.startFaceDetection(faceDetectionRequest);
        startJobId = startLabelDetectionResult.jobId();
        return startJobId;
    } catch (RekognitionException e) {
        System.out.println(e.getMessage());
        System.exit(1);
    }
    return "";
}
Also used : S3Object(software.amazon.awssdk.services.rekognition.model.S3Object) RekognitionClient(software.amazon.awssdk.services.rekognition.RekognitionClient) software.amazon.awssdk.services.rekognition.model(software.amazon.awssdk.services.rekognition.model)

Example 7 with S3Object

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

the class VideoDetectSegment method StartSegmentDetection.

// snippet-start:[rekognition.java2.recognize_video_segments.main]
public static void StartSegmentDetection(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();
        StartShotDetectionFilter cueDetectionFilter = StartShotDetectionFilter.builder().minSegmentConfidence(60F).build();
        StartTechnicalCueDetectionFilter technicalCueDetectionFilter = StartTechnicalCueDetectionFilter.builder().minSegmentConfidence(60F).build();
        StartSegmentDetectionFilters filters = StartSegmentDetectionFilters.builder().shotFilter(cueDetectionFilter).technicalCueFilter(technicalCueDetectionFilter).build();
        StartSegmentDetectionRequest segDetectionRequest = StartSegmentDetectionRequest.builder().jobTag("DetectingLabels").notificationChannel(channel).segmentTypes(SegmentType.TECHNICAL_CUE, SegmentType.SHOT).video(vidOb).filters(filters).build();
        StartSegmentDetectionResponse segDetectionResponse = rekClient.startSegmentDetection(segDetectionRequest);
        startJobId = segDetectionResponse.jobId();
    } catch (RekognitionException e) {
        e.getMessage();
        System.exit(1);
    }
}
Also used : StartTechnicalCueDetectionFilter(software.amazon.awssdk.services.rekognition.model.StartTechnicalCueDetectionFilter) StartSegmentDetectionFilters(software.amazon.awssdk.services.rekognition.model.StartSegmentDetectionFilters) RekognitionException(software.amazon.awssdk.services.rekognition.model.RekognitionException) Video(software.amazon.awssdk.services.rekognition.model.Video) StartSegmentDetectionResponse(software.amazon.awssdk.services.rekognition.model.StartSegmentDetectionResponse) S3Object(software.amazon.awssdk.services.rekognition.model.S3Object) StartShotDetectionFilter(software.amazon.awssdk.services.rekognition.model.StartShotDetectionFilter) StartSegmentDetectionRequest(software.amazon.awssdk.services.rekognition.model.StartSegmentDetectionRequest)

Example 8 with S3Object

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

the class VideoDetectInappropriate method startModerationDetection.

// snippet-start:[rekognition.java2.recognize_video_moderation.main]
public static void startModerationDetection(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();
        StartContentModerationRequest modDetectionRequest = StartContentModerationRequest.builder().jobTag("Moderation").notificationChannel(channel).video(vidOb).build();
        StartContentModerationResponse startModDetectionResult = rekClient.startContentModeration(modDetectionRequest);
        startJobId = startModDetectionResult.jobId();
    } catch (RekognitionException e) {
        System.out.println(e.getMessage());
        System.exit(1);
    }
}
Also used : StartContentModerationRequest(software.amazon.awssdk.services.rekognition.model.StartContentModerationRequest) RekognitionException(software.amazon.awssdk.services.rekognition.model.RekognitionException) Video(software.amazon.awssdk.services.rekognition.model.Video) S3Object(software.amazon.awssdk.services.rekognition.model.S3Object) StartContentModerationResponse(software.amazon.awssdk.services.rekognition.model.StartContentModerationResponse)

Example 9 with S3Object

use of software.amazon.awssdk.services.rekognition.model.S3Object 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

S3Object (software.amazon.awssdk.services.rekognition.model.S3Object)9 RekognitionException (software.amazon.awssdk.services.rekognition.model.RekognitionException)8 Video (software.amazon.awssdk.services.rekognition.model.Video)6 Image (software.amazon.awssdk.services.rekognition.model.Image)2 RekognitionClient (software.amazon.awssdk.services.rekognition.RekognitionClient)1 software.amazon.awssdk.services.rekognition.model (software.amazon.awssdk.services.rekognition.model)1 CustomLabel (software.amazon.awssdk.services.rekognition.model.CustomLabel)1 DetectCustomLabelsRequest (software.amazon.awssdk.services.rekognition.model.DetectCustomLabelsRequest)1 DetectCustomLabelsResponse (software.amazon.awssdk.services.rekognition.model.DetectCustomLabelsResponse)1 DetectLabelsRequest (software.amazon.awssdk.services.rekognition.model.DetectLabelsRequest)1 DetectLabelsResponse (software.amazon.awssdk.services.rekognition.model.DetectLabelsResponse)1 GetLabelDetectionRequest (software.amazon.awssdk.services.rekognition.model.GetLabelDetectionRequest)1 GetLabelDetectionResponse (software.amazon.awssdk.services.rekognition.model.GetLabelDetectionResponse)1 Label (software.amazon.awssdk.services.rekognition.model.Label)1 StartCelebrityRecognitionRequest (software.amazon.awssdk.services.rekognition.model.StartCelebrityRecognitionRequest)1 StartCelebrityRecognitionResponse (software.amazon.awssdk.services.rekognition.model.StartCelebrityRecognitionResponse)1 StartContentModerationRequest (software.amazon.awssdk.services.rekognition.model.StartContentModerationRequest)1 StartContentModerationResponse (software.amazon.awssdk.services.rekognition.model.StartContentModerationResponse)1 StartLabelDetectionRequest (software.amazon.awssdk.services.rekognition.model.StartLabelDetectionRequest)1 StartLabelDetectionResponse (software.amazon.awssdk.services.rekognition.model.StartLabelDetectionResponse)1