检测图像中的流行品牌Detect popular brands in images

品牌检测是对象检测的一种专用模式,使用包含全球数千个徽标的数据库来标识图像或视频中的商业品牌。Brand detection is a specialized mode of object detection that uses a database of thousands of global logos to identify commercial brands in images or video. 可以使用此功能来执行特定的操作,例如,发现哪些品牌在社交媒体上最受欢迎,或者哪些品牌在社交产品排名上最靠前。You can use this feature, for example, to discover which brands are most popular on social media or most prevalent in media product placement.

计算机视觉服务检测给定图像中是否存在品牌徽标;如果存在,则返回品牌名称、置信度分数以及徽标周围边框的坐标。The Computer Vision service detects whether there are brand logos in a given image; if so, it returns the brand name, a confidence score, and the coordinates of a bounding box around the logo.

内置徽标数据库涵盖消费类电子产品、服装等的流行品牌。The built-in logo database covers popular brands in consumer electronics, clothing, and more.

品牌检测示例Brand detection example

以下 JSON 响应表明计算机视觉在示例图像中检测品牌时所返回的内容。The following JSON responses illustrate what Computer Vision returns when detecting brands in the example images.

上面有 Microsoft 标签的徽标的红色衬衫

"brands":[  
   {  
      "name":"Microsoft",
      "rectangle":{  
         "x":20,
         "y":97,
         "w":62,
         "h":52
      }
   }
]

在某些情况下,品牌检测程序会挑选徽标图像和风格化品牌名称作为两个单独徽标。In some cases, the brand detector will pick up both the logo image and the stylized brand name as two separate logos.

上面有 Microsoft 标签和徽标的灰色运动衫

"brands":[  
   {  
      "name":"Microsoft",
      "rectangle":{  
         "x":58,
         "y":106,
         "w":55,
         "h":46
      }
   },
   {  
      "name":"Microsoft",
      "rectangle":{  
         "x":58,
         "y":86,
         "w":202,
         "h":63
      }
   }
]

使用 APIUse the API

品牌检测功能属于分析图像 API。The brand detection feature is part of the Analyze Image API. 可以通过本机 SDK 或 REST 调用来调用此 API。You can call this API through a native SDK or through REST calls. Brands 包括在 visualFeatures 查询参数中。Include Brands in the visualFeatures query parameter. 然后,在获取完整 JSON 响应时,就只需分析 "brands" 部分内容的字符串。Then, when you get the full JSON response, simply parse the string for the contents of the "brands" section.