-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
migrate code from googleapis/java-video-intelligence #7425
Merged
Merged
Changes from all commits
Commits
Show all changes
200 commits
Select commit
Hold shift + click to select a range
64500bc
samples: scaffold pom.xml files (#100)
yoshi-automation efa4c49
chore(deps): update dependency com.google.cloud:libraries-bom to v4.3…
renovate-bot 897f84f
chore(deps): update dependency com.google.cloud.samples:shared-config…
renovate-bot 55b2fc3
chore(deps): update dependency com.google.cloud.samples:shared-config…
renovate-bot d46667a
chore(deps): update dependency com.google.cloud:libraries-bom to v4.4…
renovate-bot 97ccbf0
chore(deps): update dependency com.google.cloud:libraries-bom to v4.4…
renovate-bot 791053e
chore(deps): update dependency com.google.cloud.samples:shared-config…
renovate-bot 801a8cc
chore(deps): update dependency com.google.cloud:libraries-bom to v5 (…
renovate-bot bb03f21
chore(deps): update dependency com.google.cloud.samples:shared-config…
renovate-bot 665ca98
chore(deps): update dependency com.google.cloud.samples:shared-config…
renovate-bot 5f454cd
chore(deps): update dependency com.google.cloud:libraries-bom to v5.2…
renovate-bot b85e6c1
chore(deps): update dependency com.google.cloud:libraries-bom to v5.3…
renovate-bot 1bd89d6
chore(deps): update dependency com.google.cloud:libraries-bom to v5.4…
renovate-bot 53b0058
chore(deps): update dependency com.google.cloud:libraries-bom to v5.6…
renovate-bot 346991a
chore(deps): update dependency com.google.cloud.samples:shared-config…
renovate-bot a53782b
chore(deps): update dependency com.google.cloud:libraries-bom to v5.7…
renovate-bot c4025e9
chore(deps): update dependency com.google.cloud:libraries-bom to v6 (…
renovate-bot f5cb21f
chore(deps): update dependency com.google.cloud:libraries-bom to v7 (…
renovate-bot ac19128
chore(deps): update dependency com.google.cloud:libraries-bom to v7.0…
renovate-bot f9ff6e8
chore(deps): update dependency com.google.cloud:libraries-bom to v8 (…
renovate-bot 254882f
chore(deps): update dependency com.google.cloud:libraries-bom to v8.1…
renovate-bot e073e9b
samples: Add video v1p1beta samples for face detection and video tran…
nnegrey eef6e52
samples: Update samples due to changes (#1083)
nnegrey c8ee654
samples: Add automatic punctuation to video speech transcription (#1165)
nnegrey 774053f
samples: Video Intelligence region tag update (#1183)
alixhami 93ee3c7
samples: Added beta samples for video object tracking/text detection …
anguillanneuf 32a08ee
samples: Add beta samples for Video Streaming (#1353)
nnegrey b3debb4
samples: Flaky test fix (#1490)
nnegrey 7c861ce
samples: Add new beta samples for Video Intelligence Streaming with a…
nnegrey 79738ef
samples: feat: face and person detection samples (#2066)
munkhuushmgl 40b41c3
samples: video: move samples out of branch (#2300)
nnegrey d442bfd
samples: video: fix flaky tests (#2376)
nnegrey 4e4b0ab
samples: update shared config (#2443)
averikitsch 81eae9d
samples: video: update .mp4 file used in test (#2550)
nnegrey c7c22d7
samples: samples: fix test (#2872)
stephaniewang526 3b260a0
samples: samples: fix flaky video stream and text Detection tests (#3…
munkhuushmgl 268a3e0
chore(deps): update dependency com.google.cloud:libraries-bom to v9 (…
renovate-bot 3375798
chore(deps): update dependency com.google.cloud:libraries-bom to v10
renovate-bot 89a61d2
chore(deps): update dependency com.google.cloud:libraries-bom to v11 …
renovate-bot 6f59a0a
chore(deps): update dependency com.google.cloud:libraries-bom to v11.…
renovate-bot 76279de
chore(deps): update dependency com.google.cloud:libraries-bom to v12 …
renovate-bot 1833b31
chore(deps): update dependency com.google.cloud.samples:shared-config…
renovate-bot 94fae5e
test(deps): update dependency junit:junit to v4.13.1
renovate-bot 4e8d3b9
chore(deps): update dependency com.google.cloud:libraries-bom to v12.…
renovate-bot 6e9d03f
chore(deps): update dependency com.google.cloud:libraries-bom to v13 …
renovate-bot 7dc8566
chore(deps): update dependency com.google.cloud:libraries-bom to v13.…
renovate-bot dbe2bdc
samples: moving beta samples from java-docs and refactored GA samples…
munkhuushmgl edc5313
test(deps): update dependency com.google.truth:truth to v1.1 (#292)
renovate-bot 58cafe0
chore(deps): update dependency com.google.cloud:libraries-bom to v13.…
renovate-bot e694b5c
chore(deps): update dependency com.google.cloud:libraries-bom to v13.…
renovate-bot 9b2044f
chore(deps): update dependency com.google.cloud:libraries-bom to v13.…
renovate-bot 06c8deb
chore(deps): update dependency com.google.cloud:libraries-bom to v15 …
renovate-bot 888166d
chore(deps): update dependency com.google.cloud:libraries-bom to v16 …
renovate-bot 9ae9a96
samples: update person detection to GA (#344)
telpirion 9d9c5d7
fix: incorrect and misleading attribute description for person detect…
morgandu 1a73332
chore(deps): update dependency com.google.cloud:libraries-bom to v16.…
renovate-bot a4eb81e
chore(deps): update dependency com.google.cloud:libraries-bom to v16.…
renovate-bot 655ffb7
test(deps): update dependency com.google.truth:truth to v1.1.2 (#380)
renovate-bot c6ab32a
chore(deps): update dependency com.google.cloud:libraries-bom to v16.…
renovate-bot eb80dab
docs: generate sample code in the Java microgenerator (#395)
yoshi-automation 88e60b0
test(deps): update dependency junit:junit to v4.13.2 (#398)
renovate-bot e72259f
chore(deps): update dependency com.google.cloud:libraries-bom to v17 …
renovate-bot 80bae8b
chore: removed wrong comment and updated according to python samples …
munkhuushmgl 63ac027
samples: Initial commit of sample
gguuss 149cb7c
samples: Update to published version of client library.
gguuss 4ffb905
samples: Adds quickstart and test for Video
gguuss f3c73d9
samples: updating to latest google-cloud-* dependencies (#723)
jabubake 7a71c6d
samples: Upgrades client to 0.20.1 and addresses changes to long runn…
gguuss de14f66
samples: updating video intelligence sample to 0.21.1-alpha (#812)
jabubake 552cd56
samples: Video Intelligence samples (#849)
jabubake 8aa0ef3
samples: Change request type on certain inspection type (#857)
gguuss f4e357d
samples: Auto-update dependencies. (#912)
dpebot 4ecbe57
samples: Update samples to v1 (#935)
nnegrey 75e79b2
samples: Updates for storage, translate, unittests, and video. (#994)
kurtisvg 08ac2fb
samples: Add video v1p1beta samples for face detection and video tran…
nnegrey 9a5d861
samples: Correct video detect region tags. (#1107)
kurtisvg ab7d443
samples: Video Intelligence region tag update (#1183)
alixhami fd74bbe
samples: Fix broken sample and add test for sample (#1216)
nnegrey 43eb235
samples: feat: video speech transcription (#1264)
anguillanneuf a806f80
samples: Video Intelligence : Object tracking and Text detection (OCR…
nirupa-kumar 1c0951b
samples: Flaky test fix (#1490)
nnegrey af85752
samples: Adding GA samples for Logo detection (#2393)
munkhuushmgl ecf36e2
samples: update shared config (#2443)
averikitsch 36587af
samples: video: update .mp4 file used in test (#2550)
nnegrey 90bf56a
samples: Change video test to not depend on specific inference
gguuss 644d436
chore(deps): update dependency com.google.cloud:libraries-bom to v18 …
renovate-bot 88e3996
chore(deps): update dependency com.google.cloud:libraries-bom to v18.…
renovate-bot 5975b29
chore(deps): update dependency com.google.cloud:libraries-bom to v19 …
renovate-bot d779f64
chore(deps): update dependency com.google.cloud:libraries-bom to v19.…
renovate-bot bd8b41d
chore(deps): update dependency com.google.cloud:libraries-bom to v19.…
renovate-bot cadbf52
samples: updates face and people to v1 (#449)
telpirion 35e4ee5
chore(deps): update dependency com.google.cloud.samples:shared-config…
renovate-bot ed73474
chore(deps): update dependency com.google.cloud:libraries-bom to v20 …
renovate-bot 491e5e7
chore: removed try/catch & added exceptions at method signature (#456)
munkhuushmgl 490a3c6
chore(deps): update dependency com.google.cloud:libraries-bom to v20.…
renovate-bot bb52e8a
chore(deps): update dependency com.google.cloud:libraries-bom to v20.…
renovate-bot bc1427e
chore: removed all catch clauses which were causing error stack trace…
munkhuushmgl 524a742
chore(deps): update dependency com.google.cloud:libraries-bom to v20.…
renovate-bot 7f98e64
deps: update dependency com.google.cloud:google-cloud-core to v1.94.8…
renovate-bot 156c071
chore(deps): update dependency com.google.cloud:libraries-bom to v20.…
renovate-bot 83112bd
chore: increase timeouts for tracking objects samples (#531)
munkhuushmgl a38833b
samples: add streaming_automl_object_tracking sample (#502)
morgandu 0c35b91
test(deps): update dependency com.google.truth:truth to v1.1.3 (#537)
renovate-bot 0b367f9
chore(deps): update dependency com.google.cloud:libraries-bom to v20.…
renovate-bot 9d0055f
chore(deps): update dependency com.google.cloud:libraries-bom to v20.…
renovate-bot 1ce6201
chore(deps): update dependency com.google.cloud.samples:shared-config…
renovate-bot 715bdbb
deps: update dependency com.google.cloud:google-cloud-core to v1.95.1…
renovate-bot abe91b9
deps: update dependency com.google.cloud:google-cloud-core to v1.95.2…
renovate-bot 14ef9c0
chore: added error message for capturing error (#561)
munkhuushmgl 1119af8
chore(deps): update dependency com.google.cloud:libraries-bom to v20.…
renovate-bot 07035aa
deps: update dependency com.google.cloud:google-cloud-core to v1.95.4…
renovate-bot caa2363
chore(deps): update dependency com.google.cloud:libraries-bom to v20.…
renovate-bot 6f93c00
chore(deps): update dependency com.google.cloud:libraries-bom to v20.…
renovate-bot 9d9a89c
deps: update dependency com.google.cloud:google-cloud-core to v2 (#606)
renovate-bot 3844188
deps: update dependency com.google.cloud:google-cloud-core to v2.0.3 …
renovate-bot 0c8de4e
deps: update dependency com.google.cloud:google-cloud-core to v2.0.5 …
renovate-bot 472751d
chore(deps): update dependency com.google.cloud:libraries-bom to v21 …
renovate-bot a627c05
deps: update dependency com.google.cloud:google-cloud-core to v2.1.0 …
renovate-bot d0aa78f
chore(deps): update dependency com.google.cloud:libraries-bom to v22 …
renovate-bot e85c705
deps: update dependency com.google.cloud:google-cloud-core to v2.1.2 …
renovate-bot 229be24
chore: migrate to owlbot (#664)
Neenu1995 c197b28
chore(deps): update dependency com.google.cloud:libraries-bom to v23 …
renovate-bot d778c08
Feat: Add code sample for video streaming action recognition. (#667)
bingatgoogle 191993d
deps: update dependency com.google.cloud:google-cloud-core to v2.1.3 …
renovate-bot cf47b9c
deps: update dependency com.google.cloud:google-cloud-core to v2.1.4 …
renovate-bot d64834e
deps: update dependency com.google.cloud:google-cloud-core to v2.1.6 …
renovate-bot 5cdb87e
deps: update dependency com.google.cloud:google-cloud-core to v2.1.7 …
renovate-bot e4c49f5
chore(deps): update dependency com.google.cloud:libraries-bom to v23.…
renovate-bot ad5c69c
deps: update dependency com.google.cloud:google-cloud-core to v2.1.8 …
renovate-bot 32848ea
deps: update dependency com.google.cloud:google-cloud-core to v2.2.0 …
renovate-bot 67d3c52
chore(deps): update dependency com.google.cloud:libraries-bom to v24 …
renovate-bot 5218932
test: Added retries to DetectLogoGcsTest (#730)
kweinmeister ccd8f08
deps: update dependency com.google.cloud:google-cloud-core to v2.3.0 …
renovate-bot b9cb340
deps: update dependency com.google.cloud:google-cloud-core to v2.3.1 …
renovate-bot 6785f23
deps: update dependency com.google.cloud:google-cloud-core to v2.3.2 …
renovate-bot 1d89e33
deps: update dependency com.google.cloud:google-cloud-core to v2.3.3 …
renovate-bot db2929e
chore(deps): update dependency com.google.cloud.samples:shared-config…
renovate-bot 1333add
chore(deps): update dependency com.google.cloud:libraries-bom to v24.…
renovate-bot bb9f505
chore(deps): update dependency com.google.cloud:libraries-bom to v24.…
renovate-bot a008760
chore(deps): update dependency com.google.cloud:libraries-bom to v24.…
renovate-bot 61cfe26
deps: update dependency com.google.cloud:google-cloud-core to v2.3.4 …
renovate-bot de46f20
deps: update dependency com.google.cloud:google-cloud-core to v2.3.5 …
renovate-bot 3881962
chore(deps): update dependency com.google.cloud:libraries-bom to v24.…
renovate-bot b638c8c
docs: Added retry to DetectIT sample test (#785)
kweinmeister d3ed19f
deps: update dependency com.google.cloud:google-cloud-core to v2.4.0 …
renovate-bot 4e4a2d2
chore(deps): update dependency com.google.cloud:libraries-bom to v24.…
renovate-bot 32b1798
deps: update dependency com.google.cloud:google-cloud-core to v2.5.0 …
renovate-bot b9a7136
test: Add retries to streaming shot change detection test (#809)
kweinmeister a7871e3
deps: update dependency com.google.cloud:google-cloud-core to v2.5.1 …
renovate-bot 512b7cb
deps: update dependency com.google.cloud:google-cloud-core to v2.5.3 …
renovate-bot f47b3d5
deps: update dependency com.google.cloud:google-cloud-core to v2.5.4 …
renovate-bot 2019943
deps: update dependency com.google.cloud:google-cloud-core to v2.5.5 …
renovate-bot d25002c
chore(deps): update dependency com.google.cloud:libraries-bom to v24.…
renovate-bot 744106d
deps: update dependency com.google.cloud:google-cloud-core to v2.5.6 …
renovate-bot 253ffb0
deps: update dependency com.google.cloud:google-cloud-core to v2.5.8 …
renovate-bot 2037956
deps: update dependency com.google.cloud:google-cloud-core to v2.5.9 …
renovate-bot e17a806
chore(deps): update dependency com.google.cloud:libraries-bom to v25 …
renovate-bot ad88b3b
deps: update dependency com.google.cloud:google-cloud-core to v2.5.10…
renovate-bot 7569c98
deps: update dependency com.google.cloud:google-cloud-core to v2.5.11…
renovate-bot 137a755
chore(deps): update dependency com.google.cloud:libraries-bom to v25.…
renovate-bot cf8ca49
deps: update dependency com.google.cloud:google-cloud-core to v2.6.1 …
renovate-bot c47cfde
chore(deps): update dependency com.google.cloud:libraries-bom to v25.…
renovate-bot 5b77573
chore(deps): update dependency com.google.cloud:libraries-bom to v25.…
renovate-bot de06617
deps: update dependency com.google.cloud:google-cloud-core to v2.7.1 …
renovate-bot 540bf03
chore(deps): update dependency com.google.cloud:libraries-bom to v25.…
renovate-bot c9ba84d
deps: update dependency com.google.cloud:google-cloud-core to v2.8.0 …
renovate-bot 912d332
feat: Enable REST transport for most of Java and Go clients (#920)
gcf-owl-bot[bot] cf60a58
fix: update gapic-generator-java with mock service generation fixes (…
gcf-owl-bot[bot] b39552e
deps: update dependency com.google.cloud:google-cloud-core to v2.8.1 …
renovate-bot ebc5e0a
chore(deps): update dependency com.google.cloud:libraries-bom to v26 …
renovate-bot 2f8e80b
deps: update dependency com.google.cloud:google-cloud-core to v2.8.3 …
renovate-bot c7a244e
deps: update dependency com.google.cloud:google-cloud-core to v2.8.4 …
renovate-bot f0809d3
deps: update dependency com.google.cloud:google-cloud-core to v2.8.5 …
renovate-bot 34cfc71
deps: update dependency com.google.cloud:google-cloud-core to v2.8.6 …
renovate-bot a396cba
deps: update dependency com.google.cloud:google-cloud-core to v2.8.7 …
renovate-bot fd1d4f5
deps: update dependency com.google.cloud:google-cloud-core to v2.8.8 …
renovate-bot bdca8aa
chore(deps): update dependency com.google.cloud:libraries-bom to v26.…
renovate-bot 3c252ae
deps: update dependency com.google.cloud:google-cloud-core to v2.8.9 …
renovate-bot 8774747
deps: update dependency com.google.cloud:google-cloud-core to v2.8.10…
renovate-bot d7c357b
chore(deps): update dependency com.google.cloud:libraries-bom to v26.…
renovate-bot 760ba1f
deps: update dependency com.google.cloud:google-cloud-core to v2.8.11…
renovate-bot d88f80e
chore(bazel): Update WORKSPACE files for rules_gapic, gax_java, gener…
gcf-owl-bot[bot] 5cbfc7c
deps: update dependency com.google.cloud:google-cloud-core to v2.8.12…
renovate-bot db1fbbd
chore(deps): update dependency com.google.cloud:libraries-bom to v26.…
renovate-bot 75b2472
deps: update dependency com.google.cloud:google-cloud-core to v2.8.13…
renovate-bot ee24c3d
deps: update dependency com.google.cloud:google-cloud-core to v2.8.14…
renovate-bot 76c73ff
deps: update dependency com.google.cloud:google-cloud-core to v2.8.15…
renovate-bot 7d2da70
deps: update dependency com.google.cloud:google-cloud-core to v2.8.16…
renovate-bot c2d8003
deps: update dependency com.google.cloud:google-cloud-core to v2.8.17…
renovate-bot 3c692bd
deps: update dependency com.google.cloud:google-cloud-core to v2.8.18…
renovate-bot 221b2b6
deps: update dependency com.google.cloud:google-cloud-core to v2.8.19…
renovate-bot 3770888
deps: update dependency com.google.cloud:google-cloud-core to v2.8.20…
renovate-bot c1ad1b1
chore(deps): update dependency com.google.cloud:libraries-bom to v26.…
renovate-bot d0f1c74
deps: update dependency com.google.cloud:google-cloud-core to v2.8.22…
renovate-bot 7f8a62a
Merge remote-tracking branch 'migration/main' into java-video-intelli…
anguillanneuf ed78a85
remove generated samples
anguillanneuf f7e27ea
update region tags in pom to video
anguillanneuf eb31a8b
update readme
anguillanneuf dacfa50
docs: update url
anguillanneuf a68313a
docs: update url
anguillanneuf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,36 @@ | ||
# Video Intelligence Samples have been moved | ||
# [Cloud Video Intelligence: Java Samples](https://github.com/GoogleCloudPlatform/java-docs-samples/tree/main/video) | ||
|
||
[https://github.com/googleapis/java-video-intelligence](https://github.com/googleapis/java-video-intelligence/tree/main/samples). | ||
[![Open in Cloud Shell][shell_img]][shell_link] | ||
|
||
|
||
|
||
## Table of Contents | ||
|
||
* [Build the sample](#build-the-sample) | ||
* [Samples](#samples) | ||
|
||
|
||
## Build the sample | ||
|
||
Install [Maven](http://maven.apache.org/). | ||
|
||
Build your project with: | ||
|
||
``` | ||
mvn clean package -DskipTests=True | ||
``` | ||
|
||
## Samples | ||
|
||
Please follow [Before you begin](https://cloud.google.com/video-intelligence/docs/annotate-video-client-libraries#before-you-begin) for project and auth setup before you run the samples. | ||
|
||
|
||
## Run | ||
Run all tests: | ||
``` | ||
mvn clean verify | ||
``` | ||
|
||
[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png | ||
[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=video/README.md | ||
[product-docs]: https://cloud.google.com/video-intelligence/docs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.google.cloud</groupId> | ||
<artifactId>videointelligence-snippets</artifactId> | ||
<packaging>jar</packaging> | ||
<name>Google Cloud Video Intelligence Snippets</name> | ||
<url>https://github.com/GoogleCloudPlatform/java-docs-samples/tree/main/video</url> | ||
|
||
<!-- | ||
The parent pom defines common style checks and testing strategies for our samples. | ||
Removing or replacing it should not affect the execution of the samples in anyway. | ||
--> | ||
<parent> | ||
<groupId>com.google.cloud.samples</groupId> | ||
<artifactId>shared-configuration</artifactId> | ||
<version>1.2.0</version> | ||
</parent> | ||
|
||
<properties> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
|
||
<!-- [START video_install_with_bom] --> | ||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.google.cloud</groupId> | ||
<artifactId>libraries-bom</artifactId> | ||
<version>26.1.3</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.google.cloud</groupId> | ||
<artifactId>google-cloud-video-intelligence</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.cloud</groupId> | ||
<artifactId>google-cloud-storage</artifactId> | ||
</dependency> | ||
<!-- [END video_install_with_bom] --> | ||
|
||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.13.2</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.truth</groupId> | ||
<artifactId>truth</artifactId> | ||
<version>1.1.3</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.cloud</groupId> | ||
<artifactId>google-cloud-core</artifactId> | ||
<version>2.8.22</version> | ||
<scope>test</scope> | ||
<classifier>tests</classifier> | ||
</dependency> | ||
</dependencies> | ||
</project> |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
/* | ||
* Copyright 2018 Google Inc. | ||
* | ||
* 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. | ||
*/ | ||
|
||
package beta.video; | ||
|
||
import com.google.api.gax.longrunning.OperationFuture; | ||
import com.google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress; | ||
import com.google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest; | ||
import com.google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse; | ||
import com.google.cloud.videointelligence.v1p1beta1.Feature; | ||
import com.google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative; | ||
import com.google.cloud.videointelligence.v1p1beta1.SpeechTranscription; | ||
import com.google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig; | ||
import com.google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults; | ||
import com.google.cloud.videointelligence.v1p1beta1.VideoContext; | ||
import com.google.cloud.videointelligence.v1p1beta1.VideoIntelligenceServiceClient; | ||
import com.google.cloud.videointelligence.v1p1beta1.WordInfo; | ||
import java.io.IOException; | ||
import java.util.concurrent.TimeUnit; | ||
|
||
public class Detect { | ||
/** | ||
* Detects video transcription using the Video Intelligence API | ||
* | ||
* @param args specifies features to detect and the path to the video on Google Cloud Storage. | ||
*/ | ||
public static void main(String[] args) { | ||
try { | ||
argsHelper(args); | ||
} catch (Exception e) { | ||
System.out.println("Exception while running:\n" + e.getMessage() + "\n"); | ||
e.printStackTrace(System.out); | ||
} | ||
} | ||
|
||
/** | ||
* 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 { | ||
if (args.length < 1) { | ||
System.out.println("Usage:"); | ||
System.out.printf( | ||
"\tjava %s \"<command>\" \"<path-to-video>\"\n" | ||
+ "Commands:\n" | ||
+ "\tspeech-transcription\n" | ||
+ "Path:\n\tA URI for a Cloud Storage resource (gs://...)\n" | ||
+ "Examples: ", | ||
Detect.class.getCanonicalName()); | ||
return; | ||
} | ||
String command = args[0]; | ||
String path = args.length > 1 ? args[1] : ""; | ||
|
||
if (command.equals("speech-transcription")) { | ||
speechTranscription(path); | ||
} | ||
} | ||
|
||
// [START video_speech_transcription_gcs_beta] | ||
/** | ||
* Transcribe speech from a video stored on GCS. | ||
* | ||
* @param gcsUri the path to the video file to analyze. | ||
*/ | ||
public static void speechTranscription(String gcsUri) throws Exception { | ||
// Instantiate a com.google.cloud.videointelligence.v1p1beta1.VideoIntelligenceServiceClient | ||
try (VideoIntelligenceServiceClient client = VideoIntelligenceServiceClient.create()) { | ||
// Set the language code | ||
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(); | ||
|
||
// Create the request | ||
AnnotateVideoRequest request = | ||
AnnotateVideoRequest.newBuilder() | ||
.setInputUri(gcsUri) | ||
.addFeatures(Feature.SPEECH_TRANSCRIPTION) | ||
.setVideoContext(context) | ||
.build(); | ||
|
||
// asynchronously perform speech transcription on videos | ||
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> response = | ||
client.annotateVideoAsync(request); | ||
|
||
System.out.println("Waiting for operation to complete..."); | ||
// Display the results | ||
for (VideoAnnotationResults results : | ||
response.get(300, TimeUnit.SECONDS).getAnnotationResultsList()) { | ||
for (SpeechTranscription speechTranscription : results.getSpeechTranscriptionsList()) { | ||
try { | ||
// Print the transcription | ||
if (speechTranscription.getAlternativesCount() > 0) { | ||
SpeechRecognitionAlternative alternative = speechTranscription.getAlternatives(0); | ||
|
||
System.out.printf("Transcript: %s\n", alternative.getTranscript()); | ||
System.out.printf("Confidence: %.2f\n", alternative.getConfidence()); | ||
|
||
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()); | ||
} | ||
} else { | ||
System.out.println("No transcription found"); | ||
} | ||
} catch (IndexOutOfBoundsException ioe) { | ||
System.out.println("Could not retrieve frame: " + ioe.getMessage()); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
// [END video_speech_transcription_gcs_beta] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
/* | ||
* 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 | ||
* | ||
* 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. | ||
*/ | ||
|
||
package beta.video; | ||
|
||
// [START video_detect_logo_beta] | ||
|
||
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.io.IOException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import java.util.concurrent.ExecutionException; | ||
|
||
public class DetectLogo { | ||
|
||
public void detectLogo() throws IOException, ExecutionException, InterruptedException { | ||
String filePath = "path/to/your/video.mp4"; | ||
detectLogo(filePath); | ||
} | ||
|
||
public static void detectLogo(String localFilePath) | ||
throws IOException, ExecutionException, InterruptedException { | ||
// Initialize client that will be used to send requests. This client only needs to be created | ||
// once, and can be reused for multiple requests. After completing all of your requests, call | ||
// the "close" method on the client to safely clean up any remaining background resources. | ||
try (VideoIntelligenceServiceClient client = VideoIntelligenceServiceClient.create()) { | ||
// Read the files contents | ||
Path path = Paths.get(localFilePath); | ||
byte[] data = Files.readAllBytes(path); | ||
ByteString inputContent = ByteString.copyFrom(data); | ||
|
||
// Build the request with the inputContent and set the Feature | ||
AnnotateVideoRequest request = | ||
AnnotateVideoRequest.newBuilder() | ||
.setInputContent(inputContent) | ||
.addFeatures(Feature.LOGO_RECOGNITION) | ||
.build(); | ||
|
||
// Make the asynchronous request | ||
AnnotateVideoResponse response = client.annotateVideoAsync(request).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 the 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()); | ||
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()); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
// [END video_detect_logo_beta] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we update this to
com.example.video
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Shabirmean this looks fine to me as it makes it clear that it's a google cloud sample, any reason for this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was something we discussed in the migration team chat and agreed to use
com.example.<product>
.context: link-1 and link-2
cc: @averikitsch for more insight