Skip to content

Commit

Permalink
samples: Upgrades client to 0.20.1 and addresses changes to long runn…
Browse files Browse the repository at this point in the history
…ing operations
  • Loading branch information
gguuss authored and chingor13 committed Feb 24, 2021
1 parent f3c73d9 commit 7a71c6d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
11 changes: 6 additions & 5 deletions video/src/main/java/com/example/video/Detect.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.example.video;

import com.google.api.gax.grpc.OperationFuture;
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoProgress;
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest;
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoResponse;
import com.google.cloud.videointelligence.v1beta1.FaceAnnotation;
Expand Down Expand Up @@ -111,7 +112,7 @@ public static void analyzeFaces(String gcsUri) throws ExecutionException,
.addFeatures(Feature.FACE_DETECTION)
.build();

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

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

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

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

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

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

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

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

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

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

// [START videointelligence_quickstart]
import com.google.api.gax.grpc.OperationFuture;
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoProgress;
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest;
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoResponse;
import com.google.cloud.videointelligence.v1beta1.Feature;
Expand Down Expand Up @@ -48,7 +49,7 @@ public static void main(String[] args) throws
.addFeatures(Feature.LABEL_DETECTION)
.build();

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

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

0 comments on commit 7a71c6d

Please sign in to comment.