diff --git a/vision/face-detection/src/main/java/com/google/cloud/vision/samples/facedetect/FaceDetectApp.java b/vision/face-detection/src/main/java/com/google/cloud/vision/samples/facedetect/FaceDetectApp.java index 11d3c06634a..3ebf525bf3a 100644 --- a/vision/face-detection/src/main/java/com/google/cloud/vision/samples/facedetect/FaceDetectApp.java +++ b/vision/face-detection/src/main/java/com/google/cloud/vision/samples/facedetect/FaceDetectApp.java @@ -16,8 +16,7 @@ package com.google.cloud.vision.samples.facedetect; -// [BEGIN import_libraries] - +// [START vision_face_detection_tutorial_imports] import com.google.api.client.googleapis.auth.oauth2.GoogleCredential; import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport; import com.google.api.client.json.JsonFactory; @@ -45,7 +44,7 @@ import java.security.GeneralSecurityException; import java.util.List; import javax.imageio.ImageIO; -// [END import_libraries] +// [END vision_face_detection_tutorial_imports] /** * A sample application that uses the Vision API to detect faces in an image. @@ -60,7 +59,7 @@ public class FaceDetectApp { private static final int MAX_RESULTS = 4; - // [START main] + // [START vision_face_detection_tutorial_run_application] /** * Annotates an image using the Vision API. */ @@ -85,9 +84,9 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept System.out.printf("Writing to file %s\n", outputPath); app.writeWithFaces(inputPath, outputPath, faces); } - // [END main] + // [END vision_face_detection_tutorial_run_application] - // [START get_vision_service] + // [START vision_face_detection_tutorial_client] /** * Connects to the Vision API using Application Default Credentials. */ @@ -99,7 +98,7 @@ public static Vision getVisionService() throws IOException, GeneralSecurityExcep .setApplicationName(APPLICATION_NAME) .build(); } - // [END get_vision_service] + // [END vision_face_detection_tutorial_client] private final Vision vision; @@ -110,7 +109,7 @@ public FaceDetectApp(Vision vision) { this.vision = vision; } - // [START detect_face] + // [START vision_face_detection_tutorial_send_request] /** * Gets up to {@code maxResults} faces for an image stored at {@code path}. */ @@ -141,9 +140,9 @@ public List detectFaces(Path path, int maxResults) throws IOExce } return response.getFaceAnnotations(); } - // [END detect_face] + // [END vision_face_detection_tutorial_send_request] - // [START highlight_faces] + // [START vision_face_detection_tutorial_process_response] /** * Reads image {@code inputPath} and writes {@code outputPath} with {@code faces} outlined. */ @@ -176,5 +175,5 @@ private static void annotateWithFace(BufferedImage img, FaceAnnotation face) { gfx.setColor(new Color(0x00ff00)); gfx.draw(poly); } - // [END highlight_faces] + // [END vision_face_detection_tutorial_process_response] }