Skip to content

Commit 6661719

Browse files
jabubakelesv
authored andcommitted
updating video intelligence sample to 0.21.1-alpha (GoogleCloudPlatform#812)
1 parent 966a24f commit 6661719

File tree

4 files changed

+14
-28
lines changed

4 files changed

+14
-28
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
<module>translate/cloud-client</module>
9090

9191
<module>unittests</module>
92-
92+
<module>video/cloud-client</module>
9393
<module>vision/cloud-client</module>
9494
<module>vision/face-detection</module>
9595
<module>vision/label</module>

video/cloud-client/pom.xml

+1-16
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,10 @@
4040
<artifactId>guava</artifactId>
4141
<version>20.0</version>
4242
</dependency>
43-
<dependency>
44-
<groupId>com.google.cloud</groupId>
45-
<artifactId>google-cloud</artifactId>
46-
<version>0.20.1-alpha</version>
47-
</dependency>
4843
<dependency>
4944
<groupId>com.google.cloud</groupId>
5045
<artifactId>google-cloud-video-intelligence</artifactId>
51-
<version>0.20.1-alpha</version>
52-
</dependency>
53-
<dependency>
54-
<groupId>com.google.auth</groupId>
55-
<artifactId>google-auth-library-credentials</artifactId>
56-
<version>0.6.1</version>
57-
</dependency>
58-
<dependency>
59-
<groupId>com.google.oauth-client</groupId>
60-
<artifactId>google-oauth-client-jetty</artifactId>
61-
<version>1.22.0</version>
46+
<version>0.21.1-alpha</version>
6247
</dependency>
6348
<!-- [END dependencies] -->
6449

video/cloud-client/src/main/java/com/example/video/Detect.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package com.example.video;
1818

19-
import com.google.api.gax.grpc.OperationFuture;
19+
import com.google.api.gax.rpc.OperationFuture;
2020
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoProgress;
2121
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest;
2222
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoResponse;
@@ -30,13 +30,13 @@
3030
import com.google.cloud.videointelligence.v1beta1.VideoIntelligenceServiceClient;
3131
import com.google.cloud.videointelligence.v1beta1.VideoIntelligenceServiceSettings;
3232
import com.google.cloud.videointelligence.v1beta1.VideoSegment;
33-
import org.apache.commons.codec.binary.Base64;
34-
33+
import com.google.longrunning.Operation;
3534
import java.io.IOException;
3635
import java.nio.file.Files;
3736
import java.nio.file.Path;
3837
import java.nio.file.Paths;
3938
import java.util.concurrent.ExecutionException;
39+
import org.apache.commons.codec.binary.Base64;
4040

4141

4242
public class Detect {
@@ -112,7 +112,7 @@ public static void analyzeFaces(String gcsUri) throws ExecutionException,
112112
.addFeatures(Feature.FACE_DETECTION)
113113
.build();
114114

115-
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
115+
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress, Operation> operation =
116116
client.annotateVideoAsync(request);
117117

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

155-
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
155+
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress, Operation> operation =
156156
client.annotateVideoAsync(request);
157157

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

203-
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
203+
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress, Operation> operation =
204204
client.annotateVideoAsync(request);
205205

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

248-
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
248+
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress, Operation> operation =
249249
client.annotateVideoAsync(request);
250250

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

288-
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
288+
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress, Operation> operation =
289289
client.annotateVideoAsync(request);
290290

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

video/cloud-client/src/main/java/com/example/video/QuickstartSample.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
package com.example.video;
1818

1919
// [START videointelligence_quickstart]
20-
import com.google.api.gax.grpc.OperationFuture;
20+
21+
import com.google.api.gax.rpc.OperationFuture;
2122
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoProgress;
2223
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest;
2324
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoResponse;
@@ -27,7 +28,7 @@
2728
import com.google.cloud.videointelligence.v1beta1.VideoAnnotationResults;
2829
import com.google.cloud.videointelligence.v1beta1.VideoIntelligenceServiceClient;
2930
import com.google.cloud.videointelligence.v1beta1.VideoIntelligenceServiceSettings;
30-
31+
import com.google.longrunning.Operation;
3132
import java.io.IOException;
3233
import java.util.concurrent.ExecutionException;
3334

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

52-
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
53+
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress, Operation> operation =
5354
client.annotateVideoAsync(request);
5455

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

0 commit comments

Comments
 (0)