Skip to content

Commit d6b926f

Browse files
authored
Merge branch 'master' into automl
2 parents 3c09412 + 7ef8b81 commit d6b926f

File tree

17 files changed

+1602
-1
lines changed

17 files changed

+1602
-1
lines changed

language/automl/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=vision/beta/cloud-client/README.md">
44
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>
55

6+
67
[Google Cloud AutoML Natural Language API][language] provides feature detection for images.
8+
79
This API is part of the larger collection of Cloud Machine Learning APIs.
810

911
This sample Java application demonstrates how to access the Cloud Natural Language AutoML API
1012
using the [Google Cloud Client Library for Java][google-cloud-java].
1113

14+
1215
[language]: https://cloud.google.com/language/automl/docs/
1316
[google-cloud-java]: https://github.com/GoogleCloudPlatform/google-cloud-java
1417

translate/automl/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=vision/beta/cloud-client/README.md">
44
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>
55

6+
67
[Google Cloud AutoML Translation API][translate] provides feature AutoML.
8+
79
This API is part of the larger collection of Cloud Machine Learning APIs.
810

911
This sample Java application demonstrates how to access the Cloud Translate AutoML API
1012
using the [Google Cloud Client Library for Java][google-cloud-java].
1113

14+
1215
[translate]: https://cloud.google.com/translate/automl/docs/
1316
[google-cloud-java]: https://github.com/GoogleCloudPlatform/google-cloud-java
1417

