azure.cognitiveservices.vision.computervision.models module

exception azure.cognitiveservices.vision.computervision.models.ComputerVisionErrorException(deserialize, response, *args)[source]

Bases: msrest.exceptions.HttpOperationError

Server responsed with exception of type: ‘ComputerVisionError’.

Parameters:
  • deserialize – A deserializer
  • response – Server response to be deserialized.
class azure.cognitiveservices.vision.computervision.models.Word(*, bounding_box=None, text: str = None, **kwargs)[source]

Bases: msrest.serialization.Model

Word.

Parameters:
  • bounding_box (list[int]) –
  • text (str) –
class azure.cognitiveservices.vision.computervision.models.Line(*, bounding_box=None, text: str = None, words=None, **kwargs)[source]

Bases: msrest.serialization.Model

Line.

Parameters:
  • bounding_box (list[int]) –
  • text (str) –
  • words (list[Word]) –
class azure.cognitiveservices.vision.computervision.models.RecognitionResult(*, lines=None, **kwargs)[source]

Bases: msrest.serialization.Model

RecognitionResult.

Parameters:lines (list[Line]) –
class azure.cognitiveservices.vision.computervision.models.TextOperationResult(*, status=None, recognition_result=None, **kwargs)[source]

Bases: msrest.serialization.Model

TextOperationResult.

Parameters:
  • status (str or TextOperationStatusCodes) – Status of the text operation. Possible values include: ‘Not Started’, ‘Running’, ‘Failed’, ‘Succeeded’
  • recognition_result (RecognitionResult) –
class azure.cognitiveservices.vision.computervision.models.FaceRectangle(*, left: int = None, top: int = None, width: int = None, height: int = None, **kwargs)[source]

Bases: msrest.serialization.Model

An object describing face rectangle.

Parameters:
  • left (int) – X-coordinate of the top left point of the face.
  • top (int) – Y-coordinate of the top left point of the face.
  • width (int) – Width measured from the top-left point of the face.
  • height (int) – Height measured from the top-left point of the face.
class azure.cognitiveservices.vision.computervision.models.CelebritiesModel(*, name: str = None, confidence: float = None, face_rectangle=None, **kwargs)[source]

Bases: msrest.serialization.Model

An object describing possible celebrity identification.

Parameters:
  • name (str) – Name of the celebrity.
  • confidence (float) – Level of confidence ranging from 0 to 1.
  • face_rectangle (FaceRectangle) –
class azure.cognitiveservices.vision.computervision.models.LandmarksModel(*, name: str = None, confidence: float = None, **kwargs)[source]

Bases: msrest.serialization.Model

A landmark recognized in the image.

Parameters:
  • name (str) – Name of the landmark.
  • confidence (float) – Confidence level for the landmark recognition.
class azure.cognitiveservices.vision.computervision.models.CategoryDetail(*, celebrities=None, landmarks=None, **kwargs)[source]

Bases: msrest.serialization.Model

An object describing additional category details.

Parameters:
  • celebrities (list[CelebritiesModel]) – An array of celebrities if any identified.
  • landmarks (list[LandmarksModel]) – An array of landmarks if any identified.
class azure.cognitiveservices.vision.computervision.models.Category(*, name: str = None, score: float = None, detail=None, **kwargs)[source]

Bases: msrest.serialization.Model

An object describing identified category.

Parameters:
  • name (str) – Name of the category.
  • score (float) – Scoring of the category.
  • detail (CategoryDetail) –
class azure.cognitiveservices.vision.computervision.models.AdultInfo(*, is_adult_content: bool = None, is_racy_content: bool = None, adult_score: float = None, racy_score: float = None, **kwargs)[source]

Bases: msrest.serialization.Model

An object describing whether the image contains adult-oriented content and/or is racy.

Parameters:
  • is_adult_content (bool) – A value indicating if the image contains adult-oriented content.
  • is_racy_content (bool) – A value indicating if the image is race.
  • adult_score (float) – Score from 0 to 1 that indicates how much of adult content is within the image.
  • racy_score (float) – Score from 0 to 1 that indicates how suggestive is the image.
class azure.cognitiveservices.vision.computervision.models.ColorInfo(*, dominant_color_foreground: str = None, dominant_color_background: str = None, dominant_colors=None, accent_color: str = None, is_bw_img: bool = None, **kwargs)[source]

Bases: msrest.serialization.Model

An object providing additional metadata describing color attributes.

Parameters:
  • dominant_color_foreground (str) – Possible dominant foreground color.
  • dominant_color_background (str) – Possible dominant background color.
  • dominant_colors (list[str]) – An array of possible dominant colors.
  • accent_color (str) – Possible accent color.
  • is_bw_img (bool) – A value indicating if the image is black and white.
class azure.cognitiveservices.vision.computervision.models.ImageType(*, clip_art_type: float = None, line_drawing_type: float = None, **kwargs)[source]

Bases: msrest.serialization.Model

An object providing possible image types and matching confidence levels.

Parameters:
  • clip_art_type (float) – Confidence level that the image is a clip art.
  • line_drawing_type (float) – Confidence level that the image is a line drawing.
class azure.cognitiveservices.vision.computervision.models.ImageTag(*, name: str = None, confidence: float = None, hint: str = None, **kwargs)[source]

Bases: msrest.serialization.Model

An image caption, i.e. a brief description of what the image depicts.

Parameters:
  • name (str) – The tag value
  • confidence (float) – The level of confidence the service has in the caption
  • hint (str) – Optional categorization for the tag
class azure.cognitiveservices.vision.computervision.models.ImageCaption(*, text: str = None, confidence: float = None, **kwargs)[source]

Bases: msrest.serialization.Model

An image caption, i.e. a brief description of what the image depicts.

Parameters:
  • text (str) – The text of the caption
  • confidence (float) – The level of confidence the service has in the caption
class azure.cognitiveservices.vision.computervision.models.ImageDescriptionDetails(*, tags=None, captions=None, **kwargs)[source]

Bases: msrest.serialization.Model

A collection of content tags, along with a list of captions sorted by confidence level, and image metadata.

Parameters:
  • tags (list[str]) – A collection of image tags.
  • captions (list[ImageCaption]) – A list of captions, sorted by confidence level.
class azure.cognitiveservices.vision.computervision.models.FaceDescription(*, age: int = None, gender=None, face_rectangle=None, **kwargs)[source]

Bases: msrest.serialization.Model

An object describing a face identified in the image.

Parameters:
  • age (int) – Possible age of the face.
  • gender (str or Gender) – Possible gender of the face. Possible values include: ‘Male’, ‘Female’
  • face_rectangle (FaceRectangle) –
class azure.cognitiveservices.vision.computervision.models.ImageMetadata(*, width: int = None, height: int = None, format: str = None, **kwargs)[source]

Bases: msrest.serialization.Model

Image metadata.

Parameters:
  • width (int) – Image width
  • height (int) – Image height
  • format (str) – Image format
class azure.cognitiveservices.vision.computervision.models.ImageAnalysis(*, categories=None, adult=None, color=None, image_type=None, tags=None, description=None, faces=None, request_id: str = None, metadata=None, **kwargs)[source]

Bases: msrest.serialization.Model

Result of AnalyzeImage operation.

Parameters:
class azure.cognitiveservices.vision.computervision.models.OcrWord(*, bounding_box: str = None, text: str = None, **kwargs)[source]

Bases: msrest.serialization.Model

Information on a recognized word.

Parameters:
  • bounding_box (str) – Bounding box of a recognized word. The four integers represent the x-coordinate of the left edge, the y-coordinate of the top edge, width, and height of the bounding box, in the coordinate system of the input image, after it has been rotated around its center according to the detected text angle (see textAngle property), with the origin at the top-left corner, and the y-axis pointing down.
  • text (str) – String value of a recognized word.
class azure.cognitiveservices.vision.computervision.models.OcrLine(*, bounding_box: str = None, words=None, **kwargs)[source]

Bases: msrest.serialization.Model

An object describing a single recognized line of text.

Parameters:
  • bounding_box (str) – Bounding box of a recognized line. The four integers represent the x-coordinate of the left edge, the y-coordinate of the top edge, width, and height of the bounding box, in the coordinate system of the input image, after it has been rotated around its center according to the detected text angle (see textAngle property), with the origin at the top-left corner, and the y-axis pointing down.
  • words (list[OcrWord]) – An array of objects, where each object represents a recognized word.
class azure.cognitiveservices.vision.computervision.models.OcrRegion(*, bounding_box: str = None, lines=None, **kwargs)[source]

Bases: msrest.serialization.Model

A region consists of multiple lines (e.g. a column of text in a multi-column document).

Parameters:
  • bounding_box (str) – Bounding box of a recognized region. The four integers represent the x-coordinate of the left edge, the y-coordinate of the top edge, width, and height of the bounding box, in the coordinate system of the input image, after it has been rotated around its center according to the detected text angle (see textAngle property), with the origin at the top-left corner, and the y-axis pointing down.
  • lines (list[OcrLine]) –
class azure.cognitiveservices.vision.computervision.models.OcrResult(*, language: str = None, text_angle: float = None, orientation: str = None, regions=None, **kwargs)[source]

Bases: msrest.serialization.Model

OcrResult.

Parameters:
  • language (str) – The BCP-47 language code of the text in the image.
  • text_angle (float) – The angle, in degrees, 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 can be used to overlay recognition results correctly on the original image, by rotating either the original image or recognition results by a suitable angle around the center of the original image. If the angle cannot be confidently detected, this property is not present. If the image contains text at different angles, only part of the text will be recognized correctly.
  • orientation (str) – 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).
  • regions (list[OcrRegion]) – An array of objects, where each object represents a region of recognized text.
class azure.cognitiveservices.vision.computervision.models.ModelDescription(*, name: str = None, categories=None, **kwargs)[source]

Bases: msrest.serialization.Model

An object describing supported model by name and categories.

Parameters:
  • name (str) –
  • categories (list[str]) –
class azure.cognitiveservices.vision.computervision.models.ListModelsResult(**kwargs)[source]

Bases: msrest.serialization.Model

Result of the List Domain Models operation.

Variables are only populated by the server, and will be ignored when sending a request.

Variables:models_property (list[ModelDescription]) – An array of supported models.
class azure.cognitiveservices.vision.computervision.models.DomainModelResults(*, result=None, request_id: str = None, metadata=None, **kwargs)[source]

Bases: msrest.serialization.Model

Result of image analysis using a specific domain model including additional metadata.

Parameters:
  • result (object) – Model-specific response
  • request_id (str) – Id of the REST API request.
  • metadata (ImageMetadata) –
class azure.cognitiveservices.vision.computervision.models.CelebrityResults(*, celebrities=None, request_id: str = None, metadata=None, **kwargs)[source]

Bases: msrest.serialization.Model

List of celebrities recognized in the image.

Parameters:
class azure.cognitiveservices.vision.computervision.models.LandmarkResults(*, landmarks=None, request_id: str = None, metadata=None, **kwargs)[source]

Bases: msrest.serialization.Model

List of landmarks recognized in the image.

Parameters:
class azure.cognitiveservices.vision.computervision.models.ImageDescription(*, tags=None, captions=None, request_id: str = None, metadata=None, **kwargs)[source]

Bases: msrest.serialization.Model

A collection of content tags, along with a list of captions sorted by confidence level, and image metadata.

Parameters:
  • tags (list[str]) – A collection of image tags.
  • captions (list[ImageCaption]) – A list of captions, sorted by confidence level.
  • request_id (str) – Id of the REST API request.
  • metadata (ImageMetadata) –
class azure.cognitiveservices.vision.computervision.models.TagResult(*, tags=None, request_id: str = None, metadata=None, **kwargs)[source]

Bases: msrest.serialization.Model

The results of a image tag operation, including any tags and image metadata.

Parameters:
  • tags (list[ImageTag]) – A list of tags with confidence level.
  • request_id (str) – Id of the REST API request.
  • metadata (ImageMetadata) –
class azure.cognitiveservices.vision.computervision.models.ComputerVisionError(*, code, message: str, request_id: str = None, **kwargs)[source]

Bases: msrest.serialization.Model

ComputerVisionError.

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

Parameters:
  • code (str or ComputerVisionErrorCodes) – Required. The error code. Possible values include: ‘InvalidImageUrl’, ‘InvalidImageFormat’, ‘InvalidImageSize’, ‘NotSupportedVisualFeature’, ‘NotSupportedImage’, ‘InvalidDetails’, ‘NotSupportedLanguage’, ‘BadArgument’, ‘FailedToProcess’, ‘Timeout’, ‘InternalServerError’, ‘Unspecified’, ‘StorageException’
  • message (str) – Required. A message explaining the error reported by the service.
  • request_id (str) – A unique request identifier.
class azure.cognitiveservices.vision.computervision.models.ImageUrl(*, url: str, **kwargs)[source]

Bases: msrest.serialization.Model

ImageUrl.

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

Parameters:url (str) – Required. Publicly reachable URL of an image
class azure.cognitiveservices.vision.computervision.models.TextOperationStatusCodes[source]

Bases: str, enum.Enum

An enumeration.

failed = 'Failed'
not_started = 'Not Started'
running = 'Running'
succeeded = 'Succeeded'
class azure.cognitiveservices.vision.computervision.models.Gender[source]

Bases: str, enum.Enum

An enumeration.

female = 'Female'
male = 'Male'
class azure.cognitiveservices.vision.computervision.models.ComputerVisionErrorCodes[source]

Bases: str, enum.Enum

An enumeration.

bad_argument = 'BadArgument'
failed_to_process = 'FailedToProcess'
internal_server_error = 'InternalServerError'
invalid_details = 'InvalidDetails'
invalid_image_format = 'InvalidImageFormat'
invalid_image_size = 'InvalidImageSize'
invalid_image_url = 'InvalidImageUrl'
not_supported_image = 'NotSupportedImage'
not_supported_language = 'NotSupportedLanguage'
not_supported_visual_feature = 'NotSupportedVisualFeature'
storage_exception = 'StorageException'
timeout = 'Timeout'
unspecified = 'Unspecified'
class azure.cognitiveservices.vision.computervision.models.VisualFeatureTypes[source]

Bases: str, enum.Enum

An enumeration.

adult = 'Adult'
categories = 'Categories'
color = 'Color'
description = 'Description'
faces = 'Faces'
image_type = 'ImageType'
tags = 'Tags'
class azure.cognitiveservices.vision.computervision.models.OcrLanguages[source]

Bases: str, enum.Enum

An enumeration.

ar = 'ar'
cs = 'cs'
da = 'da'
de = 'de'
el = 'el'
en = 'en'
es = 'es'
fi = 'fi'
fr = 'fr'
hu = 'hu'
it = 'it'
ja = 'ja'
ko = 'ko'
nb = 'nb'
nl = 'nl'
pl = 'pl'
pt = 'pt'
ro = 'ro'
ru = 'ru'
sk = 'sk'
sr_cyrl = 'sr-Cyrl'
sr_latn = 'sr-Latn'
sv = 'sv'
tr = 'tr'
unk = 'unk'
zh_hans = 'zh-Hans'
zh_hant = 'zh-Hant'
class azure.cognitiveservices.vision.computervision.models.TextRecognitionMode[source]

Bases: str, enum.Enum

An enumeration.

handwritten = 'Handwritten'
printed = 'Printed'
class azure.cognitiveservices.vision.computervision.models.AzureRegions[source]

Bases: str, enum.Enum

An enumeration.

australiaeast = 'australiaeast'
brazilsouth = 'brazilsouth'
eastasia = 'eastasia'
eastus = 'eastus'
eastus2 = 'eastus2'
northeurope = 'northeurope'
southcentralus = 'southcentralus'
southeastasia = 'southeastasia'
westcentralus = 'westcentralus'
westeurope = 'westeurope'
westus = 'westus'
westus2 = 'westus2'
class azure.cognitiveservices.vision.computervision.models.Details[source]

Bases: str, enum.Enum

An enumeration.

celebrities = 'Celebrities'
landmarks = 'Landmarks'