diff --git a/profiles/latest/cognitiveservices/computervision/models.go b/profiles/latest/cognitiveservices/computervision/models.go index 940e893bb603..8da72998cb81 100644 --- a/profiles/latest/cognitiveservices/computervision/models.go +++ b/profiles/latest/cognitiveservices/computervision/models.go @@ -87,6 +87,7 @@ type VisualFeatureTypes = original.VisualFeatureTypes const ( VisualFeatureTypesAdult VisualFeatureTypes = original.VisualFeatureTypesAdult + VisualFeatureTypesBrands VisualFeatureTypes = original.VisualFeatureTypesBrands VisualFeatureTypesCategories VisualFeatureTypes = original.VisualFeatureTypesCategories VisualFeatureTypesColor VisualFeatureTypes = original.VisualFeatureTypesColor VisualFeatureTypesDescription VisualFeatureTypes = original.VisualFeatureTypesDescription @@ -106,6 +107,7 @@ type CelebritiesModel = original.CelebritiesModel type CelebrityResults = original.CelebrityResults type ColorInfo = original.ColorInfo type DetectResult = original.DetectResult +type DetectedBrand = original.DetectedBrand type DetectedObject = original.DetectedObject type DomainModelResults = original.DomainModelResults type Error = original.Error diff --git a/profiles/preview/cognitiveservices/computervision/models.go b/profiles/preview/cognitiveservices/computervision/models.go index 379a77ac73d7..3855da05dff0 100644 --- a/profiles/preview/cognitiveservices/computervision/models.go +++ b/profiles/preview/cognitiveservices/computervision/models.go @@ -87,6 +87,7 @@ type VisualFeatureTypes = original.VisualFeatureTypes const ( VisualFeatureTypesAdult VisualFeatureTypes = original.VisualFeatureTypesAdult + VisualFeatureTypesBrands VisualFeatureTypes = original.VisualFeatureTypesBrands VisualFeatureTypesCategories VisualFeatureTypes = original.VisualFeatureTypesCategories VisualFeatureTypesColor VisualFeatureTypes = original.VisualFeatureTypesColor VisualFeatureTypesDescription VisualFeatureTypes = original.VisualFeatureTypesDescription @@ -106,6 +107,7 @@ type CelebritiesModel = original.CelebritiesModel type CelebrityResults = original.CelebrityResults type ColorInfo = original.ColorInfo type DetectResult = original.DetectResult +type DetectedBrand = original.DetectedBrand type DetectedObject = original.DetectedObject type DomainModelResults = original.DomainModelResults type Error = original.Error diff --git a/services/cognitiveservices/v2.0/computervision/client.go b/services/cognitiveservices/v2.0/computervision/client.go index 17a4d5ca6114..e9e0114359f7 100644 --- a/services/cognitiveservices/v2.0/computervision/client.go +++ b/services/cognitiveservices/v2.0/computervision/client.go @@ -69,7 +69,8 @@ func NewWithoutDefaults(endpoint string) BaseClient { // 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. +// 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. // 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. @@ -367,7 +368,8 @@ func (client BaseClient) AnalyzeImageByDomainInStreamResponder(resp *http.Respon // 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. +// 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. // 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. diff --git a/services/cognitiveservices/v2.0/computervision/models.go b/services/cognitiveservices/v2.0/computervision/models.go index 5a7de6e0311a..3657a2fd74de 100644 --- a/services/cognitiveservices/v2.0/computervision/models.go +++ b/services/cognitiveservices/v2.0/computervision/models.go @@ -161,6 +161,8 @@ type VisualFeatureTypes string const ( // VisualFeatureTypesAdult ... VisualFeatureTypesAdult VisualFeatureTypes = "Adult" + // VisualFeatureTypesBrands ... + VisualFeatureTypesBrands VisualFeatureTypes = "Brands" // VisualFeatureTypesCategories ... VisualFeatureTypesCategories VisualFeatureTypes = "Categories" // VisualFeatureTypesColor ... @@ -179,7 +181,7 @@ const ( // PossibleVisualFeatureTypesValues returns an array of possible values for the VisualFeatureTypes const type. func PossibleVisualFeatureTypesValues() []VisualFeatureTypes { - return []VisualFeatureTypes{VisualFeatureTypesAdult, VisualFeatureTypesCategories, VisualFeatureTypesColor, VisualFeatureTypesDescription, VisualFeatureTypesFaces, VisualFeatureTypesImageType, VisualFeatureTypesObjects, VisualFeatureTypesTags} + return []VisualFeatureTypes{VisualFeatureTypesAdult, VisualFeatureTypesBrands, VisualFeatureTypesCategories, VisualFeatureTypesColor, VisualFeatureTypesDescription, VisualFeatureTypesFaces, VisualFeatureTypesImageType, VisualFeatureTypesObjects, VisualFeatureTypesTags} } // AdultInfo an object describing whether the image contains adult-oriented content and/or is racy. @@ -267,6 +269,16 @@ type ColorInfo struct { IsBWImg *bool `json:"isBWImg,omitempty"` } +// DetectedBrand a brand detected in an image. +type DetectedBrand struct { + // Name - Label for the brand. + Name *string `json:"name,omitempty"` + // Confidence - Confidence score of having observed the brand in the image, as a value ranging from 0 to 1. + Confidence *float64 `json:"confidence,omitempty"` + // Rectangle - Approximate location of the detected brand. + Rectangle *BoundingRect `json:"rectangle,omitempty"` +} + // DetectedObject an object detected in an image. type DetectedObject struct { // Rectangle - Approximate location of the detected object. @@ -351,6 +363,8 @@ type ImageAnalysis struct { Faces *[]FaceDescription `json:"faces,omitempty"` // Objects - Array of objects describing what was detected in the image. Objects *[]DetectedObject `json:"objects,omitempty"` + // Brands - Array of brands detected in the image. + Brands *[]DetectedBrand `json:"brands,omitempty"` // RequestID - Id of the REST API request. RequestID *string `json:"requestId,omitempty"` Metadata *ImageMetadata `json:"metadata,omitempty"`