translate/automl/src/main/java/com/google/cloud/translate/automl/PredictionApi.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public class PredictionApi {
6565
*/
6666
public static void predict(
6767
String projectId, String computeRegion, String modelId, String filePath) throws IOException {
68+
6869
// Instantiate client for prediction service.
6970
PredictionServiceClient predictionClient = PredictionServiceClient.create();
7071

@@ -100,6 +101,7 @@ public static void argsHelper(String[] args, PrintStream out) throws IOException
100101
.build()
101102
.defaultHelp(true)
102103
.description("Prediction API Operation");
104+
103105
Subparsers subparsers = parser.addSubparsers().dest("command");
104106

105107
Subparser predictParser = subparsers.addParser("predict");
@@ -114,6 +116,7 @@ public static void argsHelper(String[] args, PrintStream out) throws IOException
114116
ns = parser.parseArgs(args);
115117
if (ns.get("command").equals("predict")) {
116118
predict(projectId, computeRegion, ns.getString("modelId"), ns.getString("filePath"));
119+
117120
}
118121
} catch (ArgumentParserException e) {
119122
parser.handleError(e);

video/beta/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<dependency>
4141
<groupId>com.google.cloud</groupId>
4242
<artifactId>google-cloud-video-intelligence</artifactId>
43-
<version>0.52.0-beta</version>
43+
<version>0.55.1-beta</version>
4444
</dependency>
4545
<!-- [END dependencies] -->
4646

video/beta/src/main/java/com/example/video/Detect.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public static void speechTranscription(String gcsUri) throws Exception {
8484
// Set the language code
8585
SpeechTranscriptionConfig config = SpeechTranscriptionConfig.newBuilder()
8686
.setLanguageCode("en-US")
87+
.setEnableAutomaticPunctuation(true)
8788
.build();
8889

8990
// Set the video context with the above configuration

vision/automl/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>
55

66
[Google Cloud AutoML Vision API][vision] provides feature detection for images.
7+
78
This API is part of the larger collection of Cloud Machine Learning APIs.
89

910
This sample Java application demonstrates how to access the Cloud Vision API
1011
using the [Google Cloud Client Library for Java][google-cloud-java].
1112

13+
1214
[vision]: https://cloud.google.com/vision/automl/docs/
1315
[google-cloud-java]: https://github.com/GoogleCloudPlatform/google-cloud-java
1416

Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
1+
<!--
2+
Copyright 2018 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.vision</groupId>
19+
<artifactId>vision-detect-product-search</artifactId>
20+
<packaging>jar</packaging>
21+
22+
<!--
23+
The parent pom defines common style checks and testing strategies for our samples.
24+
Removing or replacing it should not affect the execution of the samples in anyway.
25+
-->
26+
<parent>
27+
<groupId>com.google.cloud.samples</groupId>
28+
<artifactId>shared-configuration</artifactId>
29+
<version>1.0.9</version>
30+
</parent>
31+
32+
<properties>
33+
<maven.compiler.target>1.8</maven.compiler.target>
34+
<maven.compiler.source>1.8</maven.compiler.source>
35+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
36+
</properties>
37+
38+
<dependencies>
39+
<!-- [START dependencies] -->
40+
<dependency>
41+
<groupId>com.google.cloud</groupId>
42+
<artifactId>google-cloud-vision</artifactId>
43+
<version>1.37.1</version>
44+
</dependency>
45+
<dependency>
46+
<groupId>com.google.cloud</groupId>
47+
<artifactId>google-cloud-storage</artifactId>
48+
<version>1.37.1</version>
49+
</dependency>
50+
<dependency>
51+
<groupId>net.sourceforge.argparse4j</groupId>
52+
<artifactId>argparse4j</artifactId>
53+
<version>0.8.1</version>
54+
</dependency>
55+
<dependency>
56+
<groupId>org.apache.commons</groupId>
57+
<artifactId>commons-csv</artifactId>
58+
<version>1.5</version>
59+
</dependency>
60+
<!-- [END dependencies] -->
61+
62+
<!-- Test dependencies -->
63+
<dependency>
64+
<groupId>junit</groupId>
65+
<artifactId>junit</artifactId>
66+
<version>4.12</version>
67+
<scope>test</scope>
68+
</dependency>
69+
70+
<dependency>
71+
<groupId>com.google.truth</groupId>
72+
<artifactId>truth</artifactId>
73+
<version>0.40</version>
74+
<scope>test</scope>
75+
</dependency>
76+
</dependencies>
77+
78+
<profiles>
79+
<profile>
80+
<id>ImportProductSets</id>
81+
<activation>
82+
<property>
83+
<name>ImportProductSets</name>
84+
</property>
85+
</activation>
86+
<build>
87+
<plugins>
88+
<plugin>
89+
<groupId>org.codehaus.mojo</groupId>
90+
<artifactId>exec-maven-plugin</artifactId>
91+
<version>1.6.0</version>
92+
<executions>
93+
<execution>
94+
<goals>
95+
<goal>java</goal>
96+
</goals>
97+
</execution>
98+
</executions>
99+
<configuration>
100+
<mainClass>com.example.vision.ImportProductSets</mainClass>
101+
<cleanupDaemonThreads>false</cleanupDaemonThreads>
102+
</configuration>
103+
</plugin>
104+
</plugins>
105+
</build>
106+
</profile>
107+
<profile>
108+
<id>ProductInProductSetManagement</id>
109+
<activation>
110+
<property>
111+
<name>ProductInProductSetManagement</name>
112+
</property>
113+
</activation>
114+
<build>
115+
<plugins>
116+
<plugin>
117+
<groupId>org.codehaus.mojo</groupId>
118+
<artifactId>exec-maven-plugin</artifactId>
119+
<version>1.6.0</version>
120+
<executions>
121+
<execution>
122+
<goals>
123+
<goal>java</goal>
124+
</goals>
125+
</execution>
126+
</executions>
127+
<configuration>
128+
<mainClass>com.example.vision.ProductInProductSetManagement</mainClass>
129+
<cleanupDaemonThreads>false</cleanupDaemonThreads>
130+
</configuration>
131+
</plugin>
132+
</plugins>
133+
</build>
134+
</profile>
135+
<profile>
136+
<id>ProductManagement</id>
137+
<activation>
138+
<property>
139+
<name>ProductManagement</name>
140+
</property>
141+
</activation>
142+
<build>
143+
<plugins>
144+
<plugin>
145+
<groupId>org.codehaus.mojo</groupId>
146+
<artifactId>exec-maven-plugin</artifactId>
147+
<version>1.6.0</version>
148+
<executions>
149+
<execution>
150+
<goals>
151+
<goal>java</goal>
152+
</goals>
153+
</execution>
154+
</executions>
155+
<configuration>
156+
<mainClass>com.example.vision.ProductManagement</mainClass>
157+
<cleanupDaemonThreads>false</cleanupDaemonThreads>
158+
</configuration>
159+
</plugin>
160+
</plugins>
161+
</build>
162+
</profile>
163+
<profile>
164+
<id>ProductSearch</id>
165+
<activation>
166+
<property>
167+
<name>ProductSearch</name>
168+
</property>
169+
</activation>
170+
<build>
171+
<plugins>
172+
<plugin>
173+
<groupId>org.codehaus.mojo</groupId>
174+
<artifactId>exec-maven-plugin</artifactId>
175+
<version>1.6.0</version>
176+
<executions>
177+
<execution>
178+
<goals>
179+
<goal>java</goal>
180+
</goals>
181+
</execution>
182+
</executions>
183+
<configuration>
184+
<mainClass>com.example.vision.ProductSearch</mainClass>
185+
<cleanupDaemonThreads>false</cleanupDaemonThreads>
186+
</configuration>
187+
</plugin>
188+
</plugins>
189+
</build>
190+
</profile>
191+
<profile>
192+
<id>ProductSetManagement</id>
193+
<activation>
194+
<property>
195+
<name>ProductSetManagement</name>
196+
</property>
197+
</activation>
198+
<build>
199+
<plugins>
200+
<plugin>
201+
<groupId>org.codehaus.mojo</groupId>
202+
<artifactId>exec-maven-plugin</artifactId>
203+
<version>1.6.0</version>
204+
<executions>
205+
<execution>
206+
<goals>
207+
<goal>java</goal>
208+
</goals>
209+
</execution>
210+
</executions>
211+
<configuration>
212+
<mainClass>com.example.vision.ProductSetManagement</mainClass>
213+
<cleanupDaemonThreads>false</cleanupDaemonThreads>
214+
</configuration>
215+
</plugin>
216+
</plugins>
217+
</build>
218+
</profile>
219+
<profile>
220+
<id>ReferenceImageManagement</id>
221+
<activation>
222+
<property>
223+
<name>ReferenceImageManagement</name>
224+
</property>
225+
</activation>
226+
<build>
227+
<plugins>
228+
<plugin>
229+
<groupId>org.codehaus.mojo</groupId>
230+
<artifactId>exec-maven-plugin</artifactId>
231+
<version>1.6.0</version>
232+
<executions>
233+
<execution>
234+
<goals>
235+
<goal>java</goal>
236+
</goals>
237+
</execution>
238+
</executions>
239+
<configuration>
240+
<mainClass>com.example.vision.ReferenceImageManagement</mainClass>
241+
<cleanupDaemonThreads>false</cleanupDaemonThreads>
242+
</configuration>
243+
</plugin>
244+
</plugins>
245+
</build>
246+
</profile>
247+
</profiles>
248+
</project>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
"gs://java-docs-samples-testing/product-search/shoes_1.jpg","indexed_product_set_id_for_testing","indexed_product_id_for_testing_1","apparel","style=womens","0.1,0.1,0.9,0.1,0.9,0.9,0.1,0.9"
2+
"gs://java-docs-samples-testing/product-search/shoes_2.jpg","indexed_product_set_id_for_testing","indexed_product_id_for_testing_2","apparel",,
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
"gs://java-docs-samples-testing/product-search/shoes_1.jpg","fake_product_set_id_for_testing","fake_product_id_for_testing_1","apparel","style=womens","0.1,0.1,0.9,0.1,0.9,0.9,0.1,0.9"
2+
"gs://java-docs-samples-testing/product-search/shoes_2.jpg","fake_product_set_id_for_testing","fake_product_id_for_testing_2","apparel",,
Loading
Loading

0 commit comments

Comments
 (0)