diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml
new file mode 100644
index 000000000..fc89d49d1
--- /dev/null
+++ b/.github/.OwlBot.lock.yaml
@@ -0,0 +1,3 @@
+docker:
+ digest: sha256:4837f2a7fdff2985b4f7432f8a6d6a87beacebf3ac071746532c0ce2e3f24b9b
+ image: gcr.io/repo-automation-bots/owlbot-java:latest
diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml
new file mode 100644
index 000000000..ed97e1e48
--- /dev/null
+++ b/.github/.OwlBot.yaml
@@ -0,0 +1,32 @@
+# Copyright 2021 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+docker:
+ image: "gcr.io/repo-automation-bots/owlbot-java:latest"
+
+deep-remove-regex:
+- "/grpc-google-.*/src"
+- "/proto-google-.*/src"
+- "/google-.*/src"
+
+deep-preserve-regex:
+- "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"
+
+deep-copy-regex:
+- source: "/google/cloud/videointelligence/(v.*)/.*-java/proto-google-.*/src"
+ dest: "/owl-bot-staging/$1/proto-google-cloud-video-intelligence-$1/src"
+- source: "/google/cloud/videointelligence/(v.*)/.*-java/grpc-google-.*/src"
+ dest: "/owl-bot-staging/$1/grpc-google-cloud-video-intelligence-$1/src"
+- source: "/google/cloud/videointelligence/(v.*)/.*-java/gapic-google-.*/src"
+ dest: "/owl-bot-staging/$1/google-cloud-video-intelligence/src"
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 3becb5c02..aeb5916ae 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -78,4 +78,4 @@ jobs:
- run: java -version
- run: .kokoro/build.sh
env:
- JOB_TYPE: clirr
+ JOB_TYPE: clirr
\ No newline at end of file
diff --git a/README.md b/README.md
index 170ceab83..c50b34fde 100644
--- a/README.md
+++ b/README.md
@@ -45,7 +45,7 @@ If you are using Maven without BOM, add this to your dependencies:
com.google.cloud
google-cloud-video-intelligence
- 2.0.4
+ 2.0.5
com.google.cloud
@@ -58,20 +58,20 @@ If you are using Maven without BOM, add this to your dependencies:
If you are using Gradle 5.x or later, add this to your dependencies
```Groovy
-implementation platform('com.google.cloud:libraries-bom:22.0.0')
+implementation platform('com.google.cloud:libraries-bom:23.0.0')
implementation 'com.google.cloud:google-cloud-video-intelligence'
```
If you are using Gradle without BOM, add this to your dependencies
```Groovy
-implementation 'com.google.cloud:google-cloud-video-intelligence:2.0.4'
+implementation 'com.google.cloud:google-cloud-video-intelligence:2.0.5'
```
If you are using SBT, add this to your dependencies
```Scala
-libraryDependencies += "com.google.cloud" % "google-cloud-video-intelligence" % "2.0.4"
+libraryDependencies += "com.google.cloud" % "google-cloud-video-intelligence" % "2.0.5"
```
## Authentication
@@ -115,8 +115,6 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-video-intelli
| Sample | Source Code | Try it |
| --------------------------- | --------------------------------- | ------ |
-| None | [source code](https://github.com/googleapis/java-video-intelligence/blob/master/samples/generated/src/main/java/com/google/cloud/examples/videointelligence/v1p3beta1/VideoDetectLogoBeta.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-video-intelligence&page=editor&open_in_editor=samples/generated/src/main/java/com/google/cloud/examples/videointelligence/v1p3beta1/VideoDetectLogoBeta.java) |
-| None | [source code](https://github.com/googleapis/java-video-intelligence/blob/master/samples/generated/src/main/java/com/google/cloud/examples/videointelligence/v1p3beta1/VideoDetectLogoGcsBeta.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-video-intelligence&page=editor&open_in_editor=samples/generated/src/main/java/com/google/cloud/examples/videointelligence/v1p3beta1/VideoDetectLogoGcsBeta.java) |
| Detect | [source code](https://github.com/googleapis/java-video-intelligence/blob/master/samples/snippets/src/main/java/beta/video/Detect.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-video-intelligence&page=editor&open_in_editor=samples/snippets/src/main/java/beta/video/Detect.java) |
| Detect Logo | [source code](https://github.com/googleapis/java-video-intelligence/blob/master/samples/snippets/src/main/java/beta/video/DetectLogo.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-video-intelligence&page=editor&open_in_editor=samples/snippets/src/main/java/beta/video/DetectLogo.java) |
| Detect Logo Gcs | [source code](https://github.com/googleapis/java-video-intelligence/blob/master/samples/snippets/src/main/java/beta/video/DetectLogoGcs.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-video-intelligence&page=editor&open_in_editor=samples/snippets/src/main/java/beta/video/DetectLogoGcs.java) |
diff --git a/google-cloud-video-intelligence-bom/pom.xml b/google-cloud-video-intelligence-bom/pom.xml
index 8441559fc..a5c8224c6 100644
--- a/google-cloud-video-intelligence-bom/pom.xml
+++ b/google-cloud-video-intelligence-bom/pom.xml
@@ -1,4 +1,4 @@
-
+
4.0.0
com.google.cloud
@@ -49,22 +49,16 @@
-
- com.google.api.grpc
- proto-google-cloud-video-intelligence-v1p3beta1
- 0.90.6-SNAPSHOT
+ com.google.cloud
+ google-cloud-video-intelligence
+ 2.0.6-SNAPSHOT
com.google.api.grpc
grpc-google-cloud-video-intelligence-v1p1beta1
0.90.6-SNAPSHOT
-
- com.google.cloud
- google-cloud-video-intelligence
- 2.0.6-SNAPSHOT
-
com.google.api.grpc
grpc-google-cloud-video-intelligence-v1beta2
@@ -72,33 +66,38 @@
com.google.api.grpc
- proto-google-cloud-video-intelligence-v1beta2
- 0.90.6-SNAPSHOT
+ grpc-google-cloud-video-intelligence-v1
+ 2.0.6-SNAPSHOT
com.google.api.grpc
- proto-google-cloud-video-intelligence-v1p1beta1
- 0.90.6-SNAPSHOT
+ grpc-google-cloud-video-intelligence-v1p2beta1
+ 0.90.6-SNAPSHOT
com.google.api.grpc
- grpc-google-cloud-video-intelligence-v1
- 2.0.6-SNAPSHOT
+ grpc-google-cloud-video-intelligence-v1p3beta1
+ 0.90.6-SNAPSHOT
com.google.api.grpc
- proto-google-cloud-video-intelligence-v1
- 2.0.6-SNAPSHOT
+ proto-google-cloud-video-intelligence-v1p3beta1
+ 0.90.6-SNAPSHOT
com.google.api.grpc
- grpc-google-cloud-video-intelligence-v1p2beta1
- 0.90.6-SNAPSHOT
+ proto-google-cloud-video-intelligence-v1beta2
+ 0.90.6-SNAPSHOT
com.google.api.grpc
- grpc-google-cloud-video-intelligence-v1p3beta1
- 0.90.6-SNAPSHOT
+ proto-google-cloud-video-intelligence-v1p1beta1
+ 0.90.6-SNAPSHOT
+
+
+ com.google.api.grpc
+ proto-google-cloud-video-intelligence-v1
+ 2.0.6-SNAPSHOT
com.google.api.grpc
diff --git a/google-cloud-video-intelligence/pom.xml b/google-cloud-video-intelligence/pom.xml
index 018b9835a..be2a29b8d 100644
--- a/google-cloud-video-intelligence/pom.xml
+++ b/google-cloud-video-intelligence/pom.xml
@@ -1,4 +1,4 @@
-
+
4.0.0
com.google.cloud
@@ -143,4 +143,4 @@
-
\ No newline at end of file
+
diff --git a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1/stub/VideoIntelligenceServiceStubSettings.java b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1/stub/VideoIntelligenceServiceStubSettings.java
index b47ce3774..328cf57d2 100644
--- a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1/stub/VideoIntelligenceServiceStubSettings.java
+++ b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1/stub/VideoIntelligenceServiceStubSettings.java
@@ -139,7 +139,9 @@ public static List getDefaultServiceScopes() {
/** Returns a builder for the default credentials for this service. */
public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
- return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
+ return GoogleCredentialsProvider.newBuilder()
+ .setScopesToApply(DEFAULT_SERVICE_SCOPES)
+ .setUseJwtAccessWithScope(true);
}
/** Returns a builder for the default ChannelProvider for this service. */
diff --git a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1beta2/stub/VideoIntelligenceServiceStubSettings.java b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1beta2/stub/VideoIntelligenceServiceStubSettings.java
index 723b55962..5716fa3f1 100644
--- a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1beta2/stub/VideoIntelligenceServiceStubSettings.java
+++ b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1beta2/stub/VideoIntelligenceServiceStubSettings.java
@@ -140,7 +140,9 @@ public static List getDefaultServiceScopes() {
/** Returns a builder for the default credentials for this service. */
public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
- return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
+ return GoogleCredentialsProvider.newBuilder()
+ .setScopesToApply(DEFAULT_SERVICE_SCOPES)
+ .setUseJwtAccessWithScope(true);
}
/** Returns a builder for the default ChannelProvider for this service. */
diff --git a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p1beta1/stub/VideoIntelligenceServiceStubSettings.java b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p1beta1/stub/VideoIntelligenceServiceStubSettings.java
index 983fe452a..03ff85677 100644
--- a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p1beta1/stub/VideoIntelligenceServiceStubSettings.java
+++ b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p1beta1/stub/VideoIntelligenceServiceStubSettings.java
@@ -140,7 +140,9 @@ public static List getDefaultServiceScopes() {
/** Returns a builder for the default credentials for this service. */
public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
- return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
+ return GoogleCredentialsProvider.newBuilder()
+ .setScopesToApply(DEFAULT_SERVICE_SCOPES)
+ .setUseJwtAccessWithScope(true);
}
/** Returns a builder for the default ChannelProvider for this service. */
diff --git a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/stub/VideoIntelligenceServiceStubSettings.java b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/stub/VideoIntelligenceServiceStubSettings.java
index 36bd1b59b..07c875744 100644
--- a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/stub/VideoIntelligenceServiceStubSettings.java
+++ b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/stub/VideoIntelligenceServiceStubSettings.java
@@ -140,7 +140,9 @@ public static List getDefaultServiceScopes() {
/** Returns a builder for the default credentials for this service. */
public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
- return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
+ return GoogleCredentialsProvider.newBuilder()
+ .setScopesToApply(DEFAULT_SERVICE_SCOPES)
+ .setUseJwtAccessWithScope(true);
}
/** Returns a builder for the default ChannelProvider for this service. */
diff --git a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/stub/StreamingVideoIntelligenceServiceStubSettings.java b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/stub/StreamingVideoIntelligenceServiceStubSettings.java
index 59f654f47..b9adc744c 100644
--- a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/stub/StreamingVideoIntelligenceServiceStubSettings.java
+++ b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/stub/StreamingVideoIntelligenceServiceStubSettings.java
@@ -129,7 +129,9 @@ public static List getDefaultServiceScopes() {
/** Returns a builder for the default credentials for this service. */
public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
- return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
+ return GoogleCredentialsProvider.newBuilder()
+ .setScopesToApply(DEFAULT_SERVICE_SCOPES)
+ .setUseJwtAccessWithScope(true);
}
/** Returns a builder for the default ChannelProvider for this service. */
diff --git a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/stub/VideoIntelligenceServiceStubSettings.java b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/stub/VideoIntelligenceServiceStubSettings.java
index baa089da6..7a5574894 100644
--- a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/stub/VideoIntelligenceServiceStubSettings.java
+++ b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/stub/VideoIntelligenceServiceStubSettings.java
@@ -140,7 +140,9 @@ public static List getDefaultServiceScopes() {
/** Returns a builder for the default credentials for this service. */
public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
- return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES);
+ return GoogleCredentialsProvider.newBuilder()
+ .setScopesToApply(DEFAULT_SERVICE_SCOPES)
+ .setUseJwtAccessWithScope(true);
}
/** Returns a builder for the default ChannelProvider for this service. */
diff --git a/owlbot.py b/owlbot.py
new file mode 100644
index 000000000..dca9d8672
--- /dev/null
+++ b/owlbot.py
@@ -0,0 +1,24 @@
+# Copyright 2021 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import synthtool as s
+from synthtool.languages import java
+
+
+for library in s.get_staging_dirs():
+ # put any special-case replacements here
+ s.move(library)
+
+s.remove_staging_dirs()
+java.common_templates()
diff --git a/pom.xml b/pom.xml
index 371a7e1b3..861393490 100644
--- a/pom.xml
+++ b/pom.xml
@@ -154,17 +154,17 @@
- proto-google-cloud-video-intelligence-v1p3beta1
- proto-google-cloud-video-intelligence-v1beta2
- proto-google-cloud-video-intelligence-v1p1beta1
- proto-google-cloud-video-intelligence-v1
- proto-google-cloud-video-intelligence-v1p2beta1
+ google-cloud-video-intelligence
grpc-google-cloud-video-intelligence-v1p1beta1
grpc-google-cloud-video-intelligence-v1beta2
grpc-google-cloud-video-intelligence-v1
grpc-google-cloud-video-intelligence-v1p2beta1
grpc-google-cloud-video-intelligence-v1p3beta1
- google-cloud-video-intelligence
+ proto-google-cloud-video-intelligence-v1p3beta1
+ proto-google-cloud-video-intelligence-v1beta2
+ proto-google-cloud-video-intelligence-v1p1beta1
+ proto-google-cloud-video-intelligence-v1
+ proto-google-cloud-video-intelligence-v1p2beta1
google-cloud-video-intelligence-bom
@@ -237,4 +237,4 @@
-
\ No newline at end of file
+
diff --git a/proto-google-cloud-video-intelligence-v1beta2/clirr-ignored-differences.xml b/proto-google-cloud-video-intelligence-v1beta2/clirr-ignored-differences.xml
new file mode 100644
index 000000000..350031669
--- /dev/null
+++ b/proto-google-cloud-video-intelligence-v1beta2/clirr-ignored-differences.xml
@@ -0,0 +1,19 @@
+
+
+
+
+ 7012
+ com/google/cloud/videointelligence/v1beta2/*OrBuilder
+ * get*(*)
+
+
+ 7012
+ com/google/cloud/videointelligence/v1beta2/*OrBuilder
+ boolean contains*(*)
+
+
+ 7012
+ com/google/cloud/videointelligence/v1beta2/*OrBuilder
+ boolean has*(*)
+
+
diff --git a/proto-google-cloud-video-intelligence-v1p1beta1/clirr-ignored-differences.xml b/proto-google-cloud-video-intelligence-v1p1beta1/clirr-ignored-differences.xml
new file mode 100644
index 000000000..c9f7ee600
--- /dev/null
+++ b/proto-google-cloud-video-intelligence-v1p1beta1/clirr-ignored-differences.xml
@@ -0,0 +1,19 @@
+
+
+
+
+ 7012
+ com/google/cloud/videointelligence/v1p1beta1/*OrBuilder
+ * get*(*)
+
+
+ 7012
+ com/google/cloud/videointelligence/v1p1beta1/*OrBuilder
+ boolean contains*(*)
+
+
+ 7012
+ com/google/cloud/videointelligence/v1p1beta1/*OrBuilder
+ boolean has*(*)
+
+
diff --git a/proto-google-cloud-video-intelligence-v1p2beta1/clirr-ignored-differences.xml b/proto-google-cloud-video-intelligence-v1p2beta1/clirr-ignored-differences.xml
new file mode 100644
index 000000000..fee225332
--- /dev/null
+++ b/proto-google-cloud-video-intelligence-v1p2beta1/clirr-ignored-differences.xml
@@ -0,0 +1,19 @@
+
+
+
+
+ 7012
+ com/google/cloud/videointelligence/v1p2beta1/*OrBuilder
+ * get*(*)
+
+
+ 7012
+ com/google/cloud/videointelligence/v1p2beta1/*OrBuilder
+ boolean contains*(*)
+
+
+ 7012
+ com/google/cloud/videointelligence/v1p2beta1/*OrBuilder
+ boolean has*(*)
+
+
diff --git a/samples/generated/src/main/java/com/google/cloud/examples/videointelligence/v1p3beta1/VideoDetectLogoBeta.java b/samples/generated/src/main/java/com/google/cloud/examples/videointelligence/v1p3beta1/VideoDetectLogoBeta.java
deleted file mode 100644
index e2ddb79b6..000000000
--- a/samples/generated/src/main/java/com/google/cloud/examples/videointelligence/v1p3beta1/VideoDetectLogoBeta.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Copyright 2020 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// DO NOT EDIT! This is a generated sample ("LongRunningRequestAsync", "video_detect_logo_beta")
-// sample-metadata:
-// title:
-// description: Performs asynchronous video annotation for logo recognition from inline video content.
-// usage: gradle run -PmainClass=com.google.cloud.examples.videointelligence.v1p3beta1.VideoDetectLogoBeta [--args='[--local_file_path "resources/googlework_short.mp4"]']
-
-package com.google.cloud.examples.videointelligence.v1p3beta1;
-
-import com.google.api.gax.longrunning.OperationFuture;
-import com.google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress;
-import com.google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest;
-import com.google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse;
-import com.google.cloud.videointelligence.v1p3beta1.DetectedAttribute;
-import com.google.cloud.videointelligence.v1p3beta1.Entity;
-import com.google.cloud.videointelligence.v1p3beta1.Feature;
-import com.google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation;
-import com.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox;
-import com.google.cloud.videointelligence.v1p3beta1.TimestampedObject;
-import com.google.cloud.videointelligence.v1p3beta1.Track;
-import com.google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults;
-import com.google.cloud.videointelligence.v1p3beta1.VideoIntelligenceServiceClient;
-import com.google.cloud.videointelligence.v1p3beta1.VideoSegment;
-import com.google.protobuf.ByteString;
-import com.google.protobuf.Duration;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.Arrays;
-import java.util.List;
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.DefaultParser;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.Options;
-
-public class VideoDetectLogoBeta {
- // [START video_detect_logo_beta]
- /*
- * Please include the following imports to run this sample.
- *
- * import com.google.api.gax.longrunning.OperationFuture;
- * import com.google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress;
- * import com.google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest;
- * import com.google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse;
- * import com.google.cloud.videointelligence.v1p3beta1.DetectedAttribute;
- * import com.google.cloud.videointelligence.v1p3beta1.Entity;
- * import com.google.cloud.videointelligence.v1p3beta1.Feature;
- * import com.google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation;
- * import com.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox;
- * import com.google.cloud.videointelligence.v1p3beta1.TimestampedObject;
- * import com.google.cloud.videointelligence.v1p3beta1.Track;
- * import com.google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults;
- * import com.google.cloud.videointelligence.v1p3beta1.VideoIntelligenceServiceClient;
- * import com.google.cloud.videointelligence.v1p3beta1.VideoSegment;
- * import com.google.protobuf.ByteString;
- * import com.google.protobuf.Duration;
- * import java.nio.file.Files;
- * import java.nio.file.Path;
- * import java.nio.file.Paths;
- * import java.util.Arrays;
- * import java.util.List;
- */
-
- public static void sampleAnnotateVideo() {
- // TODO(developer): Replace these variables before running the sample.
- String localFilePath = "resources/googlework_short.mp4";
- sampleAnnotateVideo(localFilePath);
- }
-
- /**
- * Performs asynchronous video annotation for logo recognition from inline video content.
- *
- * @param localFilePath Path to local video file, e.g. /path/video.mp4
- */
- public static void sampleAnnotateVideo(String localFilePath) {
- try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
- VideoIntelligenceServiceClient.create()) {
- Path path = Paths.get(localFilePath);
- byte[] data = Files.readAllBytes(path);
- ByteString inputContent = ByteString.copyFrom(data);
- Feature featuresElement = Feature.LOGO_RECOGNITION;
- List features = Arrays.asList(featuresElement);
- AnnotateVideoRequest request =
- AnnotateVideoRequest.newBuilder()
- .setInputContent(inputContent)
- .addAllFeatures(features)
- .build();
- OperationFuture future =
- videoIntelligenceServiceClient.annotateVideoAsync(request);
-
- System.out.println("Waiting for operation to complete...");
- AnnotateVideoResponse response = future.get();
- // Get the first response, since we sent only one video.
- VideoAnnotationResults annotationResult = response.getAnnotationResultsList().get(0);
- // Annotations for list of logos detected, tracked and recognized in video.
- for (LogoRecognitionAnnotation logoRecognitionAnnotation :
- annotationResult.getLogoRecognitionAnnotationsList()) {
- Entity entity = logoRecognitionAnnotation.getEntity();
- // Opaque entity ID. Some IDs may be available in [Google Knowledge Graph Search API](https://developers.google.com/knowledge-graph/).
- System.out.printf("Entity Id : %s\n", entity.getEntityId());
- // Textual description, e.g. `Google`.
- System.out.printf("Description : %s\n", entity.getDescription());
- // All logo tracks where the recognized logo appears. Each track corresponds to one logo instance appearing in consecutive frames.
- for (Track track : logoRecognitionAnnotation.getTracksList()) {
- // Video segment of a track.
- VideoSegment segment = track.getSegment();
- Duration segmentStartTimeOffset = segment.getStartTimeOffset();
- System.out.printf(
- "\n\tStart Time Offset : %s.%s\n",
- segmentStartTimeOffset.getSeconds(), segmentStartTimeOffset.getNanos());
- Duration segmentEndTimeOffset = segment.getEndTimeOffset();
- System.out.printf(
- "\tEnd Time Offset : %s.%s\n",
- segmentEndTimeOffset.getSeconds(), segmentEndTimeOffset.getNanos());
- System.out.printf("\tConfidence : %s\n", track.getConfidence());
- // The object with timestamp and attributes per frame in the track.
- for (TimestampedObject timestampedObject : track.getTimestampedObjectsList()) {
- // Normalized Bounding box in a frame, where the object is located.
- NormalizedBoundingBox normalizedBoundingBox =
- timestampedObject.getNormalizedBoundingBox();
- System.out.printf("\n\t\tLeft : %s\n", normalizedBoundingBox.getLeft());
- System.out.printf("\t\tTop : %s\n", normalizedBoundingBox.getTop());
- System.out.printf("\t\tRight : %s\n", normalizedBoundingBox.getRight());
- System.out.printf("\t\tBottom : %s\n", normalizedBoundingBox.getBottom());
- // Optional. The attributes of the object in the bounding box.
- for (DetectedAttribute attribute : timestampedObject.getAttributesList()) {
- System.out.printf("\n\t\t\tName : %s\n", attribute.getName());
- System.out.printf("\t\t\tConfidence : %s\n", attribute.getConfidence());
- System.out.printf("\t\t\tValue : %s\n", attribute.getValue());
- }
- }
- // Optional. Attributes in the track level.
- for (DetectedAttribute trackAttribute : track.getAttributesList()) {
- System.out.printf("\n\t\tName : %s\n", trackAttribute.getName());
- System.out.printf("\t\tConfidence : %s\n", trackAttribute.getConfidence());
- System.out.printf("\t\tValue : %s\n", trackAttribute.getValue());
- }
- }
- // All video segments where the recognized logo appears. There might be multiple instances of the same logo class appearing in one VideoSegment.
- for (VideoSegment logoRecognitionAnnotationSegment :
- logoRecognitionAnnotation.getSegmentsList()) {
- Duration logoRecognitionAnnotationSegmentStartTimeOffset =
- logoRecognitionAnnotationSegment.getStartTimeOffset();
- System.out.printf(
- "\n\tStart Time Offset : %s.%s\n",
- logoRecognitionAnnotationSegmentStartTimeOffset.getSeconds(),
- logoRecognitionAnnotationSegmentStartTimeOffset.getNanos());
- Duration logoRecognitionAnnotationSegmentEndTimeOffset =
- logoRecognitionAnnotationSegment.getEndTimeOffset();
- System.out.printf(
- "\tEnd Time Offset : %s.%s\n",
- logoRecognitionAnnotationSegmentEndTimeOffset.getSeconds(),
- logoRecognitionAnnotationSegmentEndTimeOffset.getNanos());
- }
- }
- } catch (Exception exception) {
- System.err.println("Failed to create the client due to: " + exception);
- }
- }
- // [END video_detect_logo_beta]
-
- public static void main(String[] args) throws Exception {
- Options options = new Options();
- options.addOption(
- Option.builder("").required(false).hasArg(true).longOpt("local_file_path").build());
-
- CommandLine cl = (new DefaultParser()).parse(options, args);
- String localFilePath = cl.getOptionValue("local_file_path", "resources/googlework_short.mp4");
-
- sampleAnnotateVideo(localFilePath);
- }
-}
diff --git a/samples/generated/src/main/java/com/google/cloud/examples/videointelligence/v1p3beta1/VideoDetectLogoGcsBeta.java b/samples/generated/src/main/java/com/google/cloud/examples/videointelligence/v1p3beta1/VideoDetectLogoGcsBeta.java
deleted file mode 100644
index 7de1d44b4..000000000
--- a/samples/generated/src/main/java/com/google/cloud/examples/videointelligence/v1p3beta1/VideoDetectLogoGcsBeta.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright 2020 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// DO NOT EDIT! This is a generated sample ("LongRunningRequestAsync", "video_detect_logo_gcs_beta")
-// sample-metadata:
-// title:
-// description: Performs asynchronous video annotation for logo recognition on a file hosted in GCS.
-// usage: gradle run -PmainClass=com.google.cloud.examples.videointelligence.v1p3beta1.VideoDetectLogoGcsBeta
-
-package com.google.cloud.examples.videointelligence.v1p3beta1;
-
-import com.google.api.gax.longrunning.OperationFuture;
-import com.google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress;
-import com.google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest;
-import com.google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse;
-import com.google.cloud.videointelligence.v1p3beta1.DetectedAttribute;
-import com.google.cloud.videointelligence.v1p3beta1.Entity;
-import com.google.cloud.videointelligence.v1p3beta1.Feature;
-import com.google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation;
-import com.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox;
-import com.google.cloud.videointelligence.v1p3beta1.TimestampedObject;
-import com.google.cloud.videointelligence.v1p3beta1.Track;
-import com.google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults;
-import com.google.cloud.videointelligence.v1p3beta1.VideoIntelligenceServiceClient;
-import com.google.cloud.videointelligence.v1p3beta1.VideoSegment;
-import com.google.protobuf.Duration;
-import java.util.Arrays;
-import java.util.List;
-
-public class VideoDetectLogoGcsBeta {
- // [START video_detect_logo_gcs_beta]
- /*
- * Please include the following imports to run this sample.
- *
- * import com.google.api.gax.longrunning.OperationFuture;
- * import com.google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress;
- * import com.google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest;
- * import com.google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse;
- * import com.google.cloud.videointelligence.v1p3beta1.DetectedAttribute;
- * import com.google.cloud.videointelligence.v1p3beta1.Entity;
- * import com.google.cloud.videointelligence.v1p3beta1.Feature;
- * import com.google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation;
- * import com.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox;
- * import com.google.cloud.videointelligence.v1p3beta1.TimestampedObject;
- * import com.google.cloud.videointelligence.v1p3beta1.Track;
- * import com.google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults;
- * import com.google.cloud.videointelligence.v1p3beta1.VideoIntelligenceServiceClient;
- * import com.google.cloud.videointelligence.v1p3beta1.VideoSegment;
- * import com.google.protobuf.Duration;
- * import java.util.Arrays;
- * import java.util.List;
- */
-
- /** Performs asynchronous video annotation for logo recognition on a file hosted in GCS. */
- public static void sampleAnnotateVideo() {
- try (VideoIntelligenceServiceClient videoIntelligenceServiceClient =
- VideoIntelligenceServiceClient.create()) {
- String inputUri = "gs://cloud-samples-data/video/googlework_short.mp4";
- Feature featuresElement = Feature.LOGO_RECOGNITION;
- List features = Arrays.asList(featuresElement);
- AnnotateVideoRequest request =
- AnnotateVideoRequest.newBuilder().setInputUri(inputUri).addAllFeatures(features).build();
- OperationFuture future =
- videoIntelligenceServiceClient.annotateVideoAsync(request);
-
- System.out.println("Waiting for operation to complete...");
- AnnotateVideoResponse response = future.get();
- // Get the first response, since we sent only one video.
- VideoAnnotationResults annotationResult = response.getAnnotationResultsList().get(0);
- // Annotations for list of logos detected, tracked and recognized in video.
- for (LogoRecognitionAnnotation logoRecognitionAnnotation :
- annotationResult.getLogoRecognitionAnnotationsList()) {
- Entity entity = logoRecognitionAnnotation.getEntity();
- // Opaque entity ID. Some IDs may be available in [Google Knowledge Graph Search API](https://developers.google.com/knowledge-graph/).
- System.out.printf("Entity Id : %s\n", entity.getEntityId());
- // Textual description, e.g. `Google`.
- System.out.printf("Description : %s\n", entity.getDescription());
- // All logo tracks where the recognized logo appears. Each track corresponds to one logo instance appearing in consecutive frames.
- for (Track track : logoRecognitionAnnotation.getTracksList()) {
- // Video segment of a track.
- VideoSegment segment = track.getSegment();
- Duration segmentStartTimeOffset = segment.getStartTimeOffset();
- System.out.printf(
- "\n\tStart Time Offset : %s.%s\n",
- segmentStartTimeOffset.getSeconds(), segmentStartTimeOffset.getNanos());
- Duration segmentEndTimeOffset = segment.getEndTimeOffset();
- System.out.printf(
- "\tEnd Time Offset : %s.%s\n",
- segmentEndTimeOffset.getSeconds(), segmentEndTimeOffset.getNanos());
- System.out.printf("\tConfidence : %s\n", track.getConfidence());
- // The object with timestamp and attributes per frame in the track.
- for (TimestampedObject timestampedObject : track.getTimestampedObjectsList()) {
- // Normalized Bounding box in a frame, where the object is located.
- NormalizedBoundingBox normalizedBoundingBox =
- timestampedObject.getNormalizedBoundingBox();
- System.out.printf("\n\t\tLeft : %s\n", normalizedBoundingBox.getLeft());
- System.out.printf("\t\tTop : %s\n", normalizedBoundingBox.getTop());
- System.out.printf("\t\tRight : %s\n", normalizedBoundingBox.getRight());
- System.out.printf("\t\tBottom : %s\n", normalizedBoundingBox.getBottom());
- // Optional. The attributes of the object in the bounding box.
- for (DetectedAttribute attribute : timestampedObject.getAttributesList()) {
- System.out.printf("\n\t\t\tName : %s\n", attribute.getName());
- System.out.printf("\t\t\tConfidence : %s\n", attribute.getConfidence());
- System.out.printf("\t\t\tValue : %s\n", attribute.getValue());
- }
- }
- // Optional. Attributes in the track level.
- for (DetectedAttribute trackAttribute : track.getAttributesList()) {
- System.out.printf("\n\t\tName : %s\n", trackAttribute.getName());
- System.out.printf("\t\tConfidence : %s\n", trackAttribute.getConfidence());
- System.out.printf("\t\tValue : %s\n", trackAttribute.getValue());
- }
- }
- // All video segments where the recognized logo appears. There might be multiple instances of the same logo class appearing in one VideoSegment.
- for (VideoSegment logoRecognitionAnnotationSegment :
- logoRecognitionAnnotation.getSegmentsList()) {
- Duration logoRecognitionAnnotationSegmentStartTimeOffset =
- logoRecognitionAnnotationSegment.getStartTimeOffset();
- System.out.printf(
- "\n\tStart Time Offset : %s.%s\n",
- logoRecognitionAnnotationSegmentStartTimeOffset.getSeconds(),
- logoRecognitionAnnotationSegmentStartTimeOffset.getNanos());
- Duration logoRecognitionAnnotationSegmentEndTimeOffset =
- logoRecognitionAnnotationSegment.getEndTimeOffset();
- System.out.printf(
- "\tEnd Time Offset : %s.%s\n",
- logoRecognitionAnnotationSegmentEndTimeOffset.getSeconds(),
- logoRecognitionAnnotationSegmentEndTimeOffset.getNanos());
- }
- }
- } catch (Exception exception) {
- System.err.println("Failed to create the client due to: " + exception);
- }
- }
- // [END video_detect_logo_gcs_beta]
-
- public static void main(String[] args) {
- sampleAnnotateVideo();
- }
-}
diff --git a/samples/snippets/src/main/java/beta/video/StreamingAutoMlObjectTracking.java b/samples/snippets/src/main/java/beta/video/StreamingAutoMlObjectTracking.java
index 0c194bad4..7258c341b 100644
--- a/samples/snippets/src/main/java/beta/video/StreamingAutoMlObjectTracking.java
+++ b/samples/snippets/src/main/java/beta/video/StreamingAutoMlObjectTracking.java
@@ -38,8 +38,7 @@
class StreamingAutoMlObjectTracking {
- public static void main(String[] args)
- throws IOException {
+ public static void main(String[] args) throws IOException {
// TODO(developer): Replace these variables before running the sample.
String filePath = "YOUR_VIDEO_FILE";
String projectId = "YOUR_PROJECT_ID";
@@ -64,9 +63,7 @@ static void streamingAutoMlObjectTracking(String filePath, String projectId, Str
String.format("projects/%s/locations/us-central1/models/%s", projectId, modelId);
StreamingAutomlObjectTrackingConfig streamingAutomlObjectTrackingConfig =
- StreamingAutomlObjectTrackingConfig.newBuilder()
- .setModelName(modelPath)
- .build();
+ StreamingAutomlObjectTrackingConfig.newBuilder().setModelName(modelPath).build();
StreamingVideoConfig streamingVideoConfig =
StreamingVideoConfig.newBuilder()
@@ -79,9 +76,7 @@ static void streamingAutoMlObjectTracking(String filePath, String projectId, Str
// The first request must **only** contain the audio configuration:
call.send(
- StreamingAnnotateVideoRequest.newBuilder()
- .setVideoConfig(streamingVideoConfig)
- .build());
+ StreamingAnnotateVideoRequest.newBuilder().setVideoConfig(streamingVideoConfig).build());
// Subsequent requests must **only** contain the audio data.
// Send the requests in chunks
diff --git a/samples/snippets/src/main/java/beta/video/StreamingShotChangeDetection.java b/samples/snippets/src/main/java/beta/video/StreamingShotChangeDetection.java
index 29d0549ef..8ce99489b 100644
--- a/samples/snippets/src/main/java/beta/video/StreamingShotChangeDetection.java
+++ b/samples/snippets/src/main/java/beta/video/StreamingShotChangeDetection.java
@@ -86,8 +86,8 @@ static void streamingShotChangeDetection(String filePath)
StreamingVideoAnnotationResults annotationResults = response.getAnnotationResults();
if (response.hasError()) {
System.out.println(response.getError().getMessage());
- System.out.format("Error was occured with the following status: %s\n",
- response.getError());
+ System.out.format(
+ "Error was occured with the following status: %s\n", response.getError());
}
for (VideoSegment segment : annotationResults.getShotAnnotationsList()) {
double startTimeOffset =
diff --git a/samples/snippets/src/main/java/com/example/video/Detect.java b/samples/snippets/src/main/java/com/example/video/Detect.java
index b917c1edb..ec6433872 100644
--- a/samples/snippets/src/main/java/com/example/video/Detect.java
+++ b/samples/snippets/src/main/java/com/example/video/Detect.java
@@ -40,8 +40,6 @@
import java.nio.file.Paths;
import java.util.concurrent.TimeUnit;
-
-
public class Detect {
/**
* Detects labels, shots, and explicit content in a video using the Video Intelligence API
@@ -61,7 +59,6 @@ public static void main(String[] args) {
* Helper that handles the input passed to the program.
*
* @param args specifies features to detect and the path to the video on Google Cloud Storage.
- *
* @throws IOException on Input/Output errors.
*/
public static void argsHelper(String[] args) throws Exception {
@@ -106,10 +103,11 @@ public static void analyzeLabels(String gcsUri) throws Exception {
// Instantiate a com.google.cloud.videointelligence.v1.VideoIntelligenceServiceClient
try (VideoIntelligenceServiceClient client = VideoIntelligenceServiceClient.create()) {
// Provide path to file hosted on GCS as "gs://bucket-name/..."
- AnnotateVideoRequest request = AnnotateVideoRequest.newBuilder()
- .setInputUri(gcsUri)
- .addFeatures(Feature.LABEL_DETECTION)
- .build();
+ AnnotateVideoRequest request =
+ AnnotateVideoRequest.newBuilder()
+ .setInputUri(gcsUri)
+ .addFeatures(Feature.LABEL_DETECTION)
+ .build();
// Create an operation that will contain the response when the operation completes.
OperationFuture response =
client.annotateVideoAsync(request);
@@ -119,18 +117,19 @@ public static void analyzeLabels(String gcsUri) throws Exception {
// process video / segment level label annotations
System.out.println("Locations: ");
for (LabelAnnotation labelAnnotation : results.getSegmentLabelAnnotationsList()) {
- System.out
- .println("Video label: " + labelAnnotation.getEntity().getDescription());
+ System.out.println("Video label: " + labelAnnotation.getEntity().getDescription());
// categories
for (Entity categoryEntity : labelAnnotation.getCategoryEntitiesList()) {
System.out.println("Video label category: " + categoryEntity.getDescription());
}
// segments
for (LabelSegment segment : labelAnnotation.getSegmentsList()) {
- double startTime = segment.getSegment().getStartTimeOffset().getSeconds()
- + segment.getSegment().getStartTimeOffset().getNanos() / 1e9;
- double endTime = segment.getSegment().getEndTimeOffset().getSeconds()
- + segment.getSegment().getEndTimeOffset().getNanos() / 1e9;
+ double startTime =
+ segment.getSegment().getStartTimeOffset().getSeconds()
+ + segment.getSegment().getStartTimeOffset().getNanos() / 1e9;
+ double endTime =
+ segment.getSegment().getEndTimeOffset().getSeconds()
+ + segment.getSegment().getEndTimeOffset().getNanos() / 1e9;
System.out.printf("Segment location: %.3f:%.3f\n", startTime, endTime);
System.out.println("Confidence: " + segment.getConfidence());
}
@@ -138,18 +137,19 @@ public static void analyzeLabels(String gcsUri) throws Exception {
// process shot label annotations
for (LabelAnnotation labelAnnotation : results.getShotLabelAnnotationsList()) {
- System.out
- .println("Shot label: " + labelAnnotation.getEntity().getDescription());
+ System.out.println("Shot label: " + labelAnnotation.getEntity().getDescription());
// categories
for (Entity categoryEntity : labelAnnotation.getCategoryEntitiesList()) {
System.out.println("Shot label category: " + categoryEntity.getDescription());
}
// segments
for (LabelSegment segment : labelAnnotation.getSegmentsList()) {
- double startTime = segment.getSegment().getStartTimeOffset().getSeconds()
- + segment.getSegment().getStartTimeOffset().getNanos() / 1e9;
- double endTime = segment.getSegment().getEndTimeOffset().getSeconds()
- + segment.getSegment().getEndTimeOffset().getNanos() / 1e9;
+ double startTime =
+ segment.getSegment().getStartTimeOffset().getSeconds()
+ + segment.getSegment().getStartTimeOffset().getNanos() / 1e9;
+ double endTime =
+ segment.getSegment().getEndTimeOffset().getSeconds()
+ + segment.getSegment().getEndTimeOffset().getNanos() / 1e9;
System.out.printf("Segment location: %.3f:%.3f\n", startTime, endTime);
System.out.println("Confidence: " + segment.getConfidence());
}
@@ -157,18 +157,19 @@ public static void analyzeLabels(String gcsUri) throws Exception {
// process frame label annotations
for (LabelAnnotation labelAnnotation : results.getFrameLabelAnnotationsList()) {
- System.out
- .println("Frame label: " + labelAnnotation.getEntity().getDescription());
+ System.out.println("Frame label: " + labelAnnotation.getEntity().getDescription());
// categories
for (Entity categoryEntity : labelAnnotation.getCategoryEntitiesList()) {
System.out.println("Frame label category: " + categoryEntity.getDescription());
}
// segments
for (LabelSegment segment : labelAnnotation.getSegmentsList()) {
- double startTime = segment.getSegment().getStartTimeOffset().getSeconds()
- + segment.getSegment().getStartTimeOffset().getNanos() / 1e9;
- double endTime = segment.getSegment().getEndTimeOffset().getSeconds()
- + segment.getSegment().getEndTimeOffset().getNanos() / 1e9;
+ double startTime =
+ segment.getSegment().getStartTimeOffset().getSeconds()
+ + segment.getSegment().getStartTimeOffset().getNanos() / 1e9;
+ double endTime =
+ segment.getSegment().getEndTimeOffset().getSeconds()
+ + segment.getSegment().getEndTimeOffset().getNanos() / 1e9;
System.out.printf("Segment location: %.3f:%.2f\n", startTime, endTime);
System.out.println("Confidence: " + segment.getConfidence());
}
@@ -191,10 +192,11 @@ public static void analyzeLabelsFile(String filePath) throws Exception {
Path path = Paths.get(filePath);
byte[] data = Files.readAllBytes(path);
- AnnotateVideoRequest request = AnnotateVideoRequest.newBuilder()
- .setInputContent(ByteString.copyFrom(data))
- .addFeatures(Feature.LABEL_DETECTION)
- .build();
+ AnnotateVideoRequest request =
+ AnnotateVideoRequest.newBuilder()
+ .setInputContent(ByteString.copyFrom(data))
+ .addFeatures(Feature.LABEL_DETECTION)
+ .build();
// Create an operation that will contain the response when the operation completes.
OperationFuture response =
client.annotateVideoAsync(request);
@@ -204,18 +206,19 @@ public static void analyzeLabelsFile(String filePath) throws Exception {
// process video / segment level label annotations
System.out.println("Locations: ");
for (LabelAnnotation labelAnnotation : results.getSegmentLabelAnnotationsList()) {
- System.out
- .println("Video label: " + labelAnnotation.getEntity().getDescription());
+ System.out.println("Video label: " + labelAnnotation.getEntity().getDescription());
// categories
for (Entity categoryEntity : labelAnnotation.getCategoryEntitiesList()) {
System.out.println("Video label category: " + categoryEntity.getDescription());
}
// segments
for (LabelSegment segment : labelAnnotation.getSegmentsList()) {
- double startTime = segment.getSegment().getStartTimeOffset().getSeconds()
- + segment.getSegment().getStartTimeOffset().getNanos() / 1e9;
- double endTime = segment.getSegment().getEndTimeOffset().getSeconds()
- + segment.getSegment().getEndTimeOffset().getNanos() / 1e9;
+ double startTime =
+ segment.getSegment().getStartTimeOffset().getSeconds()
+ + segment.getSegment().getStartTimeOffset().getNanos() / 1e9;
+ double endTime =
+ segment.getSegment().getEndTimeOffset().getSeconds()
+ + segment.getSegment().getEndTimeOffset().getNanos() / 1e9;
System.out.printf("Segment location: %.3f:%.2f\n", startTime, endTime);
System.out.println("Confidence: " + segment.getConfidence());
}
@@ -223,18 +226,19 @@ public static void analyzeLabelsFile(String filePath) throws Exception {
// process shot label annotations
for (LabelAnnotation labelAnnotation : results.getShotLabelAnnotationsList()) {
- System.out
- .println("Shot label: " + labelAnnotation.getEntity().getDescription());
+ System.out.println("Shot label: " + labelAnnotation.getEntity().getDescription());
// categories
for (Entity categoryEntity : labelAnnotation.getCategoryEntitiesList()) {
System.out.println("Shot label category: " + categoryEntity.getDescription());
}
// segments
for (LabelSegment segment : labelAnnotation.getSegmentsList()) {
- double startTime = segment.getSegment().getStartTimeOffset().getSeconds()
- + segment.getSegment().getStartTimeOffset().getNanos() / 1e9;
- double endTime = segment.getSegment().getEndTimeOffset().getSeconds()
- + segment.getSegment().getEndTimeOffset().getNanos() / 1e9;
+ double startTime =
+ segment.getSegment().getStartTimeOffset().getSeconds()
+ + segment.getSegment().getStartTimeOffset().getNanos() / 1e9;
+ double endTime =
+ segment.getSegment().getEndTimeOffset().getSeconds()
+ + segment.getSegment().getEndTimeOffset().getNanos() / 1e9;
System.out.printf("Segment location: %.3f:%.2f\n", startTime, endTime);
System.out.println("Confidence: " + segment.getConfidence());
}
@@ -242,18 +246,19 @@ public static void analyzeLabelsFile(String filePath) throws Exception {
// process frame label annotations
for (LabelAnnotation labelAnnotation : results.getFrameLabelAnnotationsList()) {
- System.out
- .println("Frame label: " + labelAnnotation.getEntity().getDescription());
+ System.out.println("Frame label: " + labelAnnotation.getEntity().getDescription());
// categories
for (Entity categoryEntity : labelAnnotation.getCategoryEntitiesList()) {
System.out.println("Frame label category: " + categoryEntity.getDescription());
}
// segments
for (LabelSegment segment : labelAnnotation.getSegmentsList()) {
- double startTime = segment.getSegment().getStartTimeOffset().getSeconds()
- + segment.getSegment().getStartTimeOffset().getNanos() / 1e9;
- double endTime = segment.getSegment().getEndTimeOffset().getSeconds()
- + segment.getSegment().getEndTimeOffset().getNanos() / 1e9;
+ double startTime =
+ segment.getSegment().getStartTimeOffset().getSeconds()
+ + segment.getSegment().getStartTimeOffset().getNanos() / 1e9;
+ double endTime =
+ segment.getSegment().getEndTimeOffset().getSeconds()
+ + segment.getSegment().getEndTimeOffset().getNanos() / 1e9;
System.out.printf("Segment location: %.3f:%.2f\n", startTime, endTime);
System.out.println("Confidence: " + segment.getConfidence());
}
@@ -273,10 +278,11 @@ public static void analyzeShots(String gcsUri) throws Exception {
// Instantiate a com.google.cloud.videointelligence.v1.VideoIntelligenceServiceClient
try (VideoIntelligenceServiceClient client = VideoIntelligenceServiceClient.create()) {
// Provide path to file hosted on GCS as "gs://bucket-name/..."
- AnnotateVideoRequest request = AnnotateVideoRequest.newBuilder()
- .setInputUri(gcsUri)
- .addFeatures(Feature.SHOT_CHANGE_DETECTION)
- .build();
+ AnnotateVideoRequest request =
+ AnnotateVideoRequest.newBuilder()
+ .setInputUri(gcsUri)
+ .addFeatures(Feature.SHOT_CHANGE_DETECTION)
+ .build();
// Create an operation that will contain the response when the operation completes.
OperationFuture response =
@@ -288,10 +294,12 @@ public static void analyzeShots(String gcsUri) throws Exception {
if (result.getShotAnnotationsCount() > 0) {
System.out.println("Shots: ");
for (VideoSegment segment : result.getShotAnnotationsList()) {
- double startTime = segment.getStartTimeOffset().getSeconds()
- + segment.getStartTimeOffset().getNanos() / 1e9;
- double endTime = segment.getEndTimeOffset().getSeconds()
- + segment.getEndTimeOffset().getNanos() / 1e9;
+ double startTime =
+ segment.getStartTimeOffset().getSeconds()
+ + segment.getStartTimeOffset().getNanos() / 1e9;
+ double endTime =
+ segment.getEndTimeOffset().getSeconds()
+ + segment.getEndTimeOffset().getNanos() / 1e9;
System.out.printf("Location: %.3f:%.3f\n", startTime, endTime);
}
} else {
@@ -312,10 +320,11 @@ public static void analyzeExplicitContent(String gcsUri) throws Exception {
// Instantiate a com.google.cloud.videointelligence.v1.VideoIntelligenceServiceClient
try (VideoIntelligenceServiceClient client = VideoIntelligenceServiceClient.create()) {
// Create an operation that will contain the response when the operation completes.
- AnnotateVideoRequest request = AnnotateVideoRequest.newBuilder()
- .setInputUri(gcsUri)
- .addFeatures(Feature.EXPLICIT_CONTENT_DETECTION)
- .build();
+ AnnotateVideoRequest request =
+ AnnotateVideoRequest.newBuilder()
+ .setInputUri(gcsUri)
+ .addFeatures(Feature.EXPLICIT_CONTENT_DETECTION)
+ .build();
OperationFuture response =
client.annotateVideoAsync(request);
@@ -344,18 +353,18 @@ public static void speechTranscription(String gcsUri) throws Exception {
// Instantiate a com.google.cloud.videointelligence.v1.VideoIntelligenceServiceClient
try (VideoIntelligenceServiceClient client = VideoIntelligenceServiceClient.create()) {
// Set the language code
- SpeechTranscriptionConfig config = SpeechTranscriptionConfig.newBuilder()
+ SpeechTranscriptionConfig config =
+ SpeechTranscriptionConfig.newBuilder()
.setLanguageCode("en-US")
.setEnableAutomaticPunctuation(true)
.build();
// Set the video context with the above configuration
- VideoContext context = VideoContext.newBuilder()
- .setSpeechTranscriptionConfig(config)
- .build();
+ VideoContext context = VideoContext.newBuilder().setSpeechTranscriptionConfig(config).build();
// Create the request
- AnnotateVideoRequest request = AnnotateVideoRequest.newBuilder()
+ AnnotateVideoRequest request =
+ AnnotateVideoRequest.newBuilder()
.setInputUri(gcsUri)
.addFeatures(Feature.SPEECH_TRANSCRIPTION)
.setVideoContext(context)
@@ -363,12 +372,12 @@ public static void speechTranscription(String gcsUri) throws Exception {
// asynchronously perform speech transcription on videos
OperationFuture response =
- client.annotateVideoAsync(request);
+ client.annotateVideoAsync(request);
System.out.println("Waiting for operation to complete...");
// Display the results
- for (VideoAnnotationResults results : response.get(600, TimeUnit.SECONDS)
- .getAnnotationResultsList()) {
+ for (VideoAnnotationResults results :
+ response.get(600, TimeUnit.SECONDS).getAnnotationResultsList()) {
for (SpeechTranscription speechTranscription : results.getSpeechTranscriptionsList()) {
try {
// Print the transcription
@@ -380,12 +389,12 @@ public static void speechTranscription(String gcsUri) throws Exception {
System.out.println("Word level information:");
for (WordInfo wordInfo : alternative.getWordsList()) {
- double startTime = wordInfo.getStartTime().getSeconds()
- + wordInfo.getStartTime().getNanos() / 1e9;
- double endTime = wordInfo.getEndTime().getSeconds()
- + wordInfo.getEndTime().getNanos() / 1e9;
- System.out.printf("\t%4.2fs - %4.2fs: %s\n",
- startTime, endTime, wordInfo.getWord());
+ double startTime =
+ wordInfo.getStartTime().getSeconds() + wordInfo.getStartTime().getNanos() / 1e9;
+ double endTime =
+ wordInfo.getEndTime().getSeconds() + wordInfo.getEndTime().getNanos() / 1e9;
+ System.out.printf(
+ "\t%4.2fs - %4.2fs: %s\n", startTime, endTime, wordInfo.getWord());
}
} else {
System.out.println("No transcription found");
@@ -398,4 +407,4 @@ public static void speechTranscription(String gcsUri) throws Exception {
}
// [END video_speech_transcription_gcs]
}
-}
\ No newline at end of file
+}
diff --git a/samples/snippets/src/main/java/com/example/video/QuickstartSample.java b/samples/snippets/src/main/java/com/example/video/QuickstartSample.java
index 86c226371..f46d8d84a 100644
--- a/samples/snippets/src/main/java/com/example/video/QuickstartSample.java
+++ b/samples/snippets/src/main/java/com/example/video/QuickstartSample.java
@@ -32,9 +32,7 @@
public class QuickstartSample {
- /**
- * Demonstrates using the video intelligence client to detect labels in a video file.
- */
+ /** Demonstrates using the video intelligence client to detect labels in a video file. */
public static void main(String[] args) throws Exception {
// Instantiate a video intelligence client
try (VideoIntelligenceServiceClient client = VideoIntelligenceServiceClient.create()) {
@@ -42,10 +40,11 @@ public static void main(String[] args) throws Exception {
String gcsUri = "gs://cloud-samples-data/video/cat.mp4";
// Create an operation that will contain the response when the operation completes.
- AnnotateVideoRequest request = AnnotateVideoRequest.newBuilder()
- .setInputUri(gcsUri)
- .addFeatures(Feature.LABEL_DETECTION)
- .build();
+ AnnotateVideoRequest request =
+ AnnotateVideoRequest.newBuilder()
+ .setInputUri(gcsUri)
+ .addFeatures(Feature.LABEL_DETECTION)
+ .build();
OperationFuture response =
client.annotateVideoAsync(request);
@@ -61,18 +60,20 @@ public static void main(String[] args) throws Exception {
System.out.println("Labels:");
// get video segment label annotations
for (LabelAnnotation annotation : result.getSegmentLabelAnnotationsList()) {
- System.out
- .println("Video label description : " + annotation.getEntity().getDescription());
+ System.out.println(
+ "Video label description : " + annotation.getEntity().getDescription());
// categories
for (Entity categoryEntity : annotation.getCategoryEntitiesList()) {
System.out.println("Label Category description : " + categoryEntity.getDescription());
}
// segments
for (LabelSegment segment : annotation.getSegmentsList()) {
- double startTime = segment.getSegment().getStartTimeOffset().getSeconds()
- + segment.getSegment().getStartTimeOffset().getNanos() / 1e9;
- double endTime = segment.getSegment().getEndTimeOffset().getSeconds()
- + segment.getSegment().getEndTimeOffset().getNanos() / 1e9;
+ double startTime =
+ segment.getSegment().getStartTimeOffset().getSeconds()
+ + segment.getSegment().getStartTimeOffset().getNanos() / 1e9;
+ double endTime =
+ segment.getSegment().getEndTimeOffset().getSeconds()
+ + segment.getSegment().getEndTimeOffset().getNanos() / 1e9;
System.out.printf("Segment location : %.3f:%.3f\n", startTime, endTime);
System.out.println("Confidence : " + segment.getConfidence());
}
diff --git a/samples/snippets/src/main/java/com/example/video/TextDetection.java b/samples/snippets/src/main/java/com/example/video/TextDetection.java
index ef5064184..dd823298c 100644
--- a/samples/snippets/src/main/java/com/example/video/TextDetection.java
+++ b/samples/snippets/src/main/java/com/example/video/TextDetection.java
@@ -51,10 +51,11 @@ public static VideoAnnotationResults detectText(String filePath) throws Exceptio
byte[] data = Files.readAllBytes(path);
// Create the request
- AnnotateVideoRequest request = AnnotateVideoRequest.newBuilder()
- .setInputContent(ByteString.copyFrom(data))
- .addFeatures(Feature.TEXT_DETECTION)
- .build();
+ AnnotateVideoRequest request =
+ AnnotateVideoRequest.newBuilder()
+ .setInputContent(ByteString.copyFrom(data))
+ .addFeatures(Feature.TEXT_DETECTION)
+ .build();
// asynchronously perform object tracking on videos
OperationFuture future =
@@ -77,25 +78,29 @@ public static VideoAnnotationResults detectText(String filePath) throws Exceptio
Duration startTimeOffset = videoSegment.getStartTimeOffset();
Duration endTimeOffset = videoSegment.getEndTimeOffset();
// Display the offset times in seconds, 1e9 is part of the formula to convert nanos to seconds
- System.out.println(String.format("Start time: %.2f",
- startTimeOffset.getSeconds() + startTimeOffset.getNanos() / 1e9));
- System.out.println(String.format("End time: %.2f",
- endTimeOffset.getSeconds() + endTimeOffset.getNanos() / 1e9));
+ System.out.println(
+ String.format(
+ "Start time: %.2f", startTimeOffset.getSeconds() + startTimeOffset.getNanos() / 1e9));
+ System.out.println(
+ String.format(
+ "End time: %.2f", endTimeOffset.getSeconds() + endTimeOffset.getNanos() / 1e9));
// Show the first result for the first frame in the segment.
TextFrame textFrame = textSegment.getFrames(0);
Duration timeOffset = textFrame.getTimeOffset();
- System.out.println(String.format("Time offset for the first frame: %.2f",
- timeOffset.getSeconds() + timeOffset.getNanos() / 1e9));
+ System.out.println(
+ String.format(
+ "Time offset for the first frame: %.2f",
+ timeOffset.getSeconds() + timeOffset.getNanos() / 1e9));
// Display the rotated bounding box for where the text is on the frame.
System.out.println("Rotated Bounding Box Vertices:");
List vertices = textFrame.getRotatedBoundingBox().getVerticesList();
for (NormalizedVertex normalizedVertex : vertices) {
- System.out.println(String.format(
- "\tVertex.x: %.2f, Vertex.y: %.2f",
- normalizedVertex.getX(),
- normalizedVertex.getY()));
+ System.out.println(
+ String.format(
+ "\tVertex.x: %.2f, Vertex.y: %.2f",
+ normalizedVertex.getX(), normalizedVertex.getY()));
}
return results;
}
@@ -111,10 +116,11 @@ public static VideoAnnotationResults detectText(String filePath) throws Exceptio
public static VideoAnnotationResults detectTextGcs(String gcsUri) throws Exception {
try (VideoIntelligenceServiceClient client = VideoIntelligenceServiceClient.create()) {
// Create the request
- AnnotateVideoRequest request = AnnotateVideoRequest.newBuilder()
- .setInputUri(gcsUri)
- .addFeatures(Feature.TEXT_DETECTION)
- .build();
+ AnnotateVideoRequest request =
+ AnnotateVideoRequest.newBuilder()
+ .setInputUri(gcsUri)
+ .addFeatures(Feature.TEXT_DETECTION)
+ .build();
// asynchronously perform object tracking on videos
OperationFuture future =
@@ -137,25 +143,29 @@ public static VideoAnnotationResults detectTextGcs(String gcsUri) throws Excepti
Duration startTimeOffset = videoSegment.getStartTimeOffset();
Duration endTimeOffset = videoSegment.getEndTimeOffset();
// Display the offset times in seconds, 1e9 is part of the formula to convert nanos to seconds
- System.out.println(String.format("Start time: %.2f",
- startTimeOffset.getSeconds() + startTimeOffset.getNanos() / 1e9));
- System.out.println(String.format("End time: %.2f",
- endTimeOffset.getSeconds() + endTimeOffset.getNanos() / 1e9));
+ System.out.println(
+ String.format(
+ "Start time: %.2f", startTimeOffset.getSeconds() + startTimeOffset.getNanos() / 1e9));
+ System.out.println(
+ String.format(
+ "End time: %.2f", endTimeOffset.getSeconds() + endTimeOffset.getNanos() / 1e9));
// Show the first result for the first frame in the segment.
TextFrame textFrame = textSegment.getFrames(0);
Duration timeOffset = textFrame.getTimeOffset();
- System.out.println(String.format("Time offset for the first frame: %.2f",
- timeOffset.getSeconds() + timeOffset.getNanos() / 1e9));
+ System.out.println(
+ String.format(
+ "Time offset for the first frame: %.2f",
+ timeOffset.getSeconds() + timeOffset.getNanos() / 1e9));
// Display the rotated bounding box for where the text is on the frame.
System.out.println("Rotated Bounding Box Vertices:");
List vertices = textFrame.getRotatedBoundingBox().getVerticesList();
for (NormalizedVertex normalizedVertex : vertices) {
- System.out.println(String.format(
- "\tVertex.x: %.2f, Vertex.y: %.2f",
- normalizedVertex.getX(),
- normalizedVertex.getY()));
+ System.out.println(
+ String.format(
+ "\tVertex.x: %.2f, Vertex.y: %.2f",
+ normalizedVertex.getX(), normalizedVertex.getY()));
}
return results;
}
diff --git a/samples/snippets/src/main/java/com/example/video/TrackObjects.java b/samples/snippets/src/main/java/com/example/video/TrackObjects.java
index dfef2c486..d9c43df88 100644
--- a/samples/snippets/src/main/java/com/example/video/TrackObjects.java
+++ b/samples/snippets/src/main/java/com/example/video/TrackObjects.java
@@ -50,11 +50,12 @@ public static VideoAnnotationResults trackObjects(String filePath) throws Except
byte[] data = Files.readAllBytes(path);
// Create the request
- AnnotateVideoRequest request = AnnotateVideoRequest.newBuilder()
- .setInputContent(ByteString.copyFrom(data))
- .addFeatures(Feature.OBJECT_TRACKING)
- .setLocationId("us-east1")
- .build();
+ AnnotateVideoRequest request =
+ AnnotateVideoRequest.newBuilder()
+ .setInputContent(ByteString.copyFrom(data))
+ .addFeatures(Feature.OBJECT_TRACKING)
+ .setLocationId("us-east1")
+ .build();
// asynchronously perform object tracking on videos
OperationFuture future =
@@ -80,19 +81,21 @@ public static VideoAnnotationResults trackObjects(String filePath) throws Except
Duration startTimeOffset = videoSegment.getStartTimeOffset();
Duration endTimeOffset = videoSegment.getEndTimeOffset();
// Display the segment time in seconds, 1e9 converts nanos to seconds
- System.out.println(String.format(
- "Segment: %.2fs to %.2fs",
- startTimeOffset.getSeconds() + startTimeOffset.getNanos() / 1e9,
- endTimeOffset.getSeconds() + endTimeOffset.getNanos() / 1e9));
+ System.out.println(
+ String.format(
+ "Segment: %.2fs to %.2fs",
+ startTimeOffset.getSeconds() + startTimeOffset.getNanos() / 1e9,
+ endTimeOffset.getSeconds() + endTimeOffset.getNanos() / 1e9));
}
// Here we print only the bounding box of the first frame in this segment.
ObjectTrackingFrame frame = annotation.getFrames(0);
// Display the offset time in seconds, 1e9 converts nanos to seconds
Duration timeOffset = frame.getTimeOffset();
- System.out.println(String.format(
- "Time offset of the first frame: %.2fs",
- timeOffset.getSeconds() + timeOffset.getNanos() / 1e9));
+ System.out.println(
+ String.format(
+ "Time offset of the first frame: %.2fs",
+ timeOffset.getSeconds() + timeOffset.getNanos() / 1e9));
// Display the bounding box of the detected object
NormalizedBoundingBox normalizedBoundingBox = frame.getNormalizedBoundingBox();
@@ -115,11 +118,12 @@ public static VideoAnnotationResults trackObjects(String filePath) throws Except
public static VideoAnnotationResults trackObjectsGcs(String gcsUri) throws Exception {
try (VideoIntelligenceServiceClient client = VideoIntelligenceServiceClient.create()) {
// Create the request
- AnnotateVideoRequest request = AnnotateVideoRequest.newBuilder()
- .setInputUri(gcsUri)
- .addFeatures(Feature.OBJECT_TRACKING)
- .setLocationId("us-east1")
- .build();
+ AnnotateVideoRequest request =
+ AnnotateVideoRequest.newBuilder()
+ .setInputUri(gcsUri)
+ .addFeatures(Feature.OBJECT_TRACKING)
+ .setLocationId("us-east1")
+ .build();
// asynchronously perform object tracking on videos
OperationFuture future =
@@ -145,19 +149,21 @@ public static VideoAnnotationResults trackObjectsGcs(String gcsUri) throws Excep
Duration startTimeOffset = videoSegment.getStartTimeOffset();
Duration endTimeOffset = videoSegment.getEndTimeOffset();
// Display the segment time in seconds, 1e9 converts nanos to seconds
- System.out.println(String.format(
- "Segment: %.2fs to %.2fs",
- startTimeOffset.getSeconds() + startTimeOffset.getNanos() / 1e9,
- endTimeOffset.getSeconds() + endTimeOffset.getNanos() / 1e9));
+ System.out.println(
+ String.format(
+ "Segment: %.2fs to %.2fs",
+ startTimeOffset.getSeconds() + startTimeOffset.getNanos() / 1e9,
+ endTimeOffset.getSeconds() + endTimeOffset.getNanos() / 1e9));
}
// Here we print only the bounding box of the first frame in this segment.
ObjectTrackingFrame frame = annotation.getFrames(0);
// Display the offset time in seconds, 1e9 converts nanos to seconds
Duration timeOffset = frame.getTimeOffset();
- System.out.println(String.format(
- "Time offset of the first frame: %.2fs",
- timeOffset.getSeconds() + timeOffset.getNanos() / 1e9));
+ System.out.println(
+ String.format(
+ "Time offset of the first frame: %.2fs",
+ timeOffset.getSeconds() + timeOffset.getNanos() / 1e9));
// Display the bounding box of the detected object
NormalizedBoundingBox normalizedBoundingBox = frame.getNormalizedBoundingBox();
diff --git a/samples/snippets/src/test/java/beta/video/StreamingAutoMlObjectTrackingIT.java b/samples/snippets/src/test/java/beta/video/StreamingAutoMlObjectTrackingIT.java
index 9cc486131..2d7f082fe 100644
--- a/samples/snippets/src/test/java/beta/video/StreamingAutoMlObjectTrackingIT.java
+++ b/samples/snippets/src/test/java/beta/video/StreamingAutoMlObjectTrackingIT.java
@@ -21,7 +21,6 @@
import io.grpc.Status;
import io.grpc.StatusRuntimeException;
import java.io.ByteArrayOutputStream;
-import java.io.IOException;
import java.io.PrintStream;
import org.junit.After;
import org.junit.Before;
@@ -78,4 +77,4 @@ public void testStreamingAutoMlObjectTracking() {
}
}
}
-}
\ No newline at end of file
+}
diff --git a/samples/snippets/src/test/java/beta/video/StreamingShotChangeDetectionIT.java b/samples/snippets/src/test/java/beta/video/StreamingShotChangeDetectionIT.java
index a9f669f63..747a18b84 100644
--- a/samples/snippets/src/test/java/beta/video/StreamingShotChangeDetectionIT.java
+++ b/samples/snippets/src/test/java/beta/video/StreamingShotChangeDetectionIT.java
@@ -29,9 +29,7 @@
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
-/**
- * Integration (system) tests for {@link StreamingShotChangeDetection}.
- */
+/** Integration (system) tests for {@link StreamingShotChangeDetection}. */
@RunWith(JUnit4.class)
@SuppressWarnings("checkstyle:abbreviationaswordinname")
public class StreamingShotChangeDetectionIT {
diff --git a/samples/snippets/src/test/java/com/example/video/DetectIT.java b/samples/snippets/src/test/java/com/example/video/DetectIT.java
index b13ce687e..d48ad18cd 100644
--- a/samples/snippets/src/test/java/com/example/video/DetectIT.java
+++ b/samples/snippets/src/test/java/com/example/video/DetectIT.java
@@ -18,7 +18,6 @@
import static com.google.common.truth.Truth.assertThat;
-import com.google.cloud.videointelligence.v1.ObjectTrackingAnnotation;
import com.google.cloud.videointelligence.v1.TextAnnotation;
import com.google.cloud.videointelligence.v1.VideoAnnotationResults;
import java.io.ByteArrayOutputStream;
@@ -31,9 +30,7 @@
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
-/**
- * Tests for video analysis sample.
- */
+/** Tests for video analysis sample. */
@RunWith(JUnit4.class)
@SuppressWarnings("checkstyle:abbreviationaswordinname")
public class DetectIT {
@@ -42,10 +39,21 @@ public class DetectIT {
static final String SHOTS_FILE_LOCATION = "gs://cloud-samples-data/video/gbikes_dinosaur.mp4";
static final String EXPLICIT_CONTENT_LOCATION = "gs://cloud-samples-data/video/cat.mp4";
static final String SPEECH_GCS_LOCATION =
- "gs://java-docs-samples-testing/video/googlework_short.mp4";
- private static final List POSSIBLE_TEXTS = Arrays.asList(
- "Google", "SUR", "SUR", "ROTO", "Vice President", "58oo9", "LONDRES", "OMAR", "PARIS",
- "METRO", "RUE", "CARLO");
+ "gs://java-docs-samples-testing/video/googlework_short.mp4";
+ private static final List POSSIBLE_TEXTS =
+ Arrays.asList(
+ "Google",
+ "SUR",
+ "SUR",
+ "ROTO",
+ "Vice President",
+ "58oo9",
+ "LONDRES",
+ "OMAR",
+ "PARIS",
+ "METRO",
+ "RUE",
+ "CARLO");
private ByteArrayOutputStream bout;
private PrintStream out;
diff --git a/samples/snippets/src/test/java/video/DetectFacesGcsIT.java b/samples/snippets/src/test/java/video/DetectFacesGcsIT.java
index 917b6bc4d..d5e204a5b 100644
--- a/samples/snippets/src/test/java/video/DetectFacesGcsIT.java
+++ b/samples/snippets/src/test/java/video/DetectFacesGcsIT.java
@@ -23,7 +23,6 @@
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import video.DetectFacesGcs;
@SuppressWarnings("checkstyle:AbbreviationAsWordInName")
public class DetectFacesGcsIT {
diff --git a/samples/snippets/src/test/java/video/DetectFacesIT.java b/samples/snippets/src/test/java/video/DetectFacesIT.java
index 384711597..da47d74ef 100644
--- a/samples/snippets/src/test/java/video/DetectFacesIT.java
+++ b/samples/snippets/src/test/java/video/DetectFacesIT.java
@@ -23,7 +23,6 @@
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import video.DetectFaces;
@SuppressWarnings("checkstyle:AbbreviationAsWordInName")
public class DetectFacesIT {
diff --git a/samples/snippets/src/test/java/video/DetectTextTest.java b/samples/snippets/src/test/java/video/DetectTextTest.java
index 55c12f433..7663860af 100644
--- a/samples/snippets/src/test/java/video/DetectTextTest.java
+++ b/samples/snippets/src/test/java/video/DetectTextTest.java
@@ -47,8 +47,7 @@ public class DetectTextTest {
"METRO",
"RUE",
"CARLO");
- @Rule
- public MultipleAttemptsRule multipleAttemptsRule = new MultipleAttemptsRule(3);
+ @Rule public MultipleAttemptsRule multipleAttemptsRule = new MultipleAttemptsRule(3);
private ByteArrayOutputStream bout;
private PrintStream out;
private PrintStream originalPrintStream;
diff --git a/synth.py b/synth.py
deleted file mode 100644
index 45baefe4e..000000000
--- a/synth.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright 2018 Google LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""This script is used to synthesize generated parts of this library."""
-
-import synthtool.gcp as gcp
-import synthtool.languages.java as java
-
-AUTOSYNTH_MULTIPLE_COMMITS = True
-
-gapic = gcp.GAPICBazel()
-
-service = 'videointelligence'
-versions = ['v1', 'v1beta2', 'v1p1beta1', 'v1p2beta1', 'v1p3beta1']
-
-for version in versions:
- java.bazel_library(
- service=service,
- version=version,
- gapic=gapic,
- destination_name="video-intelligence"
- )
-
-java.common_templates()
diff --git a/versions.txt b/versions.txt
index f8a26560d..f1d79c109 100644
--- a/versions.txt
+++ b/versions.txt
@@ -1,15 +1,14 @@
# Format:
# module:released-version:current-version
-proto-google-cloud-video-intelligence-v1p3beta1:0.90.5:0.90.6-SNAPSHOT
-proto-google-cloud-video-intelligence-v1beta2:0.90.5:0.90.6-SNAPSHOT
-proto-google-cloud-video-intelligence-v1p1beta1:0.90.5:0.90.6-SNAPSHOT
-proto-google-cloud-video-intelligence-v1:2.0.5:2.0.6-SNAPSHOT
-proto-google-cloud-video-intelligence-v1p2beta1:0.90.5:0.90.6-SNAPSHOT
+google-cloud-video-intelligence:2.0.5:2.0.6-SNAPSHOT
grpc-google-cloud-video-intelligence-v1p1beta1:0.90.5:0.90.6-SNAPSHOT
grpc-google-cloud-video-intelligence-v1beta2:0.90.5:0.90.6-SNAPSHOT
grpc-google-cloud-video-intelligence-v1:2.0.5:2.0.6-SNAPSHOT
grpc-google-cloud-video-intelligence-v1p2beta1:0.90.5:0.90.6-SNAPSHOT
grpc-google-cloud-video-intelligence-v1p3beta1:0.90.5:0.90.6-SNAPSHOT
-google-cloud-video-intelligence:2.0.5:2.0.6-SNAPSHOT
-google-cloud-video-intelligence-bom:2.0.5:2.0.6-SNAPSHOT
\ No newline at end of file
+proto-google-cloud-video-intelligence-v1p3beta1:0.90.5:0.90.6-SNAPSHOT
+proto-google-cloud-video-intelligence-v1beta2:0.90.5:0.90.6-SNAPSHOT
+proto-google-cloud-video-intelligence-v1p1beta1:0.90.5:0.90.6-SNAPSHOT
+proto-google-cloud-video-intelligence-v1:2.0.5:2.0.6-SNAPSHOT
+proto-google-cloud-video-intelligence-v1p2beta1:0.90.5:0.90.6-SNAPSHOT