Microsoft Azure搜索

问题描述 投票:0回答:1

我有一个用例,其中:

  1. 我想将图像存储在Microsoft Blob存储中,
  2. 通过提供像'water'这样的文本输入来搜索图像,然后所有包含水的图像都应该出现在搜索结果中。

我按照以下链接:https://github.com/Azure/LearnAI-Cognitive-Search/blob/master/05-Lab-2-Image-Skills.md

但在这里我知道只有2个预定义的技能是ImageAnalysisSkillOcrSkill,它们没有提供完整的图像作为搜索结果。

请帮忙...

azure-search
1个回答
0
投票

以编程方式,您可以使用图像分析认知技能自动从图像中提取标签。

有关此技能的更多信息,请参阅https://docs.microsoft.com/en-us/azure/search/cognitive-search-skill-image-analysis

你的技能看起来像这样:

{  "@odata.type": "#Microsoft.Skills.Vision.ImageAnalysisSkill",
    "context": "/document/normalized_images/*",
    "visualFeatures": [
        "Tags",
        "Description"
    ],
    "defaultLanguageCode": "en",
    "inputs": [
        {
            "name": "image",
            "source": "/document/normalized_images/*"
        }
    ],
    "outputs": [
        {
            "name": "tags",
            "targetName": "myTags"
        },
        {
            "name": "description",
            "targetName": "myDescription"
        }
    ]
}

然后在索引中,确保创建一个Collection(Edm.String)类型的字段以包含标记列表。我们称之为imageTags字段。确保该字段是可搜索的。

在输出字段映射(索引器的属性)中,您需要将标记列表映射到新创建的imageTags字段,如下所示:

   "outputFieldMappings": [
       {
           "sourceFieldName": "/document/normalized_images/*/myDescription/tags/*",
           "targetFieldName": "imageTags"
       }

这将确保在图像上找到的每个标签都插入图像标签阵列中。

另请阅读本文档,该文档解释了如何提取normalized_images如果您已经不熟悉它:https://docs.microsoft.com/en-us/azure/search/cognitive-search-concept-image-scenarios

© www.soinside.com 2019 - 2024. All rights reserved.