File tree Expand file tree Collapse file tree 3 files changed +19
-4
lines changed
vision/src/main/java/com/google/cloud/examples/vision/v1 Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -63,11 +63,16 @@ public class VisionAsyncBatchAnnotateImages {
6363 * import java.util.List;
6464 */
6565
66+ public static void sampleAsyncBatchAnnotateImages () {
67+ // TODO(developer): Replace these variables before running the sample.
68+ String inputImageUri = "gs://cloud-samples-data/vision/label/wakeupcat.jpg" ;
69+ String outputUri = "gs://your-bucket/prefix/" ;
70+ sampleAsyncBatchAnnotateImages (inputImageUri , outputUri );
71+ }
72+
6673 /** Perform async batch image annotation */
6774 public static void sampleAsyncBatchAnnotateImages (String inputImageUri , String outputUri ) {
6875 try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient .create ()) {
69- // inputImageUri = "gs://cloud-samples-data/vision/label/wakeupcat.jpg";
70- // outputUri = "gs://your-bucket/prefix/";
7176 ImageSource source = ImageSource .newBuilder ().setImageUri (inputImageUri ).build ();
7277 Image image = Image .newBuilder ().setSource (source ).build ();
7378 Feature .Type type = Feature .Type .LABEL_DETECTION ;
Original file line number Diff line number Diff line change @@ -70,14 +70,19 @@ public class VisionBatchAnnotateFiles {
7070 * import java.util.List;
7171 */
7272
73+ public static void sampleBatchAnnotateFiles () {
74+ // TODO(developer): Replace these variables before running the sample.
75+ String filePath = "resources/kafka.pdf" ;
76+ sampleBatchAnnotateFiles (filePath );
77+ }
78+
7379 /**
7480 * Perform batch file annotation
7581 *
7682 * @param filePath Path to local pdf file, e.g. /path/document.pdf
7783 */
7884 public static void sampleBatchAnnotateFiles (String filePath ) {
7985 try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient .create ()) {
80- // filePath = "resources/kafka.pdf";
8186
8287 // Supported mime_type: application/pdf, image/tiff, image/gif
8388 String mimeType = "application/pdf" ;
Original file line number Diff line number Diff line change @@ -64,14 +64,19 @@ public class VisionBatchAnnotateFilesGcs {
6464 * import java.util.List;
6565 */
6666
67+ public static void sampleBatchAnnotateFiles () {
68+ // TODO(developer): Replace these variables before running the sample.
69+ String storageUri = "gs://cloud-samples-data/vision/document_understanding/kafka.pdf" ;
70+ sampleBatchAnnotateFiles (storageUri );
71+ }
72+
6773 /**
6874 * Perform batch file annotation
6975 *
7076 * @param storageUri Cloud Storage URI to source image in the format gs://[bucket]/[file]
7177 */
7278 public static void sampleBatchAnnotateFiles (String storageUri ) {
7379 try (ImageAnnotatorClient imageAnnotatorClient = ImageAnnotatorClient .create ()) {
74- // storageUri = "gs://cloud-samples-data/vision/document_understanding/kafka.pdf";
7580 GcsSource gcsSource = GcsSource .newBuilder ().setUri (storageUri ).build ();
7681 InputConfig inputConfig = InputConfig .newBuilder ().setGcsSource (gcsSource ).build ();
7782 Feature .Type type = Feature .Type .DOCUMENT_TEXT_DETECTION ;
You can’t perform that action at this time.
0 commit comments