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 "";
}
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);
}
}
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);
}
}
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);
}
}
Aggregations