Search in sources :

Example 21 with VideoAnnotationResults

use of com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults in project java-video-intelligence by googleapis.

the class ITSystemTest method annotateVideoTest.

@Test
public void annotateVideoTest() throws ExecutionException, InterruptedException {
    AnnotateVideoResponse response = client.annotateVideoAsync(BUCKET_URI, FEATURE_LIST).get();
    List<VideoAnnotationResults> videoAnnotationResults = response.getAnnotationResultsList();
    for (VideoAnnotationResults result : videoAnnotationResults) {
        assertEquals(BUCKET_URI.substring(4), result.getInputUri());
        assertTrue(result.getSegmentLabelAnnotationsList().size() > 0);
    }
}
Also used : VideoAnnotationResults(com.google.cloud.videointelligence.v1beta2.VideoAnnotationResults) AnnotateVideoResponse(com.google.cloud.videointelligence.v1beta2.AnnotateVideoResponse) Test(org.junit.Test)

Example 22 with VideoAnnotationResults

use of com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults in project java-video-intelligence by googleapis.

the class ITSystemTest method annotateVideoTest.

@Test
public void annotateVideoTest() throws ExecutionException, InterruptedException {
    AnnotateVideoResponse response = client.annotateVideoAsync(BUCKET_URI, FEATURE_LIST).get();
    List<VideoAnnotationResults> videoAnnotationResults = response.getAnnotationResultsList();
    for (VideoAnnotationResults result : videoAnnotationResults) {
        assertEquals(BUCKET_URI.substring(4), result.getInputUri());
        assertTrue(result.getSegmentLabelAnnotationsList().size() > 0);
    }
}
Also used : VideoAnnotationResults(com.google.cloud.videointelligence.v1.VideoAnnotationResults) AnnotateVideoResponse(com.google.cloud.videointelligence.v1.AnnotateVideoResponse) Test(org.junit.Test)

Example 23 with VideoAnnotationResults

use of com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults in project beam by apache.

the class AnnotateVideoBytesWithContextFn method processElement.

/**
 * ProcessElement implementation.
 */
@Override
public void processElement(ProcessContext context) throws ExecutionException, InterruptedException {
    ByteString element = context.element().getKey();
    VideoContext videoContext = context.element().getValue();
    List<VideoAnnotationResults> videoAnnotationResults = getVideoAnnotationResults(null, element, videoContext);
    context.output(videoAnnotationResults);
}
Also used : ByteString(com.google.protobuf.ByteString) VideoAnnotationResults(com.google.cloud.videointelligence.v1.VideoAnnotationResults) VideoContext(com.google.cloud.videointelligence.v1.VideoContext)

Example 24 with VideoAnnotationResults

use of com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults in project beam by apache.

the class AnnotateVideoFromBytesFn method processElement.

/**
 * Implementation of ProcessElement.
 */
@Override
public void processElement(ProcessContext context) throws ExecutionException, InterruptedException {
    ByteString element = context.element();
    VideoContext videoContext = null;
    if (contextSideInput != null) {
        videoContext = context.sideInput(contextSideInput).get(element);
    }
    List<VideoAnnotationResults> videoAnnotationResults = getVideoAnnotationResults(null, element, videoContext);
    context.output(videoAnnotationResults);
}
Also used : ByteString(com.google.protobuf.ByteString) VideoAnnotationResults(com.google.cloud.videointelligence.v1.VideoAnnotationResults) VideoContext(com.google.cloud.videointelligence.v1.VideoContext)

Example 25 with VideoAnnotationResults

use of com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults in project beam by apache.

the class AnnotateVideoURIWithContextFn method processElement.

/**
 * ProcessElement implementation.
 */
@Override
public void processElement(ProcessContext context) throws ExecutionException, InterruptedException {
    String elementURI = context.element().getKey();
    VideoContext videoContext = context.element().getValue();
    List<VideoAnnotationResults> videoAnnotationResults = getVideoAnnotationResults(elementURI, null, videoContext);
    context.output(videoAnnotationResults);
}
Also used : VideoAnnotationResults(com.google.cloud.videointelligence.v1.VideoAnnotationResults) VideoContext(com.google.cloud.videointelligence.v1.VideoContext)

Aggregations

VideoAnnotationResults (com.google.cloud.videointelligence.v1.VideoAnnotationResults)44 AnnotateVideoResponse (com.google.cloud.videointelligence.v1.AnnotateVideoResponse)34 AnnotateVideoProgress (com.google.cloud.videointelligence.v1.AnnotateVideoProgress)33 AnnotateVideoRequest (com.google.cloud.videointelligence.v1.AnnotateVideoRequest)33 VideoIntelligenceServiceClient (com.google.cloud.videointelligence.v1.VideoIntelligenceServiceClient)33 VideoSegment (com.google.cloud.videointelligence.v1.VideoSegment)19 Duration (com.google.protobuf.Duration)18 Entity (com.google.cloud.videointelligence.v1.Entity)17 Path (java.nio.file.Path)14 Test (org.junit.Test)14 VideoContext (com.google.cloud.videointelligence.v1.VideoContext)10 LabelAnnotation (com.google.cloud.videointelligence.v1.LabelAnnotation)9 LabelSegment (com.google.cloud.videointelligence.v1.LabelSegment)9 DetectedAttribute (com.google.cloud.videointelligence.v1.DetectedAttribute)8 NormalizedBoundingBox (com.google.cloud.videointelligence.v1.NormalizedBoundingBox)8 TextAnnotation (com.google.cloud.videointelligence.v1.TextAnnotation)8 TimestampedObject (com.google.cloud.videointelligence.v1.TimestampedObject)8 Track (com.google.cloud.videointelligence.v1.Track)8 VideoAnnotationResults (com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults)8 AnnotateVideoResponse (com.google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse)5