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