diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 1ce60852..0eb02fda 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:e7bb19d47c13839fe8c147e50e02e8b6cf5da8edd1af8b82208cd6f66cc2829c -# created: 2022-07-05T18:31:20.838186805Z + digest: sha256:9db98b055a7f8bd82351238ccaacfd3cda58cdf73012ab58b8da146368330021 +# created: 2022-07-25T16:02:49.174178716Z diff --git a/CHANGELOG.md b/CHANGELOG.md index 823fc68f..628c1608 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://pypi.org/project/google-cloud-vision/#history +## [3.1.0](https://github.com/googleapis/python-vision/compare/v3.0.0...v3.1.0) (2022-08-05) + + +### Features + +* Add TextDetectionParams.advanced_ocr_options ([#464](https://github.com/googleapis/python-vision/issues/464)) ([0886a2d](https://github.com/googleapis/python-vision/commit/0886a2d444c2ec9067eb36286d258f569b02954b)) + ## [3.0.0](https://github.com/googleapis/python-vision/compare/v2.8.0...v3.0.0) (2022-07-18) diff --git a/google/cloud/vision_v1/services/product_search/async_client.py b/google/cloud/vision_v1/services/product_search/async_client.py index 97cbee53..cb4c5b27 100644 --- a/google/cloud/vision_v1/services/product_search/async_client.py +++ b/google/cloud/vision_v1/services/product_search/async_client.py @@ -2525,9 +2525,6 @@ async def sample_purge_products(): } - The JSON representation for Empty is empty JSON - object {}. - """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have diff --git a/google/cloud/vision_v1/services/product_search/client.py b/google/cloud/vision_v1/services/product_search/client.py index 685704e9..2c67c53d 100644 --- a/google/cloud/vision_v1/services/product_search/client.py +++ b/google/cloud/vision_v1/services/product_search/client.py @@ -2634,9 +2634,6 @@ def sample_purge_products(): } - The JSON representation for Empty is empty JSON - object {}. - """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have diff --git a/google/cloud/vision_v1/types/image_annotator.py b/google/cloud/vision_v1/types/image_annotator.py index 1b47e651..8eeac3f6 100644 --- a/google/cloud/vision_v1/types/image_annotator.py +++ b/google/cloud/vision_v1/types/image_annotator.py @@ -802,12 +802,19 @@ class TextDetectionParams(proto.Message): 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. + advanced_ocr_options (Sequence[str]): + A list of advanced OCR options to fine-tune + OCR behavior. """ enable_text_detection_confidence_score = proto.Field( proto.BOOL, number=9, ) + advanced_ocr_options = proto.RepeatedField( + proto.STRING, + number=11, + ) class ImageContext(proto.Message): diff --git a/google/cloud/vision_v1p1beta1/types/image_annotator.py b/google/cloud/vision_v1p1beta1/types/image_annotator.py index 7904f634..4e5818f3 100644 --- a/google/cloud/vision_v1p1beta1/types/image_annotator.py +++ b/google/cloud/vision_v1p1beta1/types/image_annotator.py @@ -722,12 +722,19 @@ class TextDetectionParams(proto.Message): 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. + advanced_ocr_options (Sequence[str]): + A list of advanced OCR options to fine-tune + OCR behavior. """ enable_text_detection_confidence_score = proto.Field( proto.BOOL, number=9, ) + advanced_ocr_options = proto.RepeatedField( + proto.STRING, + number=11, + ) class ImageContext(proto.Message): diff --git a/google/cloud/vision_v1p2beta1/types/image_annotator.py b/google/cloud/vision_v1p2beta1/types/image_annotator.py index d058badb..90c647a4 100644 --- a/google/cloud/vision_v1p2beta1/types/image_annotator.py +++ b/google/cloud/vision_v1p2beta1/types/image_annotator.py @@ -745,12 +745,19 @@ class TextDetectionParams(proto.Message): 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. + advanced_ocr_options (Sequence[str]): + A list of advanced OCR options to fine-tune + OCR behavior. """ enable_text_detection_confidence_score = proto.Field( proto.BOOL, number=9, ) + advanced_ocr_options = proto.RepeatedField( + proto.STRING, + number=11, + ) class ImageContext(proto.Message): diff --git a/google/cloud/vision_v1p3beta1/types/image_annotator.py b/google/cloud/vision_v1p3beta1/types/image_annotator.py index bddec8bb..aa93bfd0 100644 --- a/google/cloud/vision_v1p3beta1/types/image_annotator.py +++ b/google/cloud/vision_v1p3beta1/types/image_annotator.py @@ -792,12 +792,19 @@ class TextDetectionParams(proto.Message): 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. + advanced_ocr_options (Sequence[str]): + A list of advanced OCR options to fine-tune + OCR behavior. """ enable_text_detection_confidence_score = proto.Field( proto.BOOL, number=9, ) + advanced_ocr_options = proto.RepeatedField( + proto.STRING, + number=11, + ) class ImageContext(proto.Message): diff --git a/google/cloud/vision_v1p4beta1/services/product_search/async_client.py b/google/cloud/vision_v1p4beta1/services/product_search/async_client.py index 6d2adcd7..b5259a13 100644 --- a/google/cloud/vision_v1p4beta1/services/product_search/async_client.py +++ b/google/cloud/vision_v1p4beta1/services/product_search/async_client.py @@ -2517,9 +2517,6 @@ async def sample_purge_products(): } - The JSON representation for Empty is empty JSON - object {}. - """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have diff --git a/google/cloud/vision_v1p4beta1/services/product_search/client.py b/google/cloud/vision_v1p4beta1/services/product_search/client.py index 0310ffb3..7301e070 100644 --- a/google/cloud/vision_v1p4beta1/services/product_search/client.py +++ b/google/cloud/vision_v1p4beta1/services/product_search/client.py @@ -2638,9 +2638,6 @@ def sample_purge_products(): } - The JSON representation for Empty is empty JSON - object {}. - """ # Create or coerce a protobuf request object. # Quick check: If we got a request object, we should *not* have diff --git a/google/cloud/vision_v1p4beta1/types/image_annotator.py b/google/cloud/vision_v1p4beta1/types/image_annotator.py index ca8d661f..466aa26e 100644 --- a/google/cloud/vision_v1p4beta1/types/image_annotator.py +++ b/google/cloud/vision_v1p4beta1/types/image_annotator.py @@ -811,12 +811,19 @@ class TextDetectionParams(proto.Message): 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. + advanced_ocr_options (Sequence[str]): + A list of advanced OCR options to fine-tune + OCR behavior. """ enable_text_detection_confidence_score = proto.Field( proto.BOOL, number=9, ) + advanced_ocr_options = proto.RepeatedField( + proto.STRING, + number=11, + ) class ImageContext(proto.Message): diff --git a/noxfile.py b/noxfile.py index d838d93c..5fa777df 100644 --- a/noxfile.py +++ b/noxfile.py @@ -335,7 +335,8 @@ def prerelease_deps(session): # Install all dependencies session.install("-e", ".[all, tests, tracing]") - session.install(*UNIT_TEST_STANDARD_DEPENDENCIES) + unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES + session.install(*unit_deps_all) system_deps_all = ( SYSTEM_TEST_STANDARD_DEPENDENCIES + SYSTEM_TEST_EXTERNAL_DEPENDENCIES @@ -364,12 +365,6 @@ def prerelease_deps(session): session.install(*constraints_deps) - if os.path.exists("samples/snippets/requirements.txt"): - session.install("-r", "samples/snippets/requirements.txt") - - if os.path.exists("samples/snippets/requirements-test.txt"): - session.install("-r", "samples/snippets/requirements-test.txt") - prerel_deps = [ "protobuf", # dependency of grpc @@ -406,11 +401,19 @@ def prerelease_deps(session): system_test_folder_path = os.path.join("tests", "system") # Only run system tests if found. - if os.path.exists(system_test_path) or os.path.exists(system_test_folder_path): - session.run("py.test", "tests/system") - - snippets_test_path = os.path.join("samples", "snippets") - - # Only run samples tests if found. - if os.path.exists(snippets_test_path): - session.run("py.test", "samples/snippets") + if os.path.exists(system_test_path): + session.run( + "py.test", + "--verbose", + f"--junitxml=system_{session.python}_sponge_log.xml", + system_test_path, + *session.posargs, + ) + if os.path.exists(system_test_folder_path): + session.run( + "py.test", + "--verbose", + f"--junitxml=system_{session.python}_sponge_log.xml", + system_test_folder_path, + *session.posargs, + ) diff --git a/samples/snippets/crop_hints/requirements.txt b/samples/snippets/crop_hints/requirements.txt index d23cb623..c8d62b9e 100644 --- a/samples/snippets/crop_hints/requirements.txt +++ b/samples/snippets/crop_hints/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-vision==2.7.3 -pillow==9.1.1 +google-cloud-vision==3.0.0 +pillow==9.2.0 diff --git a/samples/snippets/detect/requirements.txt b/samples/snippets/detect/requirements.txt index f35b6f2f..6ddb82fc 100644 --- a/samples/snippets/detect/requirements.txt +++ b/samples/snippets/detect/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-vision==2.7.3 -google-cloud-storage==2.3.0 +google-cloud-vision==3.0.0 +google-cloud-storage==2.5.0 diff --git a/samples/snippets/document_text/requirements.txt b/samples/snippets/document_text/requirements.txt index d23cb623..c8d62b9e 100644 --- a/samples/snippets/document_text/requirements.txt +++ b/samples/snippets/document_text/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-vision==2.7.3 -pillow==9.1.1 +google-cloud-vision==3.0.0 +pillow==9.2.0 diff --git a/samples/snippets/face_detection/requirements.txt b/samples/snippets/face_detection/requirements.txt index d23cb623..c8d62b9e 100644 --- a/samples/snippets/face_detection/requirements.txt +++ b/samples/snippets/face_detection/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-vision==2.7.3 -pillow==9.1.1 +google-cloud-vision==3.0.0 +pillow==9.2.0 diff --git a/samples/snippets/product_search/requirements.txt b/samples/snippets/product_search/requirements.txt index f35b6f2f..6ddb82fc 100644 --- a/samples/snippets/product_search/requirements.txt +++ b/samples/snippets/product_search/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-vision==2.7.3 -google-cloud-storage==2.3.0 +google-cloud-vision==3.0.0 +google-cloud-storage==2.5.0 diff --git a/samples/snippets/quickstart/requirements.txt b/samples/snippets/quickstart/requirements.txt index 4f1e9fae..2693c748 100644 --- a/samples/snippets/quickstart/requirements.txt +++ b/samples/snippets/quickstart/requirements.txt @@ -1 +1 @@ -google-cloud-vision==2.7.3 +google-cloud-vision==3.0.0 diff --git a/samples/snippets/web/requirements.txt b/samples/snippets/web/requirements.txt index 4f1e9fae..2693c748 100644 --- a/samples/snippets/web/requirements.txt +++ b/samples/snippets/web/requirements.txt @@ -1 +1 @@ -google-cloud-vision==2.7.3 +google-cloud-vision==3.0.0 diff --git a/setup.py b/setup.py index 7e7d2a09..d889e295 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ name = "google-cloud-vision" description = "Cloud Vision API API client library" -version = "3.0.0" +version = "3.1.0" release_status = "Development Status :: 5 - Production/Stable" dependencies = [ "google-api-core[grpc] >= 1.32.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*",