Skip to content

Commit

Permalink
samples: updating video intelligence sample to 0.21.1-alpha (#812)
Browse files Browse the repository at this point in the history
  • Loading branch information
jabubake authored and chingor13 committed Feb 24, 2021
1 parent 7a71c6d commit de14f66
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
16 changes: 8 additions & 8 deletions video/src/main/java/com/example/video/Detect.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.example.video;

import com.google.api.gax.grpc.OperationFuture;
import com.google.api.gax.rpc.OperationFuture;
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoProgress;
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest;
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoResponse;
Expand All @@ -30,13 +30,13 @@
import com.google.cloud.videointelligence.v1beta1.VideoIntelligenceServiceClient;
import com.google.cloud.videointelligence.v1beta1.VideoIntelligenceServiceSettings;
import com.google.cloud.videointelligence.v1beta1.VideoSegment;
import org.apache.commons.codec.binary.Base64;

import com.google.longrunning.Operation;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.concurrent.ExecutionException;
import org.apache.commons.codec.binary.Base64;


public class Detect {
Expand Down Expand Up @@ -112,7 +112,7 @@ public static void analyzeFaces(String gcsUri) throws ExecutionException,
.addFeatures(Feature.FACE_DETECTION)
.build();

OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress, Operation> operation =
client.annotateVideoAsync(request);

System.out.println("Waiting for operation to complete...");
Expand Down Expand Up @@ -152,7 +152,7 @@ public static void analyzeLabels(String gcsUri) throws
.addFeatures(Feature.LABEL_DETECTION)
.build();

OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress, Operation> operation =
client.annotateVideoAsync(request);

System.out.println("Waiting for operation to complete...");
Expand Down Expand Up @@ -200,7 +200,7 @@ public static void analyzeLabelsFile(String filePath) throws
.addFeatures(Feature.LABEL_DETECTION)
.build();

OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress, Operation> operation =
client.annotateVideoAsync(request);

System.out.println("Waiting for operation to complete...");
Expand Down Expand Up @@ -245,7 +245,7 @@ public static void analyzeShots(String gcsUri)
.addFeatures(Feature.SHOT_CHANGE_DETECTION)
.build();

OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress, Operation> operation =
client.annotateVideoAsync(request);

System.out.println("Waiting for operation to complete...");
Expand Down Expand Up @@ -285,7 +285,7 @@ public static void analyzeSafeSearch(String gcsUri)
.addFeatures(Feature.SAFE_SEARCH_DETECTION)
.build();

OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress, Operation> operation =
client.annotateVideoAsync(request);

System.out.println("Waiting for operation to complete...");
Expand Down
7 changes: 4 additions & 3 deletions video/src/main/java/com/example/video/QuickstartSample.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
package com.example.video;

// [START videointelligence_quickstart]
import com.google.api.gax.grpc.OperationFuture;

import com.google.api.gax.rpc.OperationFuture;
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoProgress;
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest;
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoResponse;
Expand All @@ -27,7 +28,7 @@
import com.google.cloud.videointelligence.v1beta1.VideoAnnotationResults;
import com.google.cloud.videointelligence.v1beta1.VideoIntelligenceServiceClient;
import com.google.cloud.videointelligence.v1beta1.VideoIntelligenceServiceSettings;

import com.google.longrunning.Operation;
import java.io.IOException;
import java.util.concurrent.ExecutionException;

Expand All @@ -49,7 +50,7 @@ public static void main(String[] args) throws
.addFeatures(Feature.LABEL_DETECTION)
.build();

OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress, Operation> operation =
client.annotateVideoAsync(request);

System.out.println("Waiting for operation to complete...");
Expand Down

0 comments on commit de14f66

Please sign in to comment.