Search in sources :

Example 56 with VideoAnnotationResults

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

the class DetectIT method testTrackObjectsGcs.

@Test
public void testTrackObjectsGcs() throws Exception {
    VideoAnnotationResults result = TrackObjects.trackObjectsGcs(LABEL_GCS_LOCATION);
    String got = bout.toString();
    assertThat(got).contains("Entity id");
}
Also used : VideoAnnotationResults(com.google.cloud.videointelligence.v1.VideoAnnotationResults) Test(org.junit.Test)

Example 57 with VideoAnnotationResults

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

the class DetectIT method testTextDetection.

@Test
public void testTextDetection() throws Exception {
    VideoAnnotationResults result = TextDetection.detectText("resources/googlework_short.mp4");
    boolean textExists = false;
    for (TextAnnotation textAnnotation : result.getTextAnnotationsList()) {
        for (String possibleText : POSSIBLE_TEXTS) {
            if (textAnnotation.getText().toUpperCase().contains(possibleText.toUpperCase())) {
                textExists = true;
                break;
            }
        }
    }
    assertThat(textExists).isTrue();
}
Also used : VideoAnnotationResults(com.google.cloud.videointelligence.v1.VideoAnnotationResults) TextAnnotation(com.google.cloud.videointelligence.v1.TextAnnotation) Test(org.junit.Test)

Example 58 with VideoAnnotationResults

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

the class DetectIT method testTrackObjectsGcs.

@Test
public void testTrackObjectsGcs() throws Exception {
    VideoAnnotationResults result = TrackObjects.trackObjectsGcs(LABEL_GCS_LOCATION);
    String got = bout.toString();
    assertThat(got).contains("Entity id");
}
Also used : VideoAnnotationResults(com.google.cloud.videointelligence.v1.VideoAnnotationResults) Test(org.junit.Test)

Example 59 with VideoAnnotationResults

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

the class DetectTextTest method testTextDetection.

@Test
public void testTextDetection() throws Exception {
    VideoAnnotationResults result = TextDetection.detectText("resources/googlework_short.mp4");
    boolean textExists = false;
    for (TextAnnotation textAnnotation : result.getTextAnnotationsList()) {
        for (String possibleText : POSSIBLE_TEXTS) {
            if (textAnnotation.getText().toUpperCase().contains(possibleText.toUpperCase())) {
                textExists = true;
                break;
            }
        }
    }
    assertThat(textExists).isTrue();
}
Also used : VideoAnnotationResults(com.google.cloud.videointelligence.v1.VideoAnnotationResults) TextAnnotation(com.google.cloud.videointelligence.v1.TextAnnotation) Test(org.junit.Test)

Example 60 with VideoAnnotationResults

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

the class DetectTextTest method testTextDetectionGcs.

@Test
public void testTextDetectionGcs() throws Exception {
    VideoAnnotationResults result = TextDetection.detectTextGcs(SPEECH_GCS_LOCATION);
    boolean textExists = false;
    for (TextAnnotation textAnnotation : result.getTextAnnotationsList()) {
        for (String possibleText : POSSIBLE_TEXTS) {
            if (textAnnotation.getText().toUpperCase().contains(possibleText.toUpperCase())) {
                textExists = true;
                break;
            }
        }
    }
    assertThat(textExists).isTrue();
}
Also used : VideoAnnotationResults(com.google.cloud.videointelligence.v1.VideoAnnotationResults) TextAnnotation(com.google.cloud.videointelligence.v1.TextAnnotation) Test(org.junit.Test)

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