Issue
Documentation is missing for the most critical APIs for Java Cloud Vision.
Repro
See the Java documentation and try to find the most important classes for the Cloud Vision API, most notably:
- com.google.cloud.vision.v1.AnnotateImageRequest
- com.google.cloud.vision.v1.AnnotateImageResponse
- com.google.cloud.vision.v1.BatchAnnotateImagesResponse
- com.google.cloud.vision.v1.ColorInfo
- com.google.cloud.vision.v1.DominantColorsAnnotation
- com.google.cloud.vision.v1.EntityAnnotation
- com.google.cloud.vision.v1.FaceAnnotation
- com.google.cloud.vision.v1.Feature
- com.google.cloud.vision.v1.Feature.Type
- com.google.cloud.vision.v1.Image
None of these features have documentation and are necessary to understand when using the Cloud Vision client library.
Fix
Please generate and publish the documentation for the com.google.cloud.vision.* APIs.
It may also be helpful to include a nice little snippet demonstrating usage:
public static void detectFaces(String filePath, PrintStream out) throws IOException {
List<AnnotateImageRequest> requests = new ArrayList<>();
FileInputStream file = new FileInputStream(filePath);
ByteString imgBytes = ByteString.copyFrom(toByteArray(file));
Image img = Image.newBuilder().setContent(imgBytes).build();
Feature feat = Feature.newBuilder().setType(Type.FACE_DETECTION).build();
AnnotateImageRequest request = AnnotateImageRequest.newBuilder()
.addFeatures(feat)
.setImage(img)
.build();
requests.add(request);
BatchAnnotateImagesResponse response = visionApi.batchAnnotateImages(requests);
List<AnnotateImageResponse> responses = response.getResponsesList();
for (AnnotateImageResponse res : responses) {
if (res.hasError()) {
out.printf("Error: %s\n", res.getError().getMessage());
}
for (FaceAnnotation annotation : res.getFaceAnnotationsList()) {
out.printf("anger: %s\njoy: %s\nsurprise: %s\n",
annotation.getAngerLikelihood(),
annotation.getJoyLikelihood(),
annotation.getSurpriseLikelihood());
}
}
}
Issue
Documentation is missing for the most critical APIs for Java Cloud Vision.
Repro
See the Java documentation and try to find the most important classes for the Cloud Vision API, most notably:
None of these features have documentation and are necessary to understand when using the Cloud Vision client library.
Fix
Please generate and publish the documentation for the com.google.cloud.vision.* APIs.
It may also be helpful to include a nice little snippet demonstrating usage: