你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

图像分类

除了标记和说明以外,图像分析 3.2 还可返回图像中检测到的基于分类的类别。 不同于标记,类别是在父/子层次结构中组织的,并且数量更少(86 个,与数千个标记截然相反)。 所有类别名称均采用英语。 它可以单独完成分类,也可以与新的标记模型共同完成。

86-类别分类

Azure AI 视觉可以使用下图中 86 个类别的列表广泛或具体地对图像进行分类。 有关文本格式的完整分类,请参阅类别分类

Grouped lists of all the categories in the category taxonomy

图像分类示例

以下 JSON 响应表明 Azure AI 视觉在基于视觉特征对示例图像进行分类时返回的内容。

A woman on the roof of an apartment building

{
    "categories": [
        {
            "name": "people_",
            "score": 0.81640625
        }
    ],
    "requestId": "bae7f76a-1cc7-4479-8d29-48a694974705",
    "metadata": {
        "height": 200,
        "width": 300,
        "format": "Jpeg"
    }
}

下表说明了典型的图像集以及 Azure AI 视觉为每个图像返回的类别。

映像 类别
Four people posed together as a family people_group
A puppy sitting in a grassy field animal_dog
A person standing on a mountain rock at sunset outdoor_mountain
A pile of bread roles on a table food_bread

使用 API

分类功能属于分析图像 3.2 API。 可以通过本机 SDK 或 REST 调用来调用此 API。 将 Categories 包括在 visualFeatures 查询参数中。 然后,在获取完整 JSON 响应时,就只需分析 "categories" 部分内容的字符串。

后续步骤

了解标记图像描述图像的相关概念。