Skip to content

Commit 1053054

Browse files
authored
Merge pull request #666 from GoogleCloudPlatform/videointelligence_v1beta1
Videointelligence v1beta1
2 parents b09f9fd + 6086ba0 commit 1053054

File tree

4 files changed

+606
-0
lines changed

4 files changed

+606
-0
lines changed

video/cloud-client/README.md

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Video Feature Detection Sample
2+
3+
[Google Cloud Video Intelligence API][video] provides feature detection for
4+
videos. This API is part of the larger collection of Cloud Machine Learning
5+
APIs.
6+
7+
This sample Java application demonstrates how to access the Cloud Video API
8+
using the [Google Cloud Client Library for Java][google-cloud-java].
9+
10+
[video]: https://cloud.google.com/video-intelligence/docs/
11+
[google-cloud-java]: https://github.com/GoogleCloudPlatform/google-cloud-java
12+
13+
## Build the sample
14+
15+
Install [Maven](http://maven.apache.org/).
16+
17+
Build your project with:
18+
19+
```
20+
mvn clean compile assembly:single
21+
```
22+
23+
### Analyze a video
24+
Please follow the [Set Up Your Project](https://cloud.google.com/video-intelligence/docs/getting-started#set_up_your_project)
25+
steps in the Quickstart doc to create a project and enable the Google Cloud
26+
Video Intelligence API. Following those steps, make sure that you
27+
[Set Up a Service Account](https://cloud.google.com/video-intelligence/docs/common/auth#set_up_a_service_account),
28+
and export the following environment variable:
29+
30+
```
31+
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/your-project-credentials.json
32+
```
33+
34+
After you have authorized, you can analyze videos.
35+
36+
Detect Faces
37+
```
38+
java -cp target/video-google-cloud-samples-1.0.0-jar-with-dependencies.jar \
39+
com.example.video.Detect faces gs://cloudmleap/video/next/volleyball_court.mp4
40+
```
41+
42+
Detect Labels
43+
```
44+
java -cp target/video-google-cloud-samples-1.0.0-jar-with-dependencies.jar \
45+
com.example.video.Detect labels gs://demomaker/cat.mp4
46+
47+
java -cp target/video-google-cloud-samples-1.0.0-jar-with-dependencies.jar \
48+
com.example.video.Detect labels-file ./resources/cat.mp4
49+
```
50+
51+
Detect Safe Search annotations
52+
```
53+
java -cp target/video-google-cloud-samples-1.0.0-jar-with-dependencies.jar \
54+
com.example.video.Detect safesearch gs://demomaker/cat.mp4
55+
```
56+
57+
Detect Shots
58+
```
59+
java -cp target/video-google-cloud-samples-1.0.0-jar-with-dependencies.jar \
60+
com.example.video.Detect shots gs://cloudmleap/video/next/gbikes_dinosaur.mp4
61+
```

video/cloud-client/pom.xml

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
<!--
2+
Copyright 2017 Google Inc.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
<project>
17+
<modelVersion>4.0.0</modelVersion>
18+
<groupId>com.example.video</groupId>
19+
<artifactId>video-google-cloud-samples</artifactId>
20+
<packaging>jar</packaging>
21+
22+
<!-- Parent defines config for testing & linting. -->
23+
<parent>
24+
<artifactId>doc-samples</artifactId>
25+
<groupId>com.google.cloud</groupId>
26+
<version>1.0.0</version>
27+
<relativePath>../..</relativePath>
28+
</parent>
29+
30+
<properties>
31+
<maven.compiler.target>1.8</maven.compiler.target>
32+
<maven.compiler.source>1.8</maven.compiler.source>
33+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
34+
</properties>
35+
36+
<dependencies>
37+
<!-- [START dependencies] -->
38+
<dependency>
39+
<groupId>com.google.guava</groupId>
40+
<artifactId>guava</artifactId>
41+
<version>20.0</version>
42+
</dependency>
43+
<dependency>
44+
<groupId>com.google.cloud</groupId>
45+
<artifactId>google-cloud</artifactId>
46+
<version>0.18.0-alpha</version>
47+
<exclusions>
48+
<exclusion> <!-- exclude an old version of Guava -->
49+
<groupId>com.google.guava</groupId>
50+
<artifactId>guava-jdk5</artifactId>
51+
</exclusion>
52+
</exclusions>
53+
</dependency>
54+
<dependency>
55+
<groupId>com.google.cloud</groupId>
56+
<artifactId>google-cloud-video-intelligence</artifactId>
57+
<version>0.18.0-alpha</version>
58+
<exclusions>
59+
<exclusion> <!-- exclude an old version of Guava -->
60+
<groupId>com.google.guava</groupId>
61+
<artifactId>guava-jdk5</artifactId>
62+
</exclusion>
63+
</exclusions>
64+
</dependency>
65+
<dependency>
66+
<groupId>com.google.auth</groupId>
67+
<artifactId>google-auth-library-oauth2-http</artifactId>
68+
<version>0.6.1</version>
69+
</dependency>
70+
<dependency>
71+
<groupId>com.google.auth</groupId>
72+
<artifactId>google-auth-library-credentials</artifactId>
73+
<version>0.6.1</version>
74+
</dependency>
75+
<dependency>
76+
<groupId>io.netty</groupId>
77+
<artifactId>netty-tcnative-boringssl-static</artifactId>
78+
<version>1.1.33.Fork26</version>
79+
</dependency>
80+
<!-- [END dependencies] -->
81+
82+
<!-- Test dependencies -->
83+
<dependency>
84+
<groupId>junit</groupId>
85+
<artifactId>junit</artifactId>
86+
<version>4.12</version>
87+
<scope>test</scope>
88+
</dependency>
89+
<dependency>
90+
<groupId>com.google.truth</groupId>
91+
<artifactId>truth</artifactId>
92+
<version>0.31</version>
93+
<scope>test</scope>
94+
</dependency>
95+
</dependencies>
96+
<build>
97+
<plugins>
98+
<plugin>
99+
<artifactId>maven-assembly-plugin</artifactId>
100+
<configuration>
101+
<archive>
102+
<manifest>
103+
<mainClass>com.example.video.Detect</mainClass>
104+
</manifest>
105+
</archive>
106+
<descriptorRefs>
107+
<descriptorRef>jar-with-dependencies</descriptorRef>
108+
</descriptorRefs>
109+
</configuration>
110+
</plugin>
111+
</plugins>
112+
</build>
113+
</project>

0 commit comments

Comments
 (0)