Skip to content
Merged
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 @@ -38,7 +38,7 @@ def __init__(
super(ComputerVisionClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2.0'
self.api_version = '2.1'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(
raise ValueError("Parameter 'endpoint' must not be None.")
if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
base_url = '{Endpoint}/vision/v2.0'
base_url = '{Endpoint}/vision/v2.1'

super(ComputerVisionClientConfiguration, self).__init__(base_url)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
from ._models import TextRecognitionResult
from ._models import Word
from ._computer_vision_client_enums import (
DescriptionExclude,
Details,
Gender,
OcrLanguages,
Expand Down Expand Up @@ -141,6 +142,7 @@
'TextOperationStatusCodes',
'TextRecognitionResultDimensionUnit',
'TextRecognitionResultConfidenceClass',
'DescriptionExclude',
'OcrLanguages',
'VisualFeatureTypes',
'TextRecognitionMode',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ class TextRecognitionResultConfidenceClass(str, Enum):
low = "Low"


class DescriptionExclude(str, Enum):

celebrities = "Celebrities"
landmarks = "Landmarks"


class OcrLanguages(str, Enum):

unk = "unk"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,35 @@ class AdultInfo(Model):
:type is_adult_content: bool
:param is_racy_content: A value indicating if the image is racy.
:type is_racy_content: bool
:param is_gory_content: A value indicating if the image is gory.
:type is_gory_content: bool
:param adult_score: Score from 0 to 1 that indicates how much the content
is considered adult-oriented within the image.
:type adult_score: float
:param racy_score: Score from 0 to 1 that indicates how suggestive is the
image.
:type racy_score: float
:param gore_score: Score from 0 to 1 that indicates how gory is the image.
:type gore_score: float
"""

_attribute_map = {
'is_adult_content': {'key': 'isAdultContent', 'type': 'bool'},
'is_racy_content': {'key': 'isRacyContent', 'type': 'bool'},
'is_gory_content': {'key': 'isGoryContent', 'type': 'bool'},
'adult_score': {'key': 'adultScore', 'type': 'float'},
'racy_score': {'key': 'racyScore', 'type': 'float'},
'gore_score': {'key': 'goreScore', 'type': 'float'},
}

def __init__(self, **kwargs):
super(AdultInfo, self).__init__(**kwargs)
self.is_adult_content = kwargs.get('is_adult_content', None)
self.is_racy_content = kwargs.get('is_racy_content', None)
self.is_gory_content = kwargs.get('is_gory_content', None)
self.adult_score = kwargs.get('adult_score', None)
self.racy_score = kwargs.get('racy_score', None)
self.gore_score = kwargs.get('gore_score', None)


class AreaOfInterestResult(Model):
Expand Down Expand Up @@ -912,7 +920,7 @@ class OcrResult(Model):

:param language: The BCP-47 language code of the text in the image.
:type language: str
:param text_angle: The angle, in degrees, of the detected text with
:param text_angle: The angle, in radians, of the detected text with
respect to the closest horizontal or vertical direction. After rotating
the input image clockwise by this angle, the recognized text lines become
horizontal or vertical. In combination with the orientation property it
Expand All @@ -923,10 +931,13 @@ class OcrResult(Model):
contains text at different angles, only part of the text will be
recognized correctly.
:type text_angle: float
:param orientation: Orientation of the text recognized in the image. The
value (up, down, left, or right) refers to the direction that the top of
the recognized text is facing, after the image has been rotated around its
center according to the detected text angle (see textAngle property).
:param orientation: Orientation of the text recognized in the image, if
requested. The value (up, down, left, or right) refers to the direction
that the top of the recognized text is facing, after the image has been
rotated around its center according to the detected text angle (see
textAngle property).
If detection of the orientation was not requested, or no text is detected,
the value is 'NotDetected'.
:type orientation: str
:param regions: An array of objects, where each object represents a region
of recognized text.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,35 @@ class AdultInfo(Model):
:type is_adult_content: bool
:param is_racy_content: A value indicating if the image is racy.
:type is_racy_content: bool
:param is_gory_content: A value indicating if the image is gory.
:type is_gory_content: bool
:param adult_score: Score from 0 to 1 that indicates how much the content
is considered adult-oriented within the image.
:type adult_score: float
:param racy_score: Score from 0 to 1 that indicates how suggestive is the
image.
:type racy_score: float
:param gore_score: Score from 0 to 1 that indicates how gory is the image.
:type gore_score: float
"""

_attribute_map = {
'is_adult_content': {'key': 'isAdultContent', 'type': 'bool'},
'is_racy_content': {'key': 'isRacyContent', 'type': 'bool'},
'is_gory_content': {'key': 'isGoryContent', 'type': 'bool'},
'adult_score': {'key': 'adultScore', 'type': 'float'},
'racy_score': {'key': 'racyScore', 'type': 'float'},
'gore_score': {'key': 'goreScore', 'type': 'float'},
}

def __init__(self, *, is_adult_content: bool=None, is_racy_content: bool=None, adult_score: float=None, racy_score: float=None, **kwargs) -> None:
def __init__(self, *, is_adult_content: bool=None, is_racy_content: bool=None, is_gory_content: bool=None, adult_score: float=None, racy_score: float=None, gore_score: float=None, **kwargs) -> None:
super(AdultInfo, self).__init__(**kwargs)
self.is_adult_content = is_adult_content
self.is_racy_content = is_racy_content
self.is_gory_content = is_gory_content
self.adult_score = adult_score
self.racy_score = racy_score
self.gore_score = gore_score


class AreaOfInterestResult(Model):
Expand Down Expand Up @@ -912,7 +920,7 @@ class OcrResult(Model):

:param language: The BCP-47 language code of the text in the image.
:type language: str
:param text_angle: The angle, in degrees, of the detected text with
:param text_angle: The angle, in radians, of the detected text with
respect to the closest horizontal or vertical direction. After rotating
the input image clockwise by this angle, the recognized text lines become
horizontal or vertical. In combination with the orientation property it
Expand All @@ -923,10 +931,13 @@ class OcrResult(Model):
contains text at different angles, only part of the text will be
recognized correctly.
:type text_angle: float
:param orientation: Orientation of the text recognized in the image. The
value (up, down, left, or right) refers to the direction that the top of
the recognized text is facing, after the image has been rotated around its
center according to the detected text angle (see textAngle property).
:param orientation: Orientation of the text recognized in the image, if
requested. The value (up, down, left, or right) refers to the direction
that the top of the recognized text is facing, after the image has been
rotated around its center according to the detected text angle (see
textAngle property).
If detection of the orientation was not requested, or no text is detected,
the value is 'NotDetected'.
:type orientation: str
:param regions: An array of objects, where each object represents a region
of recognized text.
Expand Down
Loading