如何使用Java API在一个请求中为LABEL_DETECTION和FACE_DETECTION调用Vision API。 在java-docs-samples中,我没有找到一个请求具有多个功能的示例
答案 0 :(得分:1)
Feature featureFACE = new Feature();
Feature featureLABEL = new Feature();
featureLABEL.setType("LABEL_DETECTION").setMaxResults(maxResults);
featureFACE.setType("FACE_DETECTION").setMaxResults(maxResults);
AnnotateImageRequest request = new AnnotateImageRequest()
.setImage(new Image().encodeContent(data))
.setFeatures(ImmutableList.of(featureFACE,featureLABEL));