1

我想使用 Google Vision API 进行标签检测。但我想减少标签百分比,但我不知道该怎么做。有人可以帮助我吗?我正在使用一个样本。我正在使用 google 提供的 android 示例 这是代码:

https://github.com/GoogleCloudPlatform/cloud-vision/blob/master/android/CloudVision/app/src/main/java/com/google/sample/cloudvision/MainActivity.java

除此之外,它还显示了结果:

 // add the features we want
     annotateImageRequest.setFeatures(new ArrayList<Feature>() {{
                            Feature labelDetection = new Feature();
                            labelDetection.setType("LABEL_DETECTION");
                            labelDetection.setMaxResults(10);
                            add(labelDetection);
                        }});
4

1 回答 1

0

Do you mean you'd like to show more results (labels)? If this is the case, just increase MAX_LABEL_RESULTS value (the default is set to 10).

In code snippet you posted you just need to change labelDetection.setMaxResults(10); for example to labelDetection.setMaxResults(15);

于 2018-04-18T15:49:56.927 回答