Skip to content

Commit d5b4e2b

Browse files
authored
Update Face Detection Tutorial region tags to standard (#1201)
1 parent a88e2ff commit d5b4e2b

File tree

1 file changed

+10
-11
lines changed
  • vision/face-detection/src/main/java/com/google/cloud/vision/samples/facedetect

1 file changed

+10
-11
lines changed

vision/face-detection/src/main/java/com/google/cloud/vision/samples/facedetect/FaceDetectApp.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616

1717
package com.google.cloud.vision.samples.facedetect;
1818

19-
// [BEGIN import_libraries]
20-
19+
// [START vision_face_detection_tutorial_imports]
2120
import com.google.api.client.googleapis.auth.oauth2.GoogleCredential;
2221
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport;
2322
import com.google.api.client.json.JsonFactory;
@@ -45,7 +44,7 @@
4544
import java.security.GeneralSecurityException;
4645
import java.util.List;
4746
import javax.imageio.ImageIO;
48-
// [END import_libraries]
47+
// [END vision_face_detection_tutorial_imports]
4948

5049
/**
5150
* A sample application that uses the Vision API to detect faces in an image.
@@ -60,7 +59,7 @@ public class FaceDetectApp {
6059

6160
private static final int MAX_RESULTS = 4;
6261

63-
// [START main]
62+
// [START vision_face_detection_tutorial_run_application]
6463
/**
6564
* Annotates an image using the Vision API.
6665
*/
@@ -85,9 +84,9 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept
8584
System.out.printf("Writing to file %s\n", outputPath);
8685
app.writeWithFaces(inputPath, outputPath, faces);
8786
}
88-
// [END main]
87+
// [END vision_face_detection_tutorial_run_application]
8988

90-
// [START get_vision_service]
89+
// [START vision_face_detection_tutorial_client]
9190
/**
9291
* Connects to the Vision API using Application Default Credentials.
9392
*/
@@ -99,7 +98,7 @@ public static Vision getVisionService() throws IOException, GeneralSecurityExcep
9998
.setApplicationName(APPLICATION_NAME)
10099
.build();
101100
}
102-
// [END get_vision_service]
101+
// [END vision_face_detection_tutorial_client]
103102

104103
private final Vision vision;
105104

@@ -110,7 +109,7 @@ public FaceDetectApp(Vision vision) {
110109
this.vision = vision;
111110
}
112111

113-
// [START detect_face]
112+
// [START vision_face_detection_tutorial_send_request]
114113
/**
115114
* Gets up to {@code maxResults} faces for an image stored at {@code path}.
116115
*/
@@ -141,9 +140,9 @@ public List<FaceAnnotation> detectFaces(Path path, int maxResults) throws IOExce
141140
}
142141
return response.getFaceAnnotations();
143142
}
144-
// [END detect_face]
143+
// [END vision_face_detection_tutorial_send_request]
145144

146-
// [START highlight_faces]
145+
// [START vision_face_detection_tutorial_process_response]
147146
/**
148147
* Reads image {@code inputPath} and writes {@code outputPath} with {@code faces} outlined.
149148
*/
@@ -176,5 +175,5 @@ private static void annotateWithFace(BufferedImage img, FaceAnnotation face) {
176175
gfx.setColor(new Color(0x00ff00));
177176
gfx.draw(poly);
178177
}
179-
// [END highlight_faces]
178+
// [END vision_face_detection_tutorial_process_response]
180179
}

0 commit comments

Comments
 (0)