diff --git a/packages/@azure/cognitiveservices-computervision/lib/models/index.ts b/packages/@azure/cognitiveservices-computervision/lib/models/index.ts index b32170c84c3f..b899684c3294 100644 --- a/packages/@azure/cognitiveservices-computervision/lib/models/index.ts +++ b/packages/@azure/cognitiveservices-computervision/lib/models/index.ts @@ -1,854 +1,1173 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Licensed under the MIT License. See License.txt in the project root for + * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. */ - import * as msRest from "@azure/ms-rest-js"; + /** + * @interface + * An interface representing FaceRectangle. * An object describing face rectangle. + * */ export interface FaceRectangle { /** - * X-coordinate of the top left point of the face, in pixels. + * @member {number} [left] X-coordinate of the top left point of the face, in + * pixels. */ left?: number; /** - * Y-coordinate of the top left point of the face, in pixels. + * @member {number} [top] Y-coordinate of the top left point of the face, in + * pixels. */ top?: number; /** - * Width measured from the top-left point of the face, in pixels. + * @member {number} [width] Width measured from the top-left point of the + * face, in pixels. */ width?: number; /** - * Height measured from the top-left point of the face, in pixels. + * @member {number} [height] Height measured from the top-left point of the + * face, in pixels. */ height?: number; } /** + * @interface + * An interface representing CelebritiesModel. * An object describing possible celebrity identification. + * */ export interface CelebritiesModel { /** - * Name of the celebrity. + * @member {string} [name] Name of the celebrity. */ name?: string; /** - * Confidence level for the celebrity recognition as a value ranging from 0 to 1. + * @member {number} [confidence] Confidence level for the celebrity + * recognition as a value ranging from 0 to 1. */ confidence?: number; /** - * Location of the identified face in the image. + * @member {FaceRectangle} [faceRectangle] Location of the identified face in + * the image. */ faceRectangle?: FaceRectangle; } /** + * @interface + * An interface representing LandmarksModel. * A landmark recognized in the image. + * */ export interface LandmarksModel { /** - * Name of the landmark. + * @member {string} [name] Name of the landmark. */ name?: string; /** - * Confidence level for the landmark recognition as a value ranging from 0 to 1. + * @member {number} [confidence] Confidence level for the landmark + * recognition as a value ranging from 0 to 1. */ confidence?: number; } /** + * @interface + * An interface representing CategoryDetail. * An object describing additional category details. + * */ export interface CategoryDetail { /** - * An array of celebrities if any identified. + * @member {CelebritiesModel[]} [celebrities] An array of celebrities if any + * identified. */ celebrities?: CelebritiesModel[]; /** - * An array of landmarks if any identified. + * @member {LandmarksModel[]} [landmarks] An array of landmarks if any + * identified. */ landmarks?: LandmarksModel[]; } /** + * @interface + * An interface representing Category. * An object describing identified category. + * */ export interface Category { /** - * Name of the category. + * @member {string} [name] Name of the category. */ name?: string; /** - * Scoring of the category. + * @member {number} [score] Scoring of the category. */ score?: number; /** - * Details of the identified category. + * @member {CategoryDetail} [detail] Details of the identified category. */ detail?: CategoryDetail; } /** - * An object describing whether the image contains adult-oriented content and/or is racy. + * @interface + * An interface representing AdultInfo. + * An object describing whether the image contains adult-oriented content + * and/or is racy. + * */ export interface AdultInfo { /** - * A value indicating if the image contains adult-oriented content. + * @member {boolean} [isAdultContent] A value indicating if the image + * contains adult-oriented content. */ isAdultContent?: boolean; /** - * A value indicating if the image is racy. + * @member {boolean} [isRacyContent] A value indicating if the image is racy. */ isRacyContent?: boolean; /** - * Score from 0 to 1 that indicates how much the content is considered adult-oriented within the - * image. + * @member {number} [adultScore] Score from 0 to 1 that indicates how much + * the content is considered adult-oriented within the image. */ adultScore?: number; /** - * Score from 0 to 1 that indicates how suggestive is the image. + * @member {number} [racyScore] Score from 0 to 1 that indicates how + * suggestive is the image. */ racyScore?: number; } /** + * @interface + * An interface representing ColorInfo. * An object providing additional metadata describing color attributes. + * */ export interface ColorInfo { /** - * Possible dominant foreground color. + * @member {string} [dominantColorForeground] Possible dominant foreground + * color. */ dominantColorForeground?: string; /** - * Possible dominant background color. + * @member {string} [dominantColorBackground] Possible dominant background + * color. */ dominantColorBackground?: string; /** - * An array of possible dominant colors. + * @member {string[]} [dominantColors] An array of possible dominant colors. */ dominantColors?: string[]; /** - * Possible accent color. + * @member {string} [accentColor] Possible accent color. */ accentColor?: string; /** - * A value indicating if the image is black and white. + * @member {boolean} [isBWImg] A value indicating if the image is black and + * white. */ isBWImg?: boolean; } /** + * @interface + * An interface representing ImageType. * An object providing possible image types and matching confidence levels. + * */ export interface ImageType { /** - * Confidence level that the image is a clip art. + * @member {number} [clipArtType] Confidence level that the image is a clip + * art. */ clipArtType?: number; /** - * Confidence level that the image is a line drawing. + * @member {number} [lineDrawingType] Confidence level that the image is a + * line drawing. */ lineDrawingType?: number; } /** + * @interface + * An interface representing ImageTag. * An entity observation in the image, along with the confidence score. + * */ export interface ImageTag { /** - * Name of the entity. + * @member {string} [name] Name of the entity. */ name?: string; /** - * The level of confidence that the entity was observed. + * @member {number} [confidence] The level of confidence that the entity was + * observed. */ confidence?: number; /** - * Optional hint/details for this tag. + * @member {string} [hint] Optional hint/details for this tag. */ hint?: string; } /** + * @interface + * An interface representing ImageCaption. * An image caption, i.e. a brief description of what the image depicts. + * */ export interface ImageCaption { /** - * The text of the caption. + * @member {string} [text] The text of the caption. */ text?: string; /** - * The level of confidence the service has in the caption. + * @member {number} [confidence] The level of confidence the service has in + * the caption. */ confidence?: number; } /** - * A collection of content tags, along with a list of captions sorted by confidence level, and - * image metadata. + * @interface + * An interface representing ImageDescriptionDetails. + * A collection of content tags, along with a list of captions sorted by + * confidence level, and image metadata. + * */ export interface ImageDescriptionDetails { /** - * A collection of image tags. + * @member {string[]} [tags] A collection of image tags. */ tags?: string[]; /** - * A list of captions, sorted by confidence level. + * @member {ImageCaption[]} [captions] A list of captions, sorted by + * confidence level. */ captions?: ImageCaption[]; } /** + * @interface + * An interface representing FaceDescription. * An object describing a face identified in the image. + * */ export interface FaceDescription { /** - * Possible age of the face. + * @member {number} [age] Possible age of the face. */ age?: number; /** - * Possible gender of the face. Possible values include: 'Male', 'Female' + * @member {Gender} [gender] Possible gender of the face. Possible values + * include: 'Male', 'Female' */ gender?: Gender; /** - * Rectangle in the image containing the identified face. + * @member {FaceRectangle} [faceRectangle] Rectangle in the image containing + * the identified face. */ faceRectangle?: FaceRectangle; } /** + * @interface + * An interface representing BoundingRect. * A bounding box for an area inside an image. + * */ export interface BoundingRect { /** - * X-coordinate of the top left point of the area, in pixels. + * @member {number} [x] X-coordinate of the top left point of the area, in + * pixels. */ x?: number; /** - * Y-coordinate of the top left point of the area, in pixels. + * @member {number} [y] Y-coordinate of the top left point of the area, in + * pixels. */ y?: number; /** - * Width measured from the top-left point of the area, in pixels. + * @member {number} [w] Width measured from the top-left point of the area, + * in pixels. */ w?: number; /** - * Height measured from the top-left point of the area, in pixels. + * @member {number} [h] Height measured from the top-left point of the area, + * in pixels. */ h?: number; } /** + * @interface + * An interface representing ObjectHierarchy. * An object detected inside an image. + * */ export interface ObjectHierarchy { /** - * Label for the object. + * @member {string} [object] Label for the object. */ object?: string; /** - * Confidence score of having observed the object in the image, as a value ranging from 0 to 1. + * @member {number} [confidence] Confidence score of having observed the + * object in the image, as a value ranging from 0 to 1. */ confidence?: number; /** - * The parent object, from a taxonomy perspective. - * The parent object is a more generic form of this object. For example, a 'bulldog' would have - * a parent of 'dog'. + * @member {ObjectHierarchy} [parent] The parent object, from a taxonomy + * perspective. + * The parent object is a more generic form of this object. For example, a + * 'bulldog' would have a parent of 'dog'. */ parent?: ObjectHierarchy; } /** + * @interface + * An interface representing DetectedObject. * An object detected in an image. + * */ export interface DetectedObject { /** - * Approximate location of the detected object. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * @member {BoundingRect} [rectangle] Approximate location of the detected + * object. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly rectangle?: BoundingRect; /** - * Label for the object. + * @member {string} [object] Label for the object. */ object?: string; /** - * Confidence score of having observed the object in the image, as a value ranging from 0 to 1. + * @member {number} [confidence] Confidence score of having observed the + * object in the image, as a value ranging from 0 to 1. */ confidence?: number; /** - * The parent object, from a taxonomy perspective. - * The parent object is a more generic form of this object. For example, a 'bulldog' would have - * a parent of 'dog'. + * @member {ObjectHierarchy} [parent] The parent object, from a taxonomy + * perspective. + * The parent object is a more generic form of this object. For example, a + * 'bulldog' would have a parent of 'dog'. */ parent?: ObjectHierarchy; } /** + * @interface + * An interface representing DetectedBrand. + * A brand detected in an image. + * + */ +export interface DetectedBrand { + /** + * @member {string} [name] Label for the brand. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {number} [confidence] Confidence score of having observed the + * brand in the image, as a value ranging from 0 to 1. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly confidence?: number; + /** + * @member {BoundingRect} [rectangle] Approximate location of the detected + * brand. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly rectangle?: BoundingRect; +} + +/** + * @interface + * An interface representing ImageMetadata. * Image metadata. + * */ export interface ImageMetadata { /** - * Image width, in pixels. + * @member {number} [width] Image width, in pixels. */ width?: number; /** - * Image height, in pixels. + * @member {number} [height] Image height, in pixels. */ height?: number; /** - * Image format. + * @member {string} [format] Image format. */ format?: string; } /** + * @interface + * An interface representing ImageAnalysis. * Result of AnalyzeImage operation. + * */ export interface ImageAnalysis { /** - * An array indicating identified categories. + * @member {Category[]} [categories] An array indicating identified + * categories. */ categories?: Category[]; /** - * An object describing whether the image contains adult-oriented content and/or is racy. + * @member {AdultInfo} [adult] An object describing whether the image + * contains adult-oriented content and/or is racy. */ adult?: AdultInfo; /** - * An object providing additional metadata describing color attributes. + * @member {ColorInfo} [color] An object providing additional metadata + * describing color attributes. */ color?: ColorInfo; /** - * An object providing possible image types and matching confidence levels. + * @member {ImageType} [imageType] An object providing possible image types + * and matching confidence levels. */ imageType?: ImageType; /** - * A list of tags with confidence level. + * @member {ImageTag[]} [tags] A list of tags with confidence level. */ tags?: ImageTag[]; /** - * A collection of content tags, along with a list of captions sorted by confidence level, and - * image metadata. + * @member {ImageDescriptionDetails} [description] A collection of content + * tags, along with a list of captions sorted by confidence level, and image + * metadata. */ description?: ImageDescriptionDetails; /** - * An array of possible faces within the image. + * @member {FaceDescription[]} [faces] An array of possible faces within the + * image. */ faces?: FaceDescription[]; /** - * Array of objects describing what was detected in the image. + * @member {DetectedObject[]} [objects] Array of objects describing what was + * detected in the image. */ objects?: DetectedObject[]; /** - * Id of the REST API request. + * @member {DetectedBrand[]} [brands] Array of brands detected in the image. + */ + brands?: DetectedBrand[]; + /** + * @member {string} [requestId] Id of the REST API request. */ requestId?: string; + /** + * @member {ImageMetadata} [metadata] + */ metadata?: ImageMetadata; } /** - * A collection of content tags, along with a list of captions sorted by confidence level, and - * image metadata. + * @interface + * An interface representing ImageDescription. + * A collection of content tags, along with a list of captions sorted by + * confidence level, and image metadata. + * */ export interface ImageDescription { /** - * A collection of image tags. + * @member {string[]} [tags] A collection of image tags. */ tags?: string[]; /** - * A list of captions, sorted by confidence level. + * @member {ImageCaption[]} [captions] A list of captions, sorted by + * confidence level. */ captions?: ImageCaption[]; /** - * Id of the REST API request. + * @member {string} [requestId] Id of the REST API request. */ requestId?: string; + /** + * @member {ImageMetadata} [metadata] + */ metadata?: ImageMetadata; } /** + * @interface + * An interface representing DetectResult. * Result of a DetectImage call. + * */ export interface DetectResult { /** - * An array of detected objects. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * @member {DetectedObject[]} [objects] An array of detected objects. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly objects?: DetectedObject[]; /** - * Id of the REST API request. + * @member {string} [requestId] Id of the REST API request. */ requestId?: string; + /** + * @member {ImageMetadata} [metadata] + */ metadata?: ImageMetadata; } /** + * @interface + * An interface representing ModelDescription. * An object describing supported model by name and categories. + * */ export interface ModelDescription { /** - * The name of the model. + * @member {string} [name] The name of the model. */ name?: string; /** - * Categories of the model. + * @member {string[]} [categories] Categories of the model. */ categories?: string[]; } /** + * @interface + * An interface representing ListModelsResult. * Result of the List Domain Models operation. + * */ export interface ListModelsResult { /** - * An array of supported models. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * @member {ModelDescription[]} [modelsProperty] An array of supported + * models. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly modelsProperty?: ModelDescription[]; } /** - * Result of image analysis using a specific domain model including additional metadata. + * @interface + * An interface representing DomainModelResults. + * Result of image analysis using a specific domain model including additional + * metadata. + * */ export interface DomainModelResults { /** - * Model-specific response. + * @member {any} [result] Model-specific response. */ result?: any; /** - * Id of the REST API request. + * @member {string} [requestId] Id of the REST API request. */ requestId?: string; + /** + * @member {ImageMetadata} [metadata] + */ metadata?: ImageMetadata; } /** + * @interface + * An interface representing OcrWord. * Information on a recognized word. + * */ export interface OcrWord { /** - * 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. + * @member {string} [boundingBox] 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. */ boundingBox?: string; /** - * String value of a recognized word. + * @member {string} [text] String value of a recognized word. */ text?: string; } /** + * @interface + * An interface representing OcrLine. * An object describing a single recognized line of text. + * */ export interface OcrLine { /** - * 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. + * @member {string} [boundingBox] 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. */ boundingBox?: string; /** - * An array of objects, where each object represents a recognized word. + * @member {OcrWord[]} [words] An array of objects, where each object + * represents a recognized word. */ words?: OcrWord[]; } /** - * A region consists of multiple lines (e.g. a column of text in a multi-column document). + * @interface + * An interface representing OcrRegion. + * A region consists of multiple lines (e.g. a column of text in a multi-column + * document). + * */ export interface OcrRegion { /** - * 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. + * @member {string} [boundingBox] 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. */ boundingBox?: string; /** - * An array of recognized lines of text. + * @member {OcrLine[]} [lines] An array of recognized lines of text. */ lines?: OcrLine[]; } /** + * @interface * An interface representing OcrResult. */ export interface OcrResult { /** - * The BCP-47 language code of the text in the image. + * @member {string} [language] The BCP-47 language code of the text in the + * image. */ language?: string; /** - * 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. + * @member {number} [textAngle] 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. */ textAngle?: number; /** - * 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). + * @member {string} [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). */ orientation?: string; /** - * An array of objects, where each object represents a region of recognized text. + * @member {OcrRegion[]} [regions] An array of objects, where each object + * represents a region of recognized text. */ regions?: OcrRegion[]; } /** + * @interface + * An interface representing TagResult. * The results of a image tag operation, including any tags and image metadata. + * */ export interface TagResult { /** - * A list of tags with confidence level. + * @member {ImageTag[]} [tags] A list of tags with confidence level. */ tags?: ImageTag[]; /** - * Id of the REST API request. + * @member {string} [requestId] Id of the REST API request. */ requestId?: string; + /** + * @member {ImageMetadata} [metadata] + */ metadata?: ImageMetadata; } /** + * @interface + * An interface representing AreaOfInterestResult. * Result of AreaOfInterest operation. + * */ export interface AreaOfInterestResult { /** - * A bounding box for an area of interest inside an image. - * **NOTE: This property will not be serialized. It can only be populated by the server.** + * @member {BoundingRect} [areaOfInterest] A bounding box for an area of + * interest inside an image. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly areaOfInterest?: BoundingRect; /** - * Id of the REST API request. + * @member {string} [requestId] Id of the REST API request. */ requestId?: string; + /** + * @member {ImageMetadata} [metadata] + */ metadata?: ImageMetadata; } /** + * @interface * An interface representing ImageUrl. */ export interface ImageUrl { /** - * Publicly reachable URL of an image. + * @member {string} url Publicly reachable URL of an image. */ url: string; } /** + * @interface + * An interface representing ComputerVisionError. * Details about the API request error. + * */ export interface ComputerVisionError { /** - * The error code. + * @member {any} code The error code. */ code: any; /** - * A message explaining the error reported by the service. + * @member {string} message A message explaining the error reported by the + * service. */ message: string; /** - * A unique request identifier. + * @member {string} [requestId] A unique request identifier. */ requestId?: string; } /** + * @interface + * An interface representing LandmarkResults. * Result of domain-specific classifications for the domain of landmarks. + * */ export interface LandmarkResults { /** - * List of landmarks recognized in the image. + * @member {LandmarksModel[]} [landmarks] List of landmarks recognized in the + * image. */ landmarks?: LandmarksModel[]; /** - * Id of the REST API request. + * @member {string} [requestId] Id of the REST API request. */ requestId?: string; + /** + * @member {ImageMetadata} [metadata] + */ metadata?: ImageMetadata; } /** + * @interface + * An interface representing CelebrityResults. * Result of domain-specific classifications for the domain of celebrities. + * */ export interface CelebrityResults { /** - * List of celebrities recognized in the image. + * @member {CelebritiesModel[]} [celebrities] List of celebrities recognized + * in the image. */ celebrities?: CelebritiesModel[]; /** - * Id of the REST API request. + * @member {string} [requestId] Id of the REST API request. */ requestId?: string; + /** + * @member {ImageMetadata} [metadata] + */ metadata?: ImageMetadata; } /** + * @interface * An interface representing Word. */ export interface Word { + /** + * @member {number[]} [boundingBox] + */ boundingBox?: number[]; + /** + * @member {string} [text] + */ text?: string; } /** + * @interface * An interface representing Line. */ export interface Line { + /** + * @member {number[]} [boundingBox] + */ boundingBox?: number[]; + /** + * @member {string} [text] + */ text?: string; + /** + * @member {Word[]} [words] + */ words?: Word[]; } /** + * @interface * An interface representing RecognitionResult. */ export interface RecognitionResult { + /** + * @member {Line[]} [lines] + */ lines?: Line[]; } /** + * @interface * An interface representing TextOperationResult. */ export interface TextOperationResult { /** - * Status of the text operation. Possible values include: 'Not Started', 'Running', 'Failed', - * 'Succeeded' + * @member {TextOperationStatusCodes} [status] Status of the text operation. + * Possible values include: 'Not Started', 'Running', 'Failed', 'Succeeded' */ status?: TextOperationStatusCodes; + /** + * @member {RecognitionResult} [recognitionResult] + */ recognitionResult?: RecognitionResult; } /** + * @interface + * An interface representing ComputerVisionClientAnalyzeImageOptionalParams. * Optional Parameters. + * + * @extends RequestOptionsBase */ export interface ComputerVisionClientAnalyzeImageOptionalParams extends msRest.RequestOptionsBase { /** - * A string indicating what visual feature types to return. Multiple values should be - * comma-separated. Valid visual feature types include: Categories - categorizes image content - * according to a taxonomy defined in documentation. Tags - tags the image with a detailed list - * of words related to the image content. Description - describes the image content with a - * complete English sentence. Faces - detects if faces are present. If present, generate - * coordinates, gender and age. ImageType - detects if image is clipart or a line drawing. Color - * - determines the accent color, dominant color, and whether an image is black&white. Adult - - * detects if the image is pornographic in nature (depicts nudity or a sex act). Sexually - * suggestive content is also detected. Objects - detects various objects within an image, - * including the approximate location. The Objects argument is only available in English. + * @member {VisualFeatureTypes[]} [visualFeatures] A string indicating what + * visual feature types to return. Multiple values should be comma-separated. + * Valid visual feature types include: Categories - categorizes image content + * according to a taxonomy defined in documentation. Tags - tags the image + * with a detailed list of words related to the image content. Description - + * describes the image content with a complete English sentence. Faces - + * detects if faces are present. If present, generate coordinates, gender and + * age. ImageType - detects if image is clipart or a line drawing. Color - + * determines the accent color, dominant color, and whether an image is + * black&white. Adult - detects if the image is pornographic in nature + * (depicts nudity or a sex act). Sexually suggestive content is also + * detected. Objects - detects various objects within an image, including the + * approximate location. The Objects argument is only available in English. + * Brands - detects various brands within an image, including the approximate + * location. The Brands argument is only available in English. */ visualFeatures?: VisualFeatureTypes[]; /** - * A string indicating which domain-specific details to return. Multiple values should be - * comma-separated. Valid visual feature types include: Celebrities - identifies celebrities if - * detected in the image, Landmarks - identifies notable landmarks in the image. + * @member {Details[]} [details] A string indicating which domain-specific + * details to return. Multiple values should be comma-separated. Valid visual + * feature types include: Celebrities - identifies celebrities if detected in + * the image, Landmarks - identifies notable landmarks in the image. */ details?: Details[]; /** - * The desired language for output generation. If this parameter is not specified, the default - * value is "en".Supported languages:en - English, Default. es - Spanish, ja - - * Japanese, pt - Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', 'ja', - * 'pt', 'zh'. Default value: 'en'. + * @member {Language} [language] The desired language for output generation. + * If this parameter is not specified, the default value is + * "en".Supported languages:en - English, Default. es - Spanish, ja + * - Japanese, pt - Portuguese, zh - Simplified Chinese. Possible values + * include: 'en', 'es', 'ja', 'pt', 'zh'. Default value: 'en' . */ language?: Language; } /** + * @interface + * An interface representing ComputerVisionClientDescribeImageOptionalParams. * Optional Parameters. + * + * @extends RequestOptionsBase */ export interface ComputerVisionClientDescribeImageOptionalParams extends msRest.RequestOptionsBase { /** - * Maximum number of candidate descriptions to be returned. The default is 1. Default value: 1. + * @member {number} [maxCandidates] Maximum number of candidate descriptions + * to be returned. The default is 1. Default value: 1 . */ maxCandidates?: number; /** - * The desired language for output generation. If this parameter is not specified, the default - * value is "en".Supported languages:en - English, Default. es - Spanish, ja - - * Japanese, pt - Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', 'ja', - * 'pt', 'zh'. Default value: 'en'. + * @member {Language1} [language] The desired language for output generation. + * If this parameter is not specified, the default value is + * "en".Supported languages:en - English, Default. es - Spanish, ja + * - Japanese, pt - Portuguese, zh - Simplified Chinese. Possible values + * include: 'en', 'es', 'ja', 'pt', 'zh'. Default value: 'en' . */ language?: Language1; } /** + * @interface + * An interface representing ComputerVisionClientAnalyzeImageByDomainOptionalParams. * Optional Parameters. + * + * @extends RequestOptionsBase */ export interface ComputerVisionClientAnalyzeImageByDomainOptionalParams extends msRest.RequestOptionsBase { /** - * The desired language for output generation. If this parameter is not specified, the default - * value is "en".Supported languages:en - English, Default. es - Spanish, ja - - * Japanese, pt - Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', 'ja', - * 'pt', 'zh'. Default value: 'en'. + * @member {Language2} [language] The desired language for output generation. + * If this parameter is not specified, the default value is + * "en".Supported languages:en - English, Default. es - Spanish, ja + * - Japanese, pt - Portuguese, zh - Simplified Chinese. Possible values + * include: 'en', 'es', 'ja', 'pt', 'zh'. Default value: 'en' . */ language?: Language2; } /** + * @interface + * An interface representing ComputerVisionClientRecognizePrintedTextOptionalParams. * Optional Parameters. + * + * @extends RequestOptionsBase */ export interface ComputerVisionClientRecognizePrintedTextOptionalParams extends msRest.RequestOptionsBase { /** - * The BCP-47 language code of the text to be detected in the image. The default value is 'unk'. - * Possible values include: 'unk', 'zh-Hans', 'zh-Hant', 'cs', 'da', 'nl', 'en', 'fi', 'fr', - * 'de', 'el', 'hu', 'it', 'ja', 'ko', 'nb', 'pl', 'pt', 'ru', 'es', 'sv', 'tr', 'ar', 'ro', - * 'sr-Cyrl', 'sr-Latn', 'sk'. Default value: 'unk'. + * @member {OcrLanguages} [language] The BCP-47 language code of the text to + * be detected in the image. The default value is 'unk'. Possible values + * include: 'unk', 'zh-Hans', 'zh-Hant', 'cs', 'da', 'nl', 'en', 'fi', 'fr', + * 'de', 'el', 'hu', 'it', 'ja', 'ko', 'nb', 'pl', 'pt', 'ru', 'es', 'sv', + * 'tr', 'ar', 'ro', 'sr-Cyrl', 'sr-Latn', 'sk'. Default value: 'unk' . */ language?: OcrLanguages; } /** + * @interface + * An interface representing ComputerVisionClientTagImageOptionalParams. * Optional Parameters. + * + * @extends RequestOptionsBase */ export interface ComputerVisionClientTagImageOptionalParams extends msRest.RequestOptionsBase { /** - * The desired language for output generation. If this parameter is not specified, the default - * value is "en".Supported languages:en - English, Default. es - Spanish, ja - - * Japanese, pt - Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', 'ja', - * 'pt', 'zh'. Default value: 'en'. + * @member {Language3} [language] The desired language for output generation. + * If this parameter is not specified, the default value is + * "en".Supported languages:en - English, Default. es - Spanish, ja + * - Japanese, pt - Portuguese, zh - Simplified Chinese. Possible values + * include: 'en', 'es', 'ja', 'pt', 'zh'. Default value: 'en' . */ language?: Language3; } /** + * @interface + * An interface representing ComputerVisionClientGenerateThumbnailOptionalParams. * Optional Parameters. + * + * @extends RequestOptionsBase */ export interface ComputerVisionClientGenerateThumbnailOptionalParams extends msRest.RequestOptionsBase { /** - * Boolean flag for enabling smart cropping. Default value: false. + * @member {boolean} [smartCropping] Boolean flag for enabling smart + * cropping. Default value: false . */ smartCropping?: boolean; } /** + * @interface + * An interface representing ComputerVisionClientAnalyzeImageInStreamOptionalParams. * Optional Parameters. + * + * @extends RequestOptionsBase */ export interface ComputerVisionClientAnalyzeImageInStreamOptionalParams extends msRest.RequestOptionsBase { /** - * A string indicating what visual feature types to return. Multiple values should be - * comma-separated. Valid visual feature types include: Categories - categorizes image content - * according to a taxonomy defined in documentation. Tags - tags the image with a detailed list - * of words related to the image content. Description - describes the image content with a - * complete English sentence. Faces - detects if faces are present. If present, generate - * coordinates, gender and age. ImageType - detects if image is clipart or a line drawing. Color - * - determines the accent color, dominant color, and whether an image is black&white. Adult - - * detects if the image is pornographic in nature (depicts nudity or a sex act). Sexually - * suggestive content is also detected. Objects - detects various objects within an image, - * including the approximate location. The Objects argument is only available in English. + * @member {VisualFeatureTypes[]} [visualFeatures] A string indicating what + * visual feature types to return. Multiple values should be comma-separated. + * Valid visual feature types include: Categories - categorizes image content + * according to a taxonomy defined in documentation. Tags - tags the image + * with a detailed list of words related to the image content. Description - + * describes the image content with a complete English sentence. Faces - + * detects if faces are present. If present, generate coordinates, gender and + * age. ImageType - detects if image is clipart or a line drawing. Color - + * determines the accent color, dominant color, and whether an image is + * black&white. Adult - detects if the image is pornographic in nature + * (depicts nudity or a sex act). Sexually suggestive content is also + * detected. Objects - detects various objects within an image, including the + * approximate location. The Objects argument is only available in English. + * Brands - detects various brands within an image, including the approximate + * location. The Brands argument is only available in English. */ visualFeatures?: VisualFeatureTypes[]; /** - * A string indicating which domain-specific details to return. Multiple values should be - * comma-separated. Valid visual feature types include: Celebrities - identifies celebrities if - * detected in the image, Landmarks - identifies notable landmarks in the image. + * @member {Details[]} [details] A string indicating which domain-specific + * details to return. Multiple values should be comma-separated. Valid visual + * feature types include: Celebrities - identifies celebrities if detected in + * the image, Landmarks - identifies notable landmarks in the image. */ details?: Details[]; /** - * The desired language for output generation. If this parameter is not specified, the default - * value is "en".Supported languages:en - English, Default. es - Spanish, ja - - * Japanese, pt - Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', 'ja', - * 'pt', 'zh'. Default value: 'en'. + * @member {Language4} [language] The desired language for output generation. + * If this parameter is not specified, the default value is + * "en".Supported languages:en - English, Default. es - Spanish, ja + * - Japanese, pt - Portuguese, zh - Simplified Chinese. Possible values + * include: 'en', 'es', 'ja', 'pt', 'zh'. Default value: 'en' . */ language?: Language4; } /** + * @interface + * An interface representing ComputerVisionClientDescribeImageInStreamOptionalParams. * Optional Parameters. + * + * @extends RequestOptionsBase */ export interface ComputerVisionClientDescribeImageInStreamOptionalParams extends msRest.RequestOptionsBase { /** - * Maximum number of candidate descriptions to be returned. The default is 1. Default value: 1. + * @member {number} [maxCandidates] Maximum number of candidate descriptions + * to be returned. The default is 1. Default value: 1 . */ maxCandidates?: number; /** - * The desired language for output generation. If this parameter is not specified, the default - * value is "en".Supported languages:en - English, Default. es - Spanish, ja - - * Japanese, pt - Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', 'ja', - * 'pt', 'zh'. Default value: 'en'. + * @member {Language5} [language] The desired language for output generation. + * If this parameter is not specified, the default value is + * "en".Supported languages:en - English, Default. es - Spanish, ja + * - Japanese, pt - Portuguese, zh - Simplified Chinese. Possible values + * include: 'en', 'es', 'ja', 'pt', 'zh'. Default value: 'en' . */ language?: Language5; } /** + * @interface + * An interface representing ComputerVisionClientGenerateThumbnailInStreamOptionalParams. * Optional Parameters. + * + * @extends RequestOptionsBase */ export interface ComputerVisionClientGenerateThumbnailInStreamOptionalParams extends msRest.RequestOptionsBase { /** - * Boolean flag for enabling smart cropping. Default value: false. + * @member {boolean} [smartCropping] Boolean flag for enabling smart + * cropping. Default value: false . */ smartCropping?: boolean; } /** + * @interface + * An interface representing ComputerVisionClientAnalyzeImageByDomainInStreamOptionalParams. * Optional Parameters. + * + * @extends RequestOptionsBase */ export interface ComputerVisionClientAnalyzeImageByDomainInStreamOptionalParams extends msRest.RequestOptionsBase { /** - * The desired language for output generation. If this parameter is not specified, the default - * value is "en".Supported languages:en - English, Default. es - Spanish, ja - - * Japanese, pt - Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', 'ja', - * 'pt', 'zh'. Default value: 'en'. + * @member {Language6} [language] The desired language for output generation. + * If this parameter is not specified, the default value is + * "en".Supported languages:en - English, Default. es - Spanish, ja + * - Japanese, pt - Portuguese, zh - Simplified Chinese. Possible values + * include: 'en', 'es', 'ja', 'pt', 'zh'. Default value: 'en' . */ language?: Language6; } /** + * @interface + * An interface representing ComputerVisionClientRecognizePrintedTextInStreamOptionalParams. * Optional Parameters. + * + * @extends RequestOptionsBase */ export interface ComputerVisionClientRecognizePrintedTextInStreamOptionalParams extends msRest.RequestOptionsBase { /** - * The BCP-47 language code of the text to be detected in the image. The default value is 'unk'. - * Possible values include: 'unk', 'zh-Hans', 'zh-Hant', 'cs', 'da', 'nl', 'en', 'fi', 'fr', - * 'de', 'el', 'hu', 'it', 'ja', 'ko', 'nb', 'pl', 'pt', 'ru', 'es', 'sv', 'tr', 'ar', 'ro', - * 'sr-Cyrl', 'sr-Latn', 'sk'. Default value: 'unk'. + * @member {OcrLanguages} [language] The BCP-47 language code of the text to + * be detected in the image. The default value is 'unk'. Possible values + * include: 'unk', 'zh-Hans', 'zh-Hant', 'cs', 'da', 'nl', 'en', 'fi', 'fr', + * 'de', 'el', 'hu', 'it', 'ja', 'ko', 'nb', 'pl', 'pt', 'ru', 'es', 'sv', + * 'tr', 'ar', 'ro', 'sr-Cyrl', 'sr-Latn', 'sk'. Default value: 'unk' . */ language?: OcrLanguages; } /** + * @interface + * An interface representing ComputerVisionClientTagImageInStreamOptionalParams. * Optional Parameters. + * + * @extends RequestOptionsBase */ export interface ComputerVisionClientTagImageInStreamOptionalParams extends msRest.RequestOptionsBase { /** - * The desired language for output generation. If this parameter is not specified, the default - * value is "en".Supported languages:en - English, Default. es - Spanish, ja - - * Japanese, pt - Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es', 'ja', - * 'pt', 'zh'. Default value: 'en'. + * @member {Language7} [language] The desired language for output generation. + * If this parameter is not specified, the default value is + * "en".Supported languages:en - English, Default. es - Spanish, ja + * - Japanese, pt - Portuguese, zh - Simplified Chinese. Possible values + * include: 'en', 'es', 'ja', 'pt', 'zh'. Default value: 'en' . */ language?: Language7; } /** + * @interface + * An interface representing RecognizeTextHeaders. * Defines headers for RecognizeText operation. + * */ export interface RecognizeTextHeaders { /** - * URL to query for status of the operation. The operation ID will expire in 48 hours. + * @member {string} [operationLocation] URL to query for status of the + * operation. The operation ID will expire in 48 hours. */ operationLocation: string; } /** + * @interface + * An interface representing RecognizeTextInStreamHeaders. * Defines headers for RecognizeTextInStream operation. + * */ export interface RecognizeTextInStreamHeaders { /** - * URL to query for status of the operation. The operation ID will expire in 48 hours. + * @member {string} [operationLocation] URL to query for status of the + * operation. The operation ID will expire in 48 hours. */ operationLocation: string; } @@ -882,11 +1201,11 @@ export type OcrLanguages = 'unk' | 'zh-Hans' | 'zh-Hant' | 'cs' | 'da' | 'nl' | /** * Defines values for VisualFeatureTypes. * Possible values include: 'ImageType', 'Faces', 'Adult', 'Categories', 'Color', 'Tags', - * 'Description', 'Objects' + * 'Description', 'Objects', 'Brands' * @readonly * @enum {string} */ -export type VisualFeatureTypes = 'ImageType' | 'Faces' | 'Adult' | 'Categories' | 'Color' | 'Tags' | 'Description' | 'Objects'; +export type VisualFeatureTypes = 'ImageType' | 'Faces' | 'Adult' | 'Categories' | 'Color' | 'Tags' | 'Description' | 'Objects' | 'Brands'; /** * Defines values for TextRecognitionMode. @@ -980,7 +1299,6 @@ export type AnalyzeImageResponse = ImageAnalysis & { * The response body as text (string format) */ bodyAsText: string; - /** * The response body as parsed JSON or XML */ @@ -1000,7 +1318,6 @@ export type DescribeImageResponse = ImageDescription & { * The response body as text (string format) */ bodyAsText: string; - /** * The response body as parsed JSON or XML */ @@ -1020,7 +1337,6 @@ export type DetectObjectsResponse = DetectResult & { * The response body as text (string format) */ bodyAsText: string; - /** * The response body as parsed JSON or XML */ @@ -1040,7 +1356,6 @@ export type ListModelsResponse = ListModelsResult & { * The response body as text (string format) */ bodyAsText: string; - /** * The response body as parsed JSON or XML */ @@ -1060,7 +1375,6 @@ export type AnalyzeImageByDomainResponse = DomainModelResults & { * The response body as text (string format) */ bodyAsText: string; - /** * The response body as parsed JSON or XML */ @@ -1080,7 +1394,6 @@ export type RecognizePrintedTextResponse = OcrResult & { * The response body as text (string format) */ bodyAsText: string; - /** * The response body as parsed JSON or XML */ @@ -1100,7 +1413,6 @@ export type TagImageResponse = TagResult & { * The response body as text (string format) */ bodyAsText: string; - /** * The response body as parsed JSON or XML */ @@ -1119,7 +1431,6 @@ export type GenerateThumbnailResponse = { * Always undefined in node.js. */ blobBody?: Promise; - /** * NODEJS ONLY * @@ -1127,7 +1438,6 @@ export type GenerateThumbnailResponse = { * Always undefined in the browser. */ readableStreamBody?: NodeJS.ReadableStream; - /** * The underlying HTTP response. */ @@ -1146,7 +1456,6 @@ export type GetAreaOfInterestResponse = AreaOfInterestResult & { * The response body as text (string format) */ bodyAsText: string; - /** * The response body as parsed JSON or XML */ @@ -1181,7 +1490,6 @@ export type GetTextOperationResultResponse = TextOperationResult & { * The response body as text (string format) */ bodyAsText: string; - /** * The response body as parsed JSON or XML */ @@ -1201,7 +1509,6 @@ export type AnalyzeImageInStreamResponse = ImageAnalysis & { * The response body as text (string format) */ bodyAsText: string; - /** * The response body as parsed JSON or XML */ @@ -1221,7 +1528,6 @@ export type GetAreaOfInterestInStreamResponse = AreaOfInterestResult & { * The response body as text (string format) */ bodyAsText: string; - /** * The response body as parsed JSON or XML */ @@ -1241,7 +1547,6 @@ export type DescribeImageInStreamResponse = ImageDescription & { * The response body as text (string format) */ bodyAsText: string; - /** * The response body as parsed JSON or XML */ @@ -1261,7 +1566,6 @@ export type DetectObjectsInStreamResponse = DetectResult & { * The response body as text (string format) */ bodyAsText: string; - /** * The response body as parsed JSON or XML */ @@ -1280,7 +1584,6 @@ export type GenerateThumbnailInStreamResponse = { * Always undefined in node.js. */ blobBody?: Promise; - /** * NODEJS ONLY * @@ -1288,7 +1591,6 @@ export type GenerateThumbnailInStreamResponse = { * Always undefined in the browser. */ readableStreamBody?: NodeJS.ReadableStream; - /** * The underlying HTTP response. */ @@ -1307,7 +1609,6 @@ export type AnalyzeImageByDomainInStreamResponse = DomainModelResults & { * The response body as text (string format) */ bodyAsText: string; - /** * The response body as parsed JSON or XML */ @@ -1327,7 +1628,6 @@ export type RecognizePrintedTextInStreamResponse = OcrResult & { * The response body as text (string format) */ bodyAsText: string; - /** * The response body as parsed JSON or XML */ @@ -1347,7 +1647,6 @@ export type TagImageInStreamResponse = TagResult & { * The response body as text (string format) */ bodyAsText: string; - /** * The response body as parsed JSON or XML */ diff --git a/packages/@azure/cognitiveservices-computervision/lib/models/mappers.ts b/packages/@azure/cognitiveservices-computervision/lib/models/mappers.ts index 36343fe64ff3..d7bc3b178aeb 100644 --- a/packages/@azure/cognitiveservices-computervision/lib/models/mappers.ts +++ b/packages/@azure/cognitiveservices-computervision/lib/models/mappers.ts @@ -1,9 +1,11 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Licensed under the MIT License. See License.txt in the project root for + * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. */ import * as msRest from "@azure/ms-rest-js"; @@ -514,6 +516,40 @@ export const DetectedObject: msRest.CompositeMapper = { } }; +export const DetectedBrand: msRest.CompositeMapper = { + serializedName: "DetectedBrand", + type: { + name: "Composite", + className: "DetectedBrand", + modelProperties: { + name: { + nullable: true, + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + confidence: { + nullable: false, + readOnly: true, + serializedName: "confidence", + type: { + name: "Number" + } + }, + rectangle: { + readOnly: true, + serializedName: "rectangle", + type: { + name: "Composite", + className: "BoundingRect" + } + } + } + } +}; + export const ImageMetadata: msRest.CompositeMapper = { serializedName: "ImageMetadata", type: { @@ -631,6 +667,19 @@ export const ImageAnalysis: msRest.CompositeMapper = { } } }, + brands: { + nullable: true, + serializedName: "brands", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DetectedBrand" + } + } + } + }, requestId: { nullable: true, serializedName: "requestId", diff --git a/packages/@azure/cognitiveservices-computervision/lib/models/parameters.ts b/packages/@azure/cognitiveservices-computervision/lib/models/parameters.ts index 66d5b2ce4c8f..e00e1f94310f 100644 --- a/packages/@azure/cognitiveservices-computervision/lib/models/parameters.ts +++ b/packages/@azure/cognitiveservices-computervision/lib/models/parameters.ts @@ -211,7 +211,8 @@ export const visualFeatures: msRest.OperationQueryParameter = { "Color", "Tags", "Description", - "Objects" + "Objects", + "Brands" ] } } diff --git a/packages/@azure/cognitiveservices-computervision/package.json b/packages/@azure/cognitiveservices-computervision/package.json index d6bf72a0a310..f42e6b0bd521 100644 --- a/packages/@azure/cognitiveservices-computervision/package.json +++ b/packages/@azure/cognitiveservices-computervision/package.json @@ -4,7 +4,7 @@ "description": "ComputerVisionClient Library with typescript type definitions for node.js and browser.", "version": "3.2.0", "dependencies": { - "@azure/ms-rest-js": "^1.2.6", + "@azure/ms-rest-js": "^1.2.0", "tslib": "^1.9.3" }, "keywords": [ @@ -43,7 +43,6 @@ "esm/**/*.d.ts", "esm/**/*.d.ts.map", "lib/**/*.ts", - "README.md", "rollup.config.js", "tsconfig.json" ], @@ -52,6 +51,5 @@ "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/cognitiveservices-computervision.js.map'\" -o ./dist/cognitiveservices-computervision.min.js ./dist/cognitiveservices-computervision.js", "prepack": "npm install && npm run build" }, - "sideEffects": false, - "autoPublish": true + "sideEffects": false }