Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR] cognitiveservices/data-plane/ComputerVision #4946

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -886,18 +886,14 @@ def get_text_operation_result(
get_text_operation_result.metadata = {'url': '/textOperations/{operationId}'}

def batch_read_file(
self, url, mode, custom_headers=None, raw=False, **operation_config):
self, url, custom_headers=None, raw=False, **operation_config):
"""Use this interface to get the result of a Read operation, employing the
state-of-the-art Optical Character Recognition (OCR) algorithms
optimized for text-heavy documents. When you use the Read File
interface, the response contains a field called "Operation-Location".
The "Operation-Location" field contains the URL that you must use for
your "Read Operation Result" operation to access OCR results.​.
interface, the response contains a field called 'Operation-Location'.
The 'Operation-Location' field contains the URL that you must use for
your 'GetReadOperationResult' operation to access OCR results.​.

:param mode: Type of text to recognize. Possible values include:
'Handwritten', 'Printed'
:type mode: str or
~azure.cognitiveservices.vision.computervision.models.TextRecognitionMode
:param url: Publicly reachable URL of an image.
:type url: str
:param dict custom_headers: headers that will be added to the request
Expand All @@ -921,7 +917,6 @@ def batch_read_file(

# Construct parameters
query_parameters = {}
query_parameters['mode'] = self._serialize.query("mode", mode, 'TextRecognitionMode')

# Construct headers
header_parameters = {}
Expand Down Expand Up @@ -950,11 +945,11 @@ def batch_read_file(
def get_read_operation_result(
self, operation_id, custom_headers=None, raw=False, **operation_config):
"""This interface is used for getting OCR results of Read operation. The
URL to this interface should be retrieved from "Operation-Location"
URL to this interface should be retrieved from 'Operation-Location'
field returned from Batch Read File interface.

:param operation_id: Id of read operation returned in the response of
the "Batch Read File" interface.
the 'Batch Read File' interface.
:type operation_id: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
Expand Down Expand Up @@ -1727,21 +1722,17 @@ def recognize_text_in_stream(
recognize_text_in_stream.metadata = {'url': '/recognizeText'}

def batch_read_file_in_stream(
self, image, mode, custom_headers=None, raw=False, callback=None, **operation_config):
self, image, custom_headers=None, raw=False, callback=None, **operation_config):
"""Use this interface to get the result of a Read Document operation,
employing the state-of-the-art Optical Character Recognition (OCR)
algorithms optimized for text-heavy documents. When you use the Read
Document interface, the response contains a field called
"Operation-Location". The "Operation-Location" field contains the URL
that you must use for your "Get Read Result operation" to access OCR
'Operation-Location'. The 'Operation-Location' field contains the URL
that you must use for your 'Get Read Result operation' to access OCR
results.​.

:param image: An image stream.
:type image: Generator
:param mode: Type of text to recognize. Possible values include:
'Handwritten', 'Printed'
:type mode: str or
~azure.cognitiveservices.vision.computervision.models.TextRecognitionMode
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
Expand All @@ -1766,7 +1757,6 @@ def batch_read_file_in_stream(

# Construct parameters
query_parameters = {}
query_parameters['mode'] = self._serialize.query("mode", mode, 'TextRecognitionMode')

# Construct headers
header_parameters = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class Line(Model):
"""Json object representing a recognized text line.
"""An object representing a recognized text line.

:param bounding_box: Bounding box of a recognized line.
:type bounding_box: list[int]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class Line(Model):
"""Json object representing a recognized text line.
"""An object representing a recognized text line.

:param bounding_box: Bounding box of a recognized line.
:type bounding_box: list[int]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class ReadOperationResult(Model):
Started', 'Running', 'Failed', 'Succeeded'
:type status: str or
~azure.cognitiveservices.vision.computervision.models.TextOperationStatusCodes
:param recognition_results: A array of text recognition result of the read
operation.
:param recognition_results: An array of text recognition result of the
read operation.
:type recognition_results:
list[~azure.cognitiveservices.vision.computervision.models.TextRecognitionResult]
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class ReadOperationResult(Model):
Started', 'Running', 'Failed', 'Succeeded'
:type status: str or
~azure.cognitiveservices.vision.computervision.models.TextOperationStatusCodes
:param recognition_results: A array of text recognition result of the read
operation.
:param recognition_results: An array of text recognition result of the
read operation.
:type recognition_results:
list[~azure.cognitiveservices.vision.computervision.models.TextRecognitionResult]
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class TextRecognitionResult(Model):
"""Json object representing a recognized text region.
"""An object representing a recognized text region.

All required parameters must be populated in order to send to Azure.

Expand All @@ -27,7 +27,7 @@ class TextRecognitionResult(Model):
:param height: The height of the image in pixels or the PDF in inches.
:type height: float
:param unit: The unit used in the Width, Height and BoundingBox. For
images, the unit is "pixel". For PDF, the unit is "inch". Possible values
images, the unit is 'pixel'. For PDF, the unit is 'inch'. Possible values
include: 'pixel', 'inch'
:type unit: str or
~azure.cognitiveservices.vision.computervision.models.TextRecognitionResultDimensionUnit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class TextRecognitionResult(Model):
"""Json object representing a recognized text region.
"""An object representing a recognized text region.

All required parameters must be populated in order to send to Azure.

Expand All @@ -27,7 +27,7 @@ class TextRecognitionResult(Model):
:param height: The height of the image in pixels or the PDF in inches.
:type height: float
:param unit: The unit used in the Width, Height and BoundingBox. For
images, the unit is "pixel". For PDF, the unit is "inch". Possible values
images, the unit is 'pixel'. For PDF, the unit is 'inch'. Possible values
include: 'pixel', 'inch'
:type unit: str or
~azure.cognitiveservices.vision.computervision.models.TextRecognitionResultDimensionUnit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class Word(Model):
"""Json object representing a recognized word.
"""An object representing a recognized word.

All required parameters must be populated in order to send to Azure.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class Word(Model):
"""Json object representing a recognized word.
"""An object representing a recognized word.

All required parameters must be populated in order to send to Azure.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
# regenerated.
# --------------------------------------------------------------------------

VERSION = "0.3.0"
VERSION = "2.0"

1 change: 1 addition & 0 deletions azure-cognitiveservices-vision-computervision/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
version=version,
description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME),
long_description=readme + '\n\n' + history,
long_description_content_type='text/x-rst',
license='MIT License',
author='Microsoft Corporation',
author_email='azpysdkhelp@microsoft.com',
Expand Down