From 296eb42d85b9ea28dbf3be3f8fbda14298269419 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Mon, 29 Jan 2018 19:55:43 -0800 Subject: [PATCH] feat: update GAPIC generated code (v1), bump semver minor version (#24) * regenerating GAPIC v1 code * bump version and regenerate scaffolding --- packages/google-cloud-vision/.mailmap | 2 + packages/google-cloud-vision/CONTRIBUTORS | 4 +- packages/google-cloud-vision/package.json | 6 +- .../google/cloud/vision/v1/geometry.proto | 2 +- .../cloud/vision/v1/image_annotator.proto | 118 ++++++++++------ .../cloud/vision/v1/text_annotation.proto | 50 +++++-- .../cloud/vision/v1/web_detection.proto | 41 +++++- .../google-cloud-vision/samples/package.json | 2 +- .../google/cloud/vision/v1/doc_geometry.js | 4 +- .../cloud/vision/v1/doc_image_annotator.js | 133 ++++++++++++------ .../cloud/vision/v1/doc_text_annotation.js | 53 ++++--- .../cloud/vision/v1/doc_web_detection.js | 59 ++++++-- .../src/v1/doc/google/protobuf/doc_any.js | 4 +- .../v1/doc/google/protobuf/doc_wrappers.js | 4 +- .../src/v1/doc/google/rpc/doc_status.js | 4 +- .../src/v1/doc/google/type/doc_color.js | 4 +- .../src/v1/doc/google/type/doc_latlng.js | 4 +- .../src/v1/image_annotator_client.js | 4 +- packages/google-cloud-vision/src/v1/index.js | 4 +- packages/google-cloud-vision/test/gapic-v1.js | 4 +- 20 files changed, 350 insertions(+), 156 deletions(-) diff --git a/packages/google-cloud-vision/.mailmap b/packages/google-cloud-vision/.mailmap index bac1d09b6e6..3db82848eea 100644 --- a/packages/google-cloud-vision/.mailmap +++ b/packages/google-cloud-vision/.mailmap @@ -4,3 +4,5 @@ Jun Mukai Jun Mukai Luke Sneeringer Luke Sneeringer Stephen Sawchuk Stephen Sawchuk Stephen Sawchuk Stephen Sawchuk +Alexander Fenster Alexander Fenster +Rebecca Taylor Rebecca Taylor diff --git a/packages/google-cloud-vision/CONTRIBUTORS b/packages/google-cloud-vision/CONTRIBUTORS index 96b20b806d0..bd95ab74452 100644 --- a/packages/google-cloud-vision/CONTRIBUTORS +++ b/packages/google-cloud-vision/CONTRIBUTORS @@ -4,6 +4,7 @@ # name # Ace Nassri +Alexander Fenster Ali Ijaz Sheikh Dave Gramlich Ernest Landrito @@ -11,9 +12,10 @@ Gus Class Jason Dobry Jun Mukai Luke Sneeringer +Rebecca Taylor Song Wang Stephen Sawchuk Tim Swast calibr -Rebecca Taylor +greenkeeper[bot] rtw diff --git a/packages/google-cloud-vision/package.json b/packages/google-cloud-vision/package.json index 7de32b412cc..05c674fb8ed 100644 --- a/packages/google-cloud-vision/package.json +++ b/packages/google-cloud-vision/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/vision", "description": "Google Cloud Vision API client for Node.js", - "version": "0.14.0", + "version": "0.15.0", "license": "Apache-2.0", "author": "Google Inc", "engines": { @@ -30,6 +30,7 @@ ], "contributors": [ "Ace Nassri ", + "Alexander Fenster ", "Ali Ijaz Sheikh ", "Dave Gramlich ", "Ernest Landrito ", @@ -37,11 +38,12 @@ "Jason Dobry ", "Jun Mukai ", "Luke Sneeringer ", + "Rebecca Taylor ", "Song Wang ", "Stephen Sawchuk ", "Tim Swast ", "calibr ", - "Rebecca Taylor ", + "greenkeeper[bot] ", "rtw " ], "scripts": { diff --git a/packages/google-cloud-vision/protos/google/cloud/vision/v1/geometry.proto b/packages/google-cloud-vision/protos/google/cloud/vision/v1/geometry.proto index 5586c2eb3ad..c1b35a94013 100644 --- a/packages/google-cloud-vision/protos/google/cloud/vision/v1/geometry.proto +++ b/packages/google-cloud-vision/protos/google/cloud/vision/v1/geometry.proto @@ -1,4 +1,4 @@ -// Copyright 2016 Google Inc. +// Copyright 2018 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-vision/protos/google/cloud/vision/v1/image_annotator.proto b/packages/google-cloud-vision/protos/google/cloud/vision/v1/image_annotator.proto index c17f8aeb6fe..3978db04ebe 100644 --- a/packages/google-cloud-vision/protos/google/cloud/vision/v1/image_annotator.proto +++ b/packages/google-cloud-vision/protos/google/cloud/vision/v1/image_annotator.proto @@ -1,4 +1,4 @@ -// Copyright 2016 Google Inc. +// Copyright 2018 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -41,12 +41,11 @@ service ImageAnnotator { } } -// Users describe the type of Google Cloud Vision API tasks to perform over -// images by using *Feature*s. Each Feature indicates a type of image -// detection task to perform. Features encode the Cloud Vision API -// vertical to operate on and the number of top-scoring results to return. +// The type of Google Cloud Vision API detection to perform, and the maximum +// number of results to return for that type. Multiple `Feature` objects can +// be specified in the `features` list. message Feature { - // Type of image feature. + // Type of Google Cloud Vision API feature to be extracted. enum Type { // Unspecified feature type. TYPE_UNSPECIFIED = 0; @@ -63,17 +62,21 @@ message Feature { // Run label detection. LABEL_DETECTION = 4; - // Run OCR. + // Run text detection / optical character recognition (OCR). Text detection + // is optimized for areas of text within a larger image; if the image is + // a document, use `DOCUMENT_TEXT_DETECTION` instead. TEXT_DETECTION = 5; // Run dense text document OCR. Takes precedence when both - // DOCUMENT_TEXT_DETECTION and TEXT_DETECTION are present. + // `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present. DOCUMENT_TEXT_DETECTION = 11; - // Run computer vision models to compute image safe-search properties. + // Run Safe Search to detect potentially unsafe + // or undesirable content. SAFE_SEARCH_DETECTION = 6; - // Compute a set of image properties, such as the image's dominant colors. + // Compute a set of image properties, such as the + // image's dominant colors. IMAGE_PROPERTIES = 7; // Run crop hints. @@ -86,29 +89,42 @@ message Feature { // The feature type. Type type = 1; - // Maximum number of results of this type. + // Maximum number of results of this type. Does not apply to + // `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`. int32 max_results = 2; + + // Model to use for the feature. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 3; } -// External image source (Google Cloud Storage image location). +// External image source (Google Cloud Storage or web URL image location). message ImageSource { - // NOTE: For new code `image_uri` below is preferred. - // Google Cloud Storage image URI, which must be in the following form: - // `gs://bucket_name/object_name` (for details, see + // **Use `image_uri` instead.** + // + // The Google Cloud Storage URI of the form + // `gs://bucket_name/object_name`. Object versioning is not supported. See // [Google Cloud Storage Request - // URIs](https://cloud.google.com/storage/docs/reference-uris)). - // NOTE: Cloud Storage object versioning is not supported. + // URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. string gcs_image_uri = 1; - // Image URI which supports: - // 1) Google Cloud Storage image URI, which must be in the following form: - // `gs://bucket_name/object_name` (for details, see - // [Google Cloud Storage Request - // URIs](https://cloud.google.com/storage/docs/reference-uris)). - // NOTE: Cloud Storage object versioning is not supported. - // 2) Publicly accessible image HTTP/HTTPS URL. - // This is preferred over the legacy `gcs_image_uri` above. When both - // `gcs_image_uri` and `image_uri` are specified, `image_uri` takes + // The URI of the source image. Can be either: + // + // 1. A Google Cloud Storage URI of the form + // `gs://bucket_name/object_name`. Object versioning is not supported. See + // [Google Cloud Storage Request + // URIs](https://cloud.google.com/storage/docs/reference-uris) for more + // info. + // + // 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from + // HTTP/HTTPS URLs, Google cannot guarantee that the request will be + // completed. Your request may fail if the specified host denies the + // request (e.g. due to request throttling or DOS prevention), or if Google + // throttles requests to the site for abuse prevention. You should not + // depend on externally-hosted images for production applications. + // + // When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes // precedence. string image_uri = 2; } @@ -116,23 +132,19 @@ message ImageSource { // Client image to perform Google Cloud Vision API tasks over. message Image { // Image content, represented as a stream of bytes. - // Note: as with all `bytes` fields, protobuffers use a pure binary + // Note: As with all `bytes` fields, protobuffers use a pure binary // representation, whereas JSON representations use base64. bytes content = 1; - // Google Cloud Storage image location. If both `content` and `source` - // are provided for an image, `content` takes precedence and is - // used to perform the image annotation request. + // Google Cloud Storage image location, or publicly-accessible image + // URL. If both `content` and `source` are provided for an image, `content` + // takes precedence and is used to perform the image annotation request. ImageSource source = 2; } // A face annotation object contains the results of face detection. message FaceAnnotation { // A face-specific landmark (for example, a face feature). - // Landmark positions may fall outside the bounds of the image - // if the face is near one or more edges of the image. - // Therefore it is NOT guaranteed that `0 <= x < width` or - // `0 <= y < height`. message Landmark { // Face landmark (feature) type. // Left and right are defined from the vantage of the viewer of the image @@ -327,12 +339,16 @@ message Property { // Value of the property. string value = 2; + + // Value of numeric properties. + uint64 uint64_value = 3; } // Set of detected entity features. message EntityAnnotation { // Opaque entity ID. Some IDs may be available in - // [Google Knowledge Graph Search API](https://developers.google.com/knowledge-graph/). + // [Google Knowledge Graph Search + // API](https://developers.google.com/knowledge-graph/). string mid = 1; // The language code for the locale in which the entity textual @@ -345,6 +361,7 @@ message EntityAnnotation { // Overall score of the result. Range [0, 1]. float score = 4; + // **Deprecated. Use `score` instead.** // The accuracy of the entity detection in an image. // For example, for an image in which the "Eiffel Tower" entity is detected, // this field represents the confidence that there is a tower in the query @@ -358,10 +375,8 @@ message EntityAnnotation { // there is a tower in each image may be the same. Range [0, 1]. float topicality = 6; - // Image region to which this entity belongs. Currently not produced - // for `LABEL_DETECTION` features. For `TEXT_DETECTION` (OCR), `boundingPoly`s - // are produced for the entire text detected in an image region, followed by - // `boundingPoly`s for each word within the detected text. + // Image region to which this entity belongs. Not produced + // for `LABEL_DETECTION` features. BoundingPoly bounding_poly = 7; // The location information for the detected entity. Multiple @@ -380,7 +395,9 @@ message EntityAnnotation { // methods over safe-search verticals (for example, adult, spoof, medical, // violence). message SafeSearchAnnotation { - // Represents the adult content likelihood for the image. + // Represents the adult content likelihood for the image. Adult content may + // contain elements such as nudity, pornographic images or cartoons, or + // sexual activities. Likelihood adult = 1; // Spoof likelihood. The likelihood that an modification @@ -391,8 +408,14 @@ message SafeSearchAnnotation { // Likelihood that this is a medical image. Likelihood medical = 3; - // Violence likelihood. + // Likelihood that this image contains violent content. Likelihood violence = 4; + + // Likelihood that the request image contains racy content. Racy content may + // include (but is not limited to) skimpy or sheer clothing, strategically + // covered nudity, lewd or provocative poses, or close-ups of sensitive + // body areas. + Likelihood racy = 9; } // Rectangle determined by min and max `LatLng` pairs. @@ -446,6 +469,7 @@ message CropHint { // Set of crop hints that are used to generate new crops when serving images. message CropHintsAnnotation { + // Crop hint results. repeated CropHint crop_hints = 1; } @@ -460,6 +484,12 @@ message CropHintsParams { repeated float aspect_ratios = 1; } +// Parameters for web detection request. +message WebDetectionParams { + // Whether to include results derived from the geo information in the image. + bool include_geo_results = 2; +} + // Image context and/or feature-specific parameters. message ImageContext { // lat/long rectangle that specifies the location of the image. @@ -477,6 +507,9 @@ message ImageContext { // Parameters for crop hints annotation request. CropHintsParams crop_hints_params = 4; + + // Parameters for web detection. + WebDetectionParams web_detection_params = 6; } // Request for performing Google Cloud Vision API tasks over a user-provided @@ -506,8 +539,7 @@ message AnnotateImageResponse { // If present, label detection has completed successfully. repeated EntityAnnotation label_annotations = 4; - // If present, text (OCR) detection or document (OCR) text detection has - // completed successfully. + // If present, text (OCR) detection has completed successfully. repeated EntityAnnotation text_annotations = 5; // If present, text (OCR) detection or document (OCR) text detection has diff --git a/packages/google-cloud-vision/protos/google/cloud/vision/v1/text_annotation.proto b/packages/google-cloud-vision/protos/google/cloud/vision/v1/text_annotation.proto index 938820a3a00..bf825d59b5a 100644 --- a/packages/google-cloud-vision/protos/google/cloud/vision/v1/text_annotation.proto +++ b/packages/google-cloud-vision/protos/google/cloud/vision/v1/text_annotation.proto @@ -1,4 +1,4 @@ -// Copyright 2016 Google Inc. +// Copyright 2018 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,9 +30,9 @@ option java_package = "com.google.cloud.vision.v1"; // The hierarchy of an OCR extracted text structure is like this: // TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol // Each structural component, starting from Page, may further have their own -// properties. Properties describe detected languages, breaks etc.. Please -// refer to the [google.cloud.vision.v1.TextAnnotation.TextProperty][google.cloud.vision.v1.TextAnnotation.TextProperty] message -// definition below for more detail. +// properties. Properties describe detected languages, breaks etc.. Please refer +// to the [TextAnnotation.TextProperty][google.cloud.vision.v1.TextAnnotation.TextProperty] message definition below for more +// detail. message TextAnnotation { // Detected language for a structural component. message DetectedLanguage { @@ -61,15 +61,15 @@ message TextAnnotation { // Line-wrapping break. EOL_SURE_SPACE = 3; - // End-line hyphen that is not present in text; does + // End-line hyphen that is not present in text; does not co-occur with + // `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. HYPHEN = 4; - // not co-occur with SPACE, LEADER_SPACE, or - // LINE_BREAK. // Line break that ends a paragraph. LINE_BREAK = 5; } + // Detected break type. BreakType type = 1; // True if break prepends the element. @@ -105,6 +105,9 @@ message Page { // List of blocks of text, images etc on this page. repeated Block blocks = 4; + + // Confidence of the OCR results on the page. Range [0, 1]. + float confidence = 5; } // Logical element on the page. @@ -139,14 +142,19 @@ message Block { // is represented as around the top-left corner as defined when the text is // read in the 'natural' orientation. // For example: - // * when the text is horizontal it might look like: - // 0----1 - // | | - // 3----2 - // * when it's rotated 180 degrees around the top-left corner it becomes: - // 2----3 - // | | - // 1----0 + // + // * when the text is horizontal it might look like: + // + // 0----1 + // | | + // 3----2 + // + // * when it's rotated 180 degrees around the top-left corner it becomes: + // + // 2----3 + // | | + // 1----0 + // // and the vertice order will still be (0, 1, 2, 3). BoundingPoly bounding_box = 2; @@ -155,6 +163,9 @@ message Block { // Detected block type (text, image etc) for this block. BlockType block_type = 4; + + // Confidence of the OCR results on the block. Range [0, 1]. + float confidence = 5; } // Structural unit of text representing a number of words in certain order. @@ -181,6 +192,9 @@ message Paragraph { // List of words in this paragraph. repeated Word words = 3; + + // Confidence of the OCR results for the paragraph. Range [0, 1]. + float confidence = 4; } // A word representation. @@ -208,6 +222,9 @@ message Word { // List of symbols in the word. // The order of the symbols follows the natural reading order. repeated Symbol symbols = 3; + + // Confidence of the OCR results for the word. Range [0, 1]. + float confidence = 4; } // A single symbol representation. @@ -234,4 +251,7 @@ message Symbol { // The actual UTF-8 representation of the symbol. string text = 3; + + // Confidence of the OCR results for the symbol. Range [0, 1]. + float confidence = 4; } diff --git a/packages/google-cloud-vision/protos/google/cloud/vision/v1/web_detection.proto b/packages/google-cloud-vision/protos/google/cloud/vision/v1/web_detection.proto index 6da89756ee3..81d92528cd3 100644 --- a/packages/google-cloud-vision/protos/google/cloud/vision/v1/web_detection.proto +++ b/packages/google-cloud-vision/protos/google/cloud/vision/v1/web_detection.proto @@ -1,4 +1,4 @@ -// Copyright 2016 Google Inc. +// Copyright 2018 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -45,8 +45,7 @@ message WebDetection { // The result image URL. string url = 1; - // Overall relevancy score for the image. - // Not normalized and not comparable across different image queries. + // (Deprecated) Overall relevancy score for the image. float score = 2; } @@ -55,17 +54,39 @@ message WebDetection { // The result web page URL. string url = 1; - // Overall relevancy score for the web page. - // Not normalized and not comparable across different image queries. + // (Deprecated) Overall relevancy score for the web page. float score = 2; + + // Title for the web page, may contain HTML markups. + string page_title = 3; + + // Fully matching images on the page. + // Can include resized copies of the query image. + repeated WebImage full_matching_images = 4; + + // Partial matching images on the page. + // Those images are similar enough to share some key-point features. For + // example an original image will likely have partial matching for its + // crops. + repeated WebImage partial_matching_images = 5; + } + + // Label to provide extra metadata for the web detection. + message WebLabel { + // Label for extra metadata. + string label = 1; + + // The BCP-47 language code for `label`, such as "en-US" or "sr-Latn". + // For more information, see + // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + string language_code = 2; } // Deduced entities from similar images on the Internet. repeated WebEntity web_entities = 1; // Fully matching images from the Internet. - // They're definite neardups and most often a copy of the query image with - // merely a size change. + // Can include resized copies of the query image. repeated WebImage full_matching_images = 2; // Partial matching images from the Internet. @@ -75,4 +96,10 @@ message WebDetection { // Web pages containing the matching images from the Internet. repeated WebPage pages_with_matching_images = 4; + + // The visually similar image results. + repeated WebImage visually_similar_images = 6; + + // Best guess text labels for the request image. + repeated WebLabel best_guess_labels = 8; } diff --git a/packages/google-cloud-vision/samples/package.json b/packages/google-cloud-vision/samples/package.json index aaef76f74f9..1db32915048 100644 --- a/packages/google-cloud-vision/samples/package.json +++ b/packages/google-cloud-vision/samples/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@google-cloud/storage": "1.4.0", - "@google-cloud/vision": "0.14.0", + "@google-cloud/vision": "0.15.0", "async": "2.5.0", "natural": "0.5.4", "redis": "2.8.0", diff --git a/packages/google-cloud-vision/src/v1/doc/google/cloud/vision/v1/doc_geometry.js b/packages/google-cloud-vision/src/v1/doc/google/cloud/vision/v1/doc_geometry.js index c8b9a1a8ff7..b63f9beab4d 100644 --- a/packages/google-cloud-vision/src/v1/doc/google/cloud/vision/v1/doc_geometry.js +++ b/packages/google-cloud-vision/src/v1/doc/google/cloud/vision/v1/doc_geometry.js @@ -1,10 +1,10 @@ -// Copyright 2017, Google LLC All rights reserved. +// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/packages/google-cloud-vision/src/v1/doc/google/cloud/vision/v1/doc_image_annotator.js b/packages/google-cloud-vision/src/v1/doc/google/cloud/vision/v1/doc_image_annotator.js index f2b24a27c67..c29edc17c5d 100644 --- a/packages/google-cloud-vision/src/v1/doc/google/cloud/vision/v1/doc_image_annotator.js +++ b/packages/google-cloud-vision/src/v1/doc/google/cloud/vision/v1/doc_image_annotator.js @@ -1,10 +1,10 @@ -// Copyright 2017, Google LLC All rights reserved. +// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, @@ -16,10 +16,9 @@ // to be loaded as the JS file. /** - * Users describe the type of Google Cloud Vision API tasks to perform over - * images by using *Feature*s. Each Feature indicates a type of image - * detection task to perform. Features encode the Cloud Vision API - * vertical to operate on and the number of top-scoring results to return. + * The type of Google Cloud Vision API detection to perform, and the maximum + * number of results to return for that type. Multiple `Feature` objects can + * be specified in the `features` list. * * @property {number} type * The feature type. @@ -27,7 +26,13 @@ * The number should be among the values of [Type]{@link google.cloud.vision.v1.Type} * * @property {number} maxResults - * Maximum number of results of this type. + * Maximum number of results of this type. Does not apply to + * `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`. + * + * @property {string} model + * Model to use for the feature. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". * * @typedef Feature * @memberof google.cloud.vision.v1 @@ -37,7 +42,7 @@ var Feature = { // This is for documentation. Actual contents will be loaded by gRPC. /** - * Type of image feature. + * Type of Google Cloud Vision API feature to be extracted. * * @enum {number} * @memberof google.cloud.vision.v1 @@ -70,23 +75,27 @@ var Feature = { LABEL_DETECTION: 4, /** - * Run OCR. + * Run text detection / optical character recognition (OCR). Text detection + * is optimized for areas of text within a larger image; if the image is + * a document, use `DOCUMENT_TEXT_DETECTION` instead. */ TEXT_DETECTION: 5, /** * Run dense text document OCR. Takes precedence when both - * DOCUMENT_TEXT_DETECTION and TEXT_DETECTION are present. + * `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present. */ DOCUMENT_TEXT_DETECTION: 11, /** - * Run computer vision models to compute image safe-search properties. + * Run Safe Search to detect potentially unsafe + * or undesirable content. */ SAFE_SEARCH_DETECTION: 6, /** - * Compute a set of image properties, such as the image's dominant colors. + * Compute a set of image properties, such as the + * image's dominant colors. */ IMAGE_PROPERTIES: 7, @@ -103,26 +112,33 @@ var Feature = { }; /** - * External image source (Google Cloud Storage image location). + * External image source (Google Cloud Storage or web URL image location). * * @property {string} gcsImageUri - * NOTE: For new code `image_uri` below is preferred. - * Google Cloud Storage image URI, which must be in the following form: - * `gs://bucket_name/object_name` (for details, see + * **Use `image_uri` instead.** + * + * The Google Cloud Storage URI of the form + * `gs://bucket_name/object_name`. Object versioning is not supported. See * [Google Cloud Storage Request - * URIs](https://cloud.google.com/storage/docs/reference-uris)). - * NOTE: Cloud Storage object versioning is not supported. + * URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. * * @property {string} imageUri - * Image URI which supports: - * 1) Google Cloud Storage image URI, which must be in the following form: - * `gs://bucket_name/object_name` (for details, see - * [Google Cloud Storage Request - * URIs](https://cloud.google.com/storage/docs/reference-uris)). - * NOTE: Cloud Storage object versioning is not supported. - * 2) Publicly accessible image HTTP/HTTPS URL. - * This is preferred over the legacy `gcs_image_uri` above. When both - * `gcs_image_uri` and `image_uri` are specified, `image_uri` takes + * The URI of the source image. Can be either: + * + * 1. A Google Cloud Storage URI of the form + * `gs://bucket_name/object_name`. Object versioning is not supported. See + * [Google Cloud Storage Request + * URIs](https://cloud.google.com/storage/docs/reference-uris) for more + * info. + * + * 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from + * HTTP/HTTPS URLs, Google cannot guarantee that the request will be + * completed. Your request may fail if the specified host denies the + * request (e.g. due to request throttling or DOS prevention), or if Google + * throttles requests to the site for abuse prevention. You should not + * depend on externally-hosted images for production applications. + * + * When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes * precedence. * * @typedef ImageSource @@ -138,13 +154,13 @@ var ImageSource = { * * @property {string} content * Image content, represented as a stream of bytes. - * Note: as with all `bytes` fields, protobuffers use a pure binary + * Note: As with all `bytes` fields, protobuffers use a pure binary * representation, whereas JSON representations use base64. * * @property {Object} source - * Google Cloud Storage image location. If both `content` and `source` - * are provided for an image, `content` takes precedence and is - * used to perform the image annotation request. + * Google Cloud Storage image location, or publicly-accessible image + * URL. If both `content` and `source` are provided for an image, `content` + * takes precedence and is used to perform the image annotation request. * * This object should have the same structure as [ImageSource]{@link google.cloud.vision.v1.ImageSource} * @@ -249,10 +265,6 @@ var FaceAnnotation = { /** * A face-specific landmark (for example, a face feature). - * Landmark positions may fall outside the bounds of the image - * if the face is near one or more edges of the image. - * Therefore it is NOT guaranteed that `0 <= x < width` or - * `0 <= y < height`. * * @property {number} type * Face landmark type. @@ -485,6 +497,9 @@ var LocationInfo = { * @property {string} value * Value of the property. * + * @property {number} uint64Value + * Value of numeric properties. + * * @typedef Property * @memberof google.cloud.vision.v1 * @see [google.cloud.vision.v1.Property definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/vision/v1/image_annotator.proto} @@ -498,7 +513,8 @@ var Property = { * * @property {string} mid * Opaque entity ID. Some IDs may be available in - * [Google Knowledge Graph Search API](https://developers.google.com/knowledge-graph/). + * [Google Knowledge Graph Search + * API](https://developers.google.com/knowledge-graph/). * * @property {string} locale * The language code for the locale in which the entity textual @@ -511,6 +527,7 @@ var Property = { * Overall score of the result. Range [0, 1]. * * @property {number} confidence + * **Deprecated. Use `score` instead.** * The accuracy of the entity detection in an image. * For example, for an image in which the "Eiffel Tower" entity is detected, * this field represents the confidence that there is a tower in the query @@ -524,10 +541,8 @@ var Property = { * there is a tower in each image may be the same. Range [0, 1]. * * @property {Object} boundingPoly - * Image region to which this entity belongs. Currently not produced - * for `LABEL_DETECTION` features. For `TEXT_DETECTION` (OCR), `boundingPoly`s - * are produced for the entire text detected in an image region, followed by - * `boundingPoly`s for each word within the detected text. + * Image region to which this entity belongs. Not produced + * for `LABEL_DETECTION` features. * * This object should have the same structure as [BoundingPoly]{@link google.cloud.vision.v1.BoundingPoly} * @@ -560,7 +575,9 @@ var EntityAnnotation = { * violence). * * @property {number} adult - * Represents the adult content likelihood for the image. + * Represents the adult content likelihood for the image. Adult content may + * contain elements such as nudity, pornographic images or cartoons, or + * sexual activities. * * The number should be among the values of [Likelihood]{@link google.cloud.vision.v1.Likelihood} * @@ -577,7 +594,15 @@ var EntityAnnotation = { * The number should be among the values of [Likelihood]{@link google.cloud.vision.v1.Likelihood} * * @property {number} violence - * Violence likelihood. + * Likelihood that this image contains violent content. + * + * The number should be among the values of [Likelihood]{@link google.cloud.vision.v1.Likelihood} + * + * @property {number} racy + * Likelihood that the request image contains racy content. Racy content may + * include (but is not limited to) skimpy or sheer clothing, strategically + * covered nudity, lewd or provocative poses, or close-ups of sensitive + * body areas. * * The number should be among the values of [Likelihood]{@link google.cloud.vision.v1.Likelihood} * @@ -694,6 +719,8 @@ var CropHint = { * Set of crop hints that are used to generate new crops when serving images. * * @property {Object[]} cropHints + * Crop hint results. + * * This object should have the same structure as [CropHint]{@link google.cloud.vision.v1.CropHint} * * @typedef CropHintsAnnotation @@ -723,6 +750,20 @@ var CropHintsParams = { // This is for documentation. Actual contents will be loaded by gRPC. }; +/** + * Parameters for web detection request. + * + * @property {boolean} includeGeoResults + * Whether to include results derived from the geo information in the image. + * + * @typedef WebDetectionParams + * @memberof google.cloud.vision.v1 + * @see [google.cloud.vision.v1.WebDetectionParams definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/vision/v1/image_annotator.proto} + */ +var WebDetectionParams = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + /** * Image context and/or feature-specific parameters. * @@ -746,6 +787,11 @@ var CropHintsParams = { * * This object should have the same structure as [CropHintsParams]{@link google.cloud.vision.v1.CropHintsParams} * + * @property {Object} webDetectionParams + * Parameters for web detection. + * + * This object should have the same structure as [WebDetectionParams]{@link google.cloud.vision.v1.WebDetectionParams} + * * @typedef ImageContext * @memberof google.cloud.vision.v1 * @see [google.cloud.vision.v1.ImageContext definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/vision/v1/image_annotator.proto} @@ -805,8 +851,7 @@ var AnnotateImageRequest = { * This object should have the same structure as [EntityAnnotation]{@link google.cloud.vision.v1.EntityAnnotation} * * @property {Object[]} textAnnotations - * If present, text (OCR) detection or document (OCR) text detection has - * completed successfully. + * If present, text (OCR) detection has completed successfully. * * This object should have the same structure as [EntityAnnotation]{@link google.cloud.vision.v1.EntityAnnotation} * diff --git a/packages/google-cloud-vision/src/v1/doc/google/cloud/vision/v1/doc_text_annotation.js b/packages/google-cloud-vision/src/v1/doc/google/cloud/vision/v1/doc_text_annotation.js index 51f65b6f952..9ee53c5dae9 100644 --- a/packages/google-cloud-vision/src/v1/doc/google/cloud/vision/v1/doc_text_annotation.js +++ b/packages/google-cloud-vision/src/v1/doc/google/cloud/vision/v1/doc_text_annotation.js @@ -1,10 +1,10 @@ -// Copyright 2017, Google LLC All rights reserved. +// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, @@ -20,9 +20,9 @@ * The hierarchy of an OCR extracted text structure is like this: * TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol * Each structural component, starting from Page, may further have their own - * properties. Properties describe detected languages, breaks etc.. Please - * refer to the google.cloud.vision.v1.TextAnnotation.TextProperty message - * definition below for more detail. + * properties. Properties describe detected languages, breaks etc.. Please refer + * to the TextAnnotation.TextProperty message definition below for more + * detail. * * @property {Object[]} pages * List of pages detected by OCR. @@ -62,6 +62,8 @@ var TextAnnotation = { * Detected start or end of a structural component. * * @property {number} type + * Detected break type. + * * The number should be among the values of [BreakType]{@link google.cloud.vision.v1.BreakType} * * @property {boolean} isPrefix @@ -103,13 +105,12 @@ var TextAnnotation = { EOL_SURE_SPACE: 3, /** - * End-line hyphen that is not present in text; does + * End-line hyphen that is not present in text; does not co-occur with + * `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. */ HYPHEN: 4, /** - * not co-occur with SPACE, LEADER_SPACE, or - * LINE_BREAK. * Line break that ends a paragraph. */ LINE_BREAK: 5 @@ -157,6 +158,9 @@ var TextAnnotation = { * * This object should have the same structure as [Block]{@link google.cloud.vision.v1.Block} * + * @property {number} confidence + * Confidence of the OCR results on the page. Range [0, 1]. + * * @typedef Page * @memberof google.cloud.vision.v1 * @see [google.cloud.vision.v1.Page definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/vision/v1/text_annotation.proto} @@ -180,14 +184,19 @@ var Page = { * is represented as around the top-left corner as defined when the text is * read in the 'natural' orientation. * For example: - * * when the text is horizontal it might look like: - * 0----1 - * | | - * 3----2 - * * when it's rotated 180 degrees around the top-left corner it becomes: - * 2----3 - * | | - * 1----0 + * + * * when the text is horizontal it might look like: + * + * 0----1 + * | | + * 3----2 + * + * * when it's rotated 180 degrees around the top-left corner it becomes: + * + * 2----3 + * | | + * 1----0 + * * and the vertice order will still be (0, 1, 2, 3). * * This object should have the same structure as [BoundingPoly]{@link google.cloud.vision.v1.BoundingPoly} @@ -202,6 +211,9 @@ var Page = { * * The number should be among the values of [BlockType]{@link google.cloud.vision.v1.BlockType} * + * @property {number} confidence + * Confidence of the OCR results on the block. Range [0, 1]. + * * @typedef Block * @memberof google.cloud.vision.v1 * @see [google.cloud.vision.v1.Block definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/vision/v1/text_annotation.proto} @@ -281,6 +293,9 @@ var Block = { * * This object should have the same structure as [Word]{@link google.cloud.vision.v1.Word} * + * @property {number} confidence + * Confidence of the OCR results for the paragraph. Range [0, 1]. + * * @typedef Paragraph * @memberof google.cloud.vision.v1 * @see [google.cloud.vision.v1.Paragraph definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/vision/v1/text_annotation.proto} @@ -322,6 +337,9 @@ var Paragraph = { * * This object should have the same structure as [Symbol]{@link google.cloud.vision.v1.Symbol} * + * @property {number} confidence + * Confidence of the OCR results for the word. Range [0, 1]. + * * @typedef Word * @memberof google.cloud.vision.v1 * @see [google.cloud.vision.v1.Word definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/vision/v1/text_annotation.proto} @@ -360,6 +378,9 @@ var Word = { * @property {string} text * The actual UTF-8 representation of the symbol. * + * @property {number} confidence + * Confidence of the OCR results for the symbol. Range [0, 1]. + * * @typedef Symbol * @memberof google.cloud.vision.v1 * @see [google.cloud.vision.v1.Symbol definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/vision/v1/text_annotation.proto} diff --git a/packages/google-cloud-vision/src/v1/doc/google/cloud/vision/v1/doc_web_detection.js b/packages/google-cloud-vision/src/v1/doc/google/cloud/vision/v1/doc_web_detection.js index 1872b45d158..5ed9f6e828a 100644 --- a/packages/google-cloud-vision/src/v1/doc/google/cloud/vision/v1/doc_web_detection.js +++ b/packages/google-cloud-vision/src/v1/doc/google/cloud/vision/v1/doc_web_detection.js @@ -1,10 +1,10 @@ -// Copyright 2017, Google LLC All rights reserved. +// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, @@ -25,8 +25,7 @@ * * @property {Object[]} fullMatchingImages * Fully matching images from the Internet. - * They're definite neardups and most often a copy of the query image with - * merely a size change. + * Can include resized copies of the query image. * * This object should have the same structure as [WebImage]{@link google.cloud.vision.v1.WebImage} * @@ -42,6 +41,16 @@ * * This object should have the same structure as [WebPage]{@link google.cloud.vision.v1.WebPage} * + * @property {Object[]} visuallySimilarImages + * The visually similar image results. + * + * This object should have the same structure as [WebImage]{@link google.cloud.vision.v1.WebImage} + * + * @property {Object[]} bestGuessLabels + * Best guess text labels for the request image. + * + * This object should have the same structure as [WebLabel]{@link google.cloud.vision.v1.WebLabel} + * * @typedef WebDetection * @memberof google.cloud.vision.v1 * @see [google.cloud.vision.v1.WebDetection definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/vision/v1/web_detection.proto} @@ -77,8 +86,7 @@ var WebDetection = { * The result image URL. * * @property {number} score - * Overall relevancy score for the image. - * Not normalized and not comparable across different image queries. + * (Deprecated) Overall relevancy score for the image. * * @typedef WebImage * @memberof google.cloud.vision.v1 @@ -95,8 +103,24 @@ var WebDetection = { * The result web page URL. * * @property {number} score - * Overall relevancy score for the web page. - * Not normalized and not comparable across different image queries. + * (Deprecated) Overall relevancy score for the web page. + * + * @property {string} pageTitle + * Title for the web page, may contain HTML markups. + * + * @property {Object[]} fullMatchingImages + * Fully matching images on the page. + * Can include resized copies of the query image. + * + * This object should have the same structure as [WebImage]{@link google.cloud.vision.v1.WebImage} + * + * @property {Object[]} partialMatchingImages + * Partial matching images on the page. + * Those images are similar enough to share some key-point features. For + * example an original image will likely have partial matching for its + * crops. + * + * This object should have the same structure as [WebImage]{@link google.cloud.vision.v1.WebImage} * * @typedef WebPage * @memberof google.cloud.vision.v1 @@ -104,5 +128,24 @@ var WebDetection = { */ WebPage: { // This is for documentation. Actual contents will be loaded by gRPC. + }, + + /** + * Label to provide extra metadata for the web detection. + * + * @property {string} label + * Label for extra metadata. + * + * @property {string} languageCode + * The BCP-47 language code for `label`, such as "en-US" or "sr-Latn". + * For more information, see + * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * + * @typedef WebLabel + * @memberof google.cloud.vision.v1 + * @see [google.cloud.vision.v1.WebDetection.WebLabel definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/vision/v1/web_detection.proto} + */ + WebLabel: { + // This is for documentation. Actual contents will be loaded by gRPC. } }; \ No newline at end of file diff --git a/packages/google-cloud-vision/src/v1/doc/google/protobuf/doc_any.js b/packages/google-cloud-vision/src/v1/doc/google/protobuf/doc_any.js index 21feb744243..f55fa17ff12 100644 --- a/packages/google-cloud-vision/src/v1/doc/google/protobuf/doc_any.js +++ b/packages/google-cloud-vision/src/v1/doc/google/protobuf/doc_any.js @@ -1,10 +1,10 @@ -// Copyright 2017, Google LLC All rights reserved. +// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/packages/google-cloud-vision/src/v1/doc/google/protobuf/doc_wrappers.js b/packages/google-cloud-vision/src/v1/doc/google/protobuf/doc_wrappers.js index 0ccf17f236b..791b600ab1d 100644 --- a/packages/google-cloud-vision/src/v1/doc/google/protobuf/doc_wrappers.js +++ b/packages/google-cloud-vision/src/v1/doc/google/protobuf/doc_wrappers.js @@ -1,10 +1,10 @@ -// Copyright 2017, Google LLC All rights reserved. +// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/packages/google-cloud-vision/src/v1/doc/google/rpc/doc_status.js b/packages/google-cloud-vision/src/v1/doc/google/rpc/doc_status.js index be5e96ce26d..7122f1682e0 100644 --- a/packages/google-cloud-vision/src/v1/doc/google/rpc/doc_status.js +++ b/packages/google-cloud-vision/src/v1/doc/google/rpc/doc_status.js @@ -1,10 +1,10 @@ -// Copyright 2017, Google LLC All rights reserved. +// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/packages/google-cloud-vision/src/v1/doc/google/type/doc_color.js b/packages/google-cloud-vision/src/v1/doc/google/type/doc_color.js index a2ea753d8a1..8ae80246fe3 100644 --- a/packages/google-cloud-vision/src/v1/doc/google/type/doc_color.js +++ b/packages/google-cloud-vision/src/v1/doc/google/type/doc_color.js @@ -1,10 +1,10 @@ -// Copyright 2017, Google LLC All rights reserved. +// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/packages/google-cloud-vision/src/v1/doc/google/type/doc_latlng.js b/packages/google-cloud-vision/src/v1/doc/google/type/doc_latlng.js index e54b84d63c7..76150dc3be1 100644 --- a/packages/google-cloud-vision/src/v1/doc/google/type/doc_latlng.js +++ b/packages/google-cloud-vision/src/v1/doc/google/type/doc_latlng.js @@ -1,10 +1,10 @@ -// Copyright 2017, Google LLC All rights reserved. +// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/packages/google-cloud-vision/src/v1/image_annotator_client.js b/packages/google-cloud-vision/src/v1/image_annotator_client.js index 2dfaee881a2..b141c740bba 100644 --- a/packages/google-cloud-vision/src/v1/image_annotator_client.js +++ b/packages/google-cloud-vision/src/v1/image_annotator_client.js @@ -1,10 +1,10 @@ -// Copyright 2017, Google LLC All rights reserved. +// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/packages/google-cloud-vision/src/v1/index.js b/packages/google-cloud-vision/src/v1/index.js index a41489d4fd3..301ca40eb92 100644 --- a/packages/google-cloud-vision/src/v1/index.js +++ b/packages/google-cloud-vision/src/v1/index.js @@ -1,10 +1,10 @@ -// Copyright 2017, Google LLC All rights reserved. +// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/packages/google-cloud-vision/test/gapic-v1.js b/packages/google-cloud-vision/test/gapic-v1.js index 6fd4b62478c..213ebe29102 100644 --- a/packages/google-cloud-vision/test/gapic-v1.js +++ b/packages/google-cloud-vision/test/gapic-v1.js @@ -1,10 +1,10 @@ -// Copyright 2017, Google LLC All rights reserved. +// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS,