Skip to content
Permalink
Browse files
feat(v1): add LEFT_CHEEK_CENTER and RIGHT_CHEEK_CENTER to `FaceAn…
…notation` (#103)

feat: add from_service_account_info factory
fix(v1): deprecate confidence fields in safe search annotation
docs: use absolute references for types in docstrings
chore: rename buildcop to flakybot
  • Loading branch information
yoshi-automation committed Feb 11, 2021
1 parent 2fa6dcd commit 7c3035a5fa58d7218ba4ee60fbd0b37fd5fb21ab
Showing with 3,157 additions and 2,187 deletions.
  1. +4 −4 .kokoro/test-samples.sh
  2. +1 −1 .kokoro/trampoline_v2.sh
  3. +6 −0 docs/vision_v1/image_annotator.rst
  4. +11 −0 docs/vision_v1/product_search.rst
  5. +4 −6 docs/vision_v1/services.rst
  6. +1 −0 docs/vision_v1/types.rst
  7. +6 −0 docs/vision_v1p2beta1/image_annotator.rst
  8. +3 −3 docs/vision_v1p2beta1/services.rst
  9. +1 −0 docs/vision_v1p2beta1/types.rst
  10. +6 −0 docs/vision_v1p3beta1/image_annotator.rst
  11. +11 −0 docs/vision_v1p3beta1/product_search.rst
  12. +4 −6 docs/vision_v1p3beta1/services.rst
  13. +1 −0 docs/vision_v1p3beta1/types.rst
  14. +6 −0 docs/vision_v1p4beta1/image_annotator.rst
  15. +11 −0 docs/vision_v1p4beta1/product_search.rst
  16. +4 −6 docs/vision_v1p4beta1/services.rst
  17. +1 −0 docs/vision_v1p4beta1/types.rst
  18. +2 −2 google/cloud/vision_v1/__init__.py
  19. +1 −2 google/cloud/vision_v1/proto/geometry.proto
  20. +34 −19 google/cloud/vision_v1/proto/image_annotator.proto
  21. +5 −6 google/cloud/vision_v1/proto/product_search.proto
  22. +5 −9 google/cloud/vision_v1/proto/product_search_service.proto
  23. +1 −2 google/cloud/vision_v1/proto/text_annotation.proto
  24. +1 −2 google/cloud/vision_v1/proto/web_detection.proto
  25. +21 −15 google/cloud/vision_v1/services/image_annotator/async_client.py
  26. +54 −38 google/cloud/vision_v1/services/image_annotator/client.py
  27. +17 −6 google/cloud/vision_v1/services/image_annotator/transports/grpc.py
  28. +17 −6 google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py
  29. +96 −71 google/cloud/vision_v1/services/product_search/async_client.py
  30. +143 −107 google/cloud/vision_v1/services/product_search/client.py
  31. +42 −33 google/cloud/vision_v1/services/product_search/pagers.py
  32. +17 −6 google/cloud/vision_v1/services/product_search/transports/grpc.py
  33. +17 −6 google/cloud/vision_v1/services/product_search/transports/grpc_asyncio.py
  34. +2 −2 google/cloud/vision_v1/types/geometry.py
  35. +84 −78 google/cloud/vision_v1/types/image_annotator.py
  36. +10 −10 google/cloud/vision_v1/types/product_search.py
  37. +29 −31 google/cloud/vision_v1/types/product_search_service.py
  38. +18 −18 google/cloud/vision_v1/types/text_annotation.py
  39. +8 −8 google/cloud/vision_v1/types/web_detection.py
  40. +5 −3 google/cloud/vision_v1p1beta1/services/image_annotator/async_client.py
  41. +32 −19 google/cloud/vision_v1p1beta1/services/image_annotator/client.py
  42. +17 −6 google/cloud/vision_v1p1beta1/services/image_annotator/transports/grpc.py
  43. +17 −6 google/cloud/vision_v1p1beta1/services/image_annotator/transports/grpc_asyncio.py
  44. +1 −1 google/cloud/vision_v1p1beta1/types/geometry.py
  45. +50 −50 google/cloud/vision_v1p1beta1/types/image_annotator.py
  46. +18 −18 google/cloud/vision_v1p1beta1/types/text_annotation.py
  47. +8 −8 google/cloud/vision_v1p1beta1/types/web_detection.py
  48. +10 −7 google/cloud/vision_v1p2beta1/services/image_annotator/async_client.py
  49. +39 −25 google/cloud/vision_v1p2beta1/services/image_annotator/client.py
  50. +17 −6 google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc.py
  51. +17 −6 google/cloud/vision_v1p2beta1/services/image_annotator/transports/grpc_asyncio.py
  52. +2 −2 google/cloud/vision_v1p2beta1/types/geometry.py
  53. +65 −65 google/cloud/vision_v1p2beta1/types/image_annotator.py
  54. +18 −18 google/cloud/vision_v1p2beta1/types/text_annotation.py
  55. +8 −8 google/cloud/vision_v1p2beta1/types/web_detection.py
  56. +10 −7 google/cloud/vision_v1p3beta1/services/image_annotator/async_client.py
  57. +39 −25 google/cloud/vision_v1p3beta1/services/image_annotator/client.py
  58. +17 −6 google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc.py
  59. +17 −6 google/cloud/vision_v1p3beta1/services/image_annotator/transports/grpc_asyncio.py
  60. +83 −55 google/cloud/vision_v1p3beta1/services/product_search/async_client.py
  61. +129 −90 google/cloud/vision_v1p3beta1/services/product_search/client.py
  62. +42 −33 google/cloud/vision_v1p3beta1/services/product_search/pagers.py
  63. +17 −6 google/cloud/vision_v1p3beta1/services/product_search/transports/grpc.py
  64. +17 −6 google/cloud/vision_v1p3beta1/services/product_search/transports/grpc_asyncio.py
  65. +3 −3 google/cloud/vision_v1p3beta1/types/geometry.py
  66. +69 −69 google/cloud/vision_v1p3beta1/types/image_annotator.py
  67. +9 −9 google/cloud/vision_v1p3beta1/types/product_search.py
  68. +22 −22 google/cloud/vision_v1p3beta1/types/product_search_service.py
  69. +18 −18 google/cloud/vision_v1p3beta1/types/text_annotation.py
  70. +8 −8 google/cloud/vision_v1p3beta1/types/web_detection.py
  71. +21 −15 google/cloud/vision_v1p4beta1/services/image_annotator/async_client.py
  72. +54 −38 google/cloud/vision_v1p4beta1/services/image_annotator/client.py
  73. +17 −6 google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc.py
  74. +17 −6 google/cloud/vision_v1p4beta1/services/image_annotator/transports/grpc_asyncio.py
  75. +95 −68 google/cloud/vision_v1p4beta1/services/product_search/async_client.py
  76. +142 −104 google/cloud/vision_v1p4beta1/services/product_search/client.py
  77. +42 −33 google/cloud/vision_v1p4beta1/services/product_search/pagers.py
  78. +17 −6 google/cloud/vision_v1p4beta1/services/product_search/transports/grpc.py
  79. +17 −6 google/cloud/vision_v1p4beta1/services/product_search/transports/grpc_asyncio.py
  80. +1 −1 google/cloud/vision_v1p4beta1/types/face.py
  81. +2 −2 google/cloud/vision_v1p4beta1/types/geometry.py
  82. +80 −80 google/cloud/vision_v1p4beta1/types/image_annotator.py
  83. +8 −8 google/cloud/vision_v1p4beta1/types/product_search.py
  84. +23 −23 google/cloud/vision_v1p4beta1/types/product_search_service.py
  85. +18 −18 google/cloud/vision_v1p4beta1/types/text_annotation.py
  86. +8 −8 google/cloud/vision_v1p4beta1/types/web_detection.py
  87. +10 −3 synth.metadata
  88. +132 −81 tests/unit/gapic/vision_v1/test_image_annotator.py
  89. +132 −81 tests/unit/gapic/vision_v1/test_product_search.py
  90. +132 −81 tests/unit/gapic/vision_v1p1beta1/test_image_annotator.py
  91. +132 −81 tests/unit/gapic/vision_v1p2beta1/test_image_annotator.py
  92. +132 −81 tests/unit/gapic/vision_v1p3beta1/test_image_annotator.py
  93. +132 −81 tests/unit/gapic/vision_v1p3beta1/test_product_search.py
  94. +132 −81 tests/unit/gapic/vision_v1p4beta1/test_image_annotator.py
  95. +132 −81 tests/unit/gapic/vision_v1p4beta1/test_product_search.py
@@ -87,11 +87,11 @@ for file in samples/**/requirements.txt; do
python3.6 -m nox -s "$RUN_TESTS_SESSION"
EXIT=$?

# If this is a periodic build, send the test log to the FlakyBot.
# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot.
# If this is a periodic build, send the test log to the Build Cop Bot.
# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/buildcop.
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
$KOKORO_GFILE_DIR/linux_amd64/flakybot
chmod +x $KOKORO_GFILE_DIR/linux_amd64/buildcop
$KOKORO_GFILE_DIR/linux_amd64/buildcop
fi

if [[ $EXIT -ne 0 ]]; then
@@ -159,7 +159,7 @@ if [[ -n "${KOKORO_BUILD_ID:-}" ]]; then
"KOKORO_GITHUB_COMMIT"
"KOKORO_GITHUB_PULL_REQUEST_NUMBER"
"KOKORO_GITHUB_PULL_REQUEST_COMMIT"
# For FlakyBot
# For Build Cop Bot
"KOKORO_GITHUB_COMMIT_URL"
"KOKORO_GITHUB_PULL_REQUEST_URL"
)
@@ -0,0 +1,6 @@
ImageAnnotator
--------------------------------

.. automodule:: google.cloud.vision_v1.services.image_annotator
:members:
:inherited-members:
@@ -0,0 +1,11 @@
ProductSearch
-------------------------------

.. automodule:: google.cloud.vision_v1.services.product_search
:members:
:inherited-members:


.. automodule:: google.cloud.vision_v1.services.product_search.pagers
:members:
:inherited-members:
@@ -1,9 +1,7 @@
Services for Google Cloud Vision v1 API
=======================================
.. toctree::
:maxdepth: 2

.. automodule:: google.cloud.vision_v1.services.image_annotator
:members:
:inherited-members:
.. automodule:: google.cloud.vision_v1.services.product_search
:members:
:inherited-members:
image_annotator
product_search
@@ -3,4 +3,5 @@ Types for Google Cloud Vision v1 API

.. automodule:: google.cloud.vision_v1.types
:members:
:undoc-members:
:show-inheritance:
@@ -0,0 +1,6 @@
ImageAnnotator
--------------------------------

.. automodule:: google.cloud.vision_v1p2beta1.services.image_annotator
:members:
:inherited-members:
@@ -1,6 +1,6 @@
Services for Google Cloud Vision v1p2beta1 API
==============================================
.. toctree::
:maxdepth: 2

.. automodule:: google.cloud.vision_v1p2beta1.services.image_annotator
:members:
:inherited-members:
image_annotator
@@ -3,4 +3,5 @@ Types for Google Cloud Vision v1p2beta1 API

.. automodule:: google.cloud.vision_v1p2beta1.types
:members:
:undoc-members:
:show-inheritance:
@@ -0,0 +1,6 @@
ImageAnnotator
--------------------------------

.. automodule:: google.cloud.vision_v1p3beta1.services.image_annotator
:members:
:inherited-members:
@@ -0,0 +1,11 @@
ProductSearch
-------------------------------

.. automodule:: google.cloud.vision_v1p3beta1.services.product_search
:members:
:inherited-members:


.. automodule:: google.cloud.vision_v1p3beta1.services.product_search.pagers
:members:
:inherited-members:
@@ -1,9 +1,7 @@
Services for Google Cloud Vision v1p3beta1 API
==============================================
.. toctree::
:maxdepth: 2

.. automodule:: google.cloud.vision_v1p3beta1.services.image_annotator
:members:
:inherited-members:
.. automodule:: google.cloud.vision_v1p3beta1.services.product_search
:members:
:inherited-members:
image_annotator
product_search
@@ -3,4 +3,5 @@ Types for Google Cloud Vision v1p3beta1 API

.. automodule:: google.cloud.vision_v1p3beta1.types
:members:
:undoc-members:
:show-inheritance:
@@ -0,0 +1,6 @@
ImageAnnotator
--------------------------------

.. automodule:: google.cloud.vision_v1p4beta1.services.image_annotator
:members:
:inherited-members:
@@ -0,0 +1,11 @@
ProductSearch
-------------------------------

.. automodule:: google.cloud.vision_v1p4beta1.services.product_search
:members:
:inherited-members:


.. automodule:: google.cloud.vision_v1p4beta1.services.product_search.pagers
:members:
:inherited-members:
@@ -1,9 +1,7 @@
Services for Google Cloud Vision v1p4beta1 API
==============================================
.. toctree::
:maxdepth: 2

.. automodule:: google.cloud.vision_v1p4beta1.services.image_annotator
:members:
:inherited-members:
.. automodule:: google.cloud.vision_v1p4beta1.services.product_search
:members:
:inherited-members:
image_annotator
product_search
@@ -3,4 +3,5 @@ Types for Google Cloud Vision v1p4beta1 API

.. automodule:: google.cloud.vision_v1p4beta1.types
:members:
:undoc-members:
:show-inheritance:
@@ -152,7 +152,6 @@ class ImageAnnotatorClient(VisionHelpers, IacImageAnnotatorClient):
"GetReferenceImageRequest",
"Image",
"ImageAnnotationContext",
"ImageAnnotatorClient",
"ImageContext",
"ImageProperties",
"ImageSource",
@@ -180,6 +179,7 @@ class ImageAnnotatorClient(VisionHelpers, IacImageAnnotatorClient):
"Paragraph",
"Position",
"Product",
"ProductSearchClient",
"ProductSearchParams",
"ProductSearchResults",
"ProductSet",
@@ -198,5 +198,5 @@ class ImageAnnotatorClient(VisionHelpers, IacImageAnnotatorClient):
"WebDetection",
"WebDetectionParams",
"Word",
"ProductSearchClient",
"ImageAnnotatorClient",
)
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

@@ -48,7 +47,8 @@ service ImageAnnotator {
"https://www.googleapis.com/auth/cloud-vision";

// Run image detection and annotation for a batch of images.
rpc BatchAnnotateImages(BatchAnnotateImagesRequest) returns (BatchAnnotateImagesResponse) {
rpc BatchAnnotateImages(BatchAnnotateImagesRequest)
returns (BatchAnnotateImagesResponse) {
option (google.api.http) = {
post: "/v1/images:annotate"
body: "*"
@@ -71,7 +71,8 @@ service ImageAnnotator {
// AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each
// file provided and perform detection and annotation for each image
// extracted.
rpc BatchAnnotateFiles(BatchAnnotateFilesRequest) returns (BatchAnnotateFilesResponse) {
rpc BatchAnnotateFiles(BatchAnnotateFilesRequest)
returns (BatchAnnotateFilesResponse) {
option (google.api.http) = {
post: "/v1/files:annotate"
body: "*"
@@ -96,7 +97,8 @@ service ImageAnnotator {
//
// This service will write image annotation outputs to json files in customer
// GCS bucket, each json file containing BatchAnnotateImagesResponse proto.
rpc AsyncBatchAnnotateImages(AsyncBatchAnnotateImagesRequest) returns (google.longrunning.Operation) {
rpc AsyncBatchAnnotateImages(AsyncBatchAnnotateImagesRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/images:asyncBatchAnnotate"
body: "*"
@@ -122,7 +124,8 @@ service ImageAnnotator {
// `google.longrunning.Operations` interface.
// `Operation.metadata` contains `OperationMetadata` (metadata).
// `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results).
rpc AsyncBatchAnnotateFiles(AsyncBatchAnnotateFilesRequest) returns (google.longrunning.Operation) {
rpc AsyncBatchAnnotateFiles(AsyncBatchAnnotateFilesRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/files:asyncBatchAnnotate"
body: "*"
@@ -242,6 +245,9 @@ message Image {
// Image content, represented as a stream of bytes.
// Note: As with all `bytes` fields, protobuffers use a pure binary
// representation, whereas JSON representations use base64.
//
// Currently, this field only works for BatchAnnotateImages requests. It does
// not work for AsyncBatchAnnotateImages requests.
bytes content = 1;

// Google Cloud Storage image location, or publicly-accessible image
@@ -385,6 +391,12 @@ message FaceAnnotation {

// Chin right gonion.
CHIN_RIGHT_GONION = 34;

// Left cheek center.
LEFT_CHEEK_CENTER = 35;

// Right cheek center.
RIGHT_CHEEK_CENTER = 36;
}

// Face landmark type.
@@ -569,27 +581,27 @@ message SafeSearchAnnotation {

// Confidence of adult_score. Range [0, 1]. 0 means not confident, 1 means
// very confident.
float adult_confidence = 16;
float adult_confidence = 16 [deprecated = true];

// Confidence of spoof_score. Range [0, 1]. 0 means not confident, 1 means
// very confident.
float spoof_confidence = 18;
float spoof_confidence = 18 [deprecated = true];

// Confidence of medical_score. Range [0, 1]. 0 means not confident, 1 means
// very confident.
float medical_confidence = 20;
float medical_confidence = 20 [deprecated = true];

// Confidence of violence_score. Range [0, 1]. 0 means not confident, 1 means
// very confident.
float violence_confidence = 22;
float violence_confidence = 22 [deprecated = true];

// Confidence of racy_score. Range [0, 1]. 0 means not confident, 1 means very
// confident.
float racy_confidence = 24;
float racy_confidence = 24 [deprecated = true];

// Confidence of nsfw_score. Range [0, 1]. 0 means not confident, 1 means very
// confident.
float nsfw_confidence = 26;
float nsfw_confidence = 26 [deprecated = true];
}

// Rectangle determined by min and max `LatLng` pairs.
@@ -667,7 +679,6 @@ message WebDetectionParams {
// Parameters for text detections. This is used to control TEXT_DETECTION and
// DOCUMENT_TEXT_DETECTION features.
message TextDetectionParams {

// By default, Cloud Vision API only includes confidence score for
// DOCUMENT_TEXT_DETECTION result. Set the flag to true to include confidence
// score for TEXT_DETECTION as well.
@@ -781,7 +792,8 @@ message AnnotateImageResponse {
// Multiple image annotation requests are batched into a single service call.
message BatchAnnotateImagesRequest {
// Required. Individual image annotation requests for this batch.
repeated AnnotateImageRequest requests = 1 [(google.api.field_behavior) = REQUIRED];
repeated AnnotateImageRequest requests = 1
[(google.api.field_behavior) = REQUIRED];

// Optional. Target project and location to make a call.
//
@@ -852,9 +864,10 @@ message AnnotateFileResponse {

// A list of requests to annotate files using the BatchAnnotateFiles API.
message BatchAnnotateFilesRequest {
// Required. The list of file annotation requests. Right now we support only one
// AnnotateFileRequest in BatchAnnotateFilesRequest.
repeated AnnotateFileRequest requests = 1 [(google.api.field_behavior) = REQUIRED];
// Required. The list of file annotation requests. Right now we support only
// one AnnotateFileRequest in BatchAnnotateFilesRequest.
repeated AnnotateFileRequest requests = 1
[(google.api.field_behavior) = REQUIRED];

// Optional. Target project and location to make a call.
//
@@ -902,7 +915,8 @@ message AsyncAnnotateFileResponse {
// Request for async image annotation for a list of images.
message AsyncBatchAnnotateImagesRequest {
// Required. Individual image annotation requests for this batch.
repeated AnnotateImageRequest requests = 1 [(google.api.field_behavior) = REQUIRED];
repeated AnnotateImageRequest requests = 1
[(google.api.field_behavior) = REQUIRED];

// Required. The desired output location and metadata (e.g. format).
OutputConfig output_config = 2 [(google.api.field_behavior) = REQUIRED];
@@ -932,7 +946,8 @@ message AsyncBatchAnnotateImagesResponse {
// call.
message AsyncBatchAnnotateFilesRequest {
// Required. Individual async file annotation requests for this batch.
repeated AsyncAnnotateFileRequest requests = 1 [(google.api.field_behavior) = REQUIRED];
repeated AsyncAnnotateFileRequest requests = 1
[(google.api.field_behavior) = REQUIRED];

// Optional. Target project and location to make a call.
//
Loading

0 comments on commit 7c3035a

Please sign in to comment.