Skip to content

Commit

Permalink
updating video intelligence sample to 0.21.1-alpha (GoogleCloudPlatfo…
Browse files Browse the repository at this point in the history
  • Loading branch information
jabubake authored and lesv committed Aug 18, 2017
1 parent 966a24f commit 6661719
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 28 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<module>translate/cloud-client</module>

<module>unittests</module>

<module>video/cloud-client</module>
<module>vision/cloud-client</module>
<module>vision/face-detection</module>
<module>vision/label</module>
Expand Down
17 changes: 1 addition & 16 deletions video/cloud-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,10 @@
<artifactId>guava</artifactId>
<version>20.0</version>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud</artifactId>
<version>0.20.1-alpha</version>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-video-intelligence</artifactId>
<version>0.20.1-alpha</version>
</dependency>
<dependency>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-credentials</artifactId>
<version>0.6.1</version>
</dependency>
<dependency>
<groupId>com.google.oauth-client</groupId>
<artifactId>google-oauth-client-jetty</artifactId>
<version>1.22.0</version>
<version>0.21.1-alpha</version>
</dependency>
<!-- [END dependencies] -->

Expand Down
16 changes: 8 additions & 8 deletions video/cloud-client/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
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 6661719

Please sign in to comment.