이미지 분석 인지 기술

이미지 분석 기술은 이미지 콘텐츠를 기반으로 다양한 시각적 기능 집합을 추출합니다. 예를 들어 이미지에서 캡션을 생성하거나, 태그를 생성하거나, 유명인과 랜드마크를 식별할 수 있습니다. 이 문서는 이미지 분석 기술에 대한 참조 설명서입니다. 사용 지침은 이미지에서 텍스트 및 정보 추출을 참조하세요.

이 기술은 Azure AI 서비스에서 Azure AI Vision에서 제공하는 기계 학습 모델을 사용합니다. 이미지 분석은 다음 요구 사항을 충족하는 이미지에서 작동합니다.

  • 이미지는 JPEG, PNG, GIF 또는 BMP 형식으로 제공되어야 합니다.
  • 이미지의 파일 크기가 4MB보다 작아야 합니다.
  • 이미지의 크기가 50 x 50 픽셀보다 커야 합니다.

이 기술은 AI Image Analysis API 버전 3.2를 사용하여 구현됩니다. 솔루션에서 해당 서비스 API의 최신 버전(예: 버전 4.0)을 호출해야 하는 경우 Web API 사용자 지정 기술을 통해 구현하는 것이 좋습니다.

참고 항목

이 기술은 Azure AI 서비스에 바인딩되며, 하루에 인덱서당 20개의 문서를 초과하는 트랜잭션에 대해 청구 가능한 리소스를 필요로 합니다. 기본 제공 기술을 실행하는 요금은 기존 Azure AI 서비스 종량제 가격으로 청구됩니다.

또한 이미지 추출은 Azure AI 검색을 통해 청구할 수 있습니다.

@odata.type

Microsoft.Skills.Vision.ImageAnalysisSkill

기술 매개 변수

매개 변수는 대/소문자를 구분합니다.

매개 변수 이름 설명
defaultLanguageCode 반환할 언어를 나타내는 문자열입니다. 서비스는 지정된 언어로 인식 결과를 반환합니다. 이 매개 변수를 지정하지 않을 경우 기본값은 “en”입니다.

지원되는 언어에는 Azure AI Vision의 일반 공급 언어 하위 집합이 포함됩니다. AI Vision 서비스에 일반 공급 상태의 언어가 새로 도입되면 이 기술 내에 완전히 통합되기 전에 지연이 예상됩니다.
visualFeatures 반환할 시각적 기능 형식을 나타내는 문자열 배열입니다. 유효한 시각적 기능 유형은 다음과 같습니다.
  • 성인 - 이미지가 음란물(노출 또는 성적 행위 묘사), 잔혹물(지나친 폭력 또는 유혈 묘사) 또는 선정적(외설적 콘텐츠라고도 함)인지 여부를 감지합니다.
  • 브랜드 - 대략적인 위치를 포함하여 이미지 내의 다양한 브랜드를 검색합니다.
  • 범주 - Azure AI 서비스에서 정의한 분류따라 이미지 콘텐츠를 분류합니다.
  • description - 지원되는 언어로 된 완전한 문장으로 이미지 콘텐츠를 설명합니다.
  • 얼굴 - 얼굴이 있는지 여부를 감지합니다. 있는 경우 좌표, 성별 및 연령을 생성합니다.
  • objects - 대략적인 위치를 포함하여 이미지 내의 다양한 개체를 검색합니다 .
  • ‘태그’ - 이미지 콘텐츠와 관련된 단어의 자세한 목록으로 이미지에 태그를 지정합니다.
시각적 기능의 이름은 대/소문자를 구분합니다. colorimageType 시각적 기능은 모두 사용되지 않지만 사용자 지정 기술을 통해 이 기능에 액세스할 수 있습니다. 각각defaultLanguageCode대해 지원되는 시각적 기능에 대한 Azure AI Vision Image Analysis 설명서를 참조하세요.
details 반환할 도메인 특정 세부 정보를 나타내는 문자열 배열입니다. 유효한 시각적 기능 유형은 다음과 같습니다.
  • 유명 인사 - 이미지에서 감지된 경우 유명인을 식별합니다.
  • 랜드마크 - 이미지에서 검색된 경우 랜드마크를 식별합니다.

기술 입력

입력 이름 설명
image 복합 형식입니다. imageActionnone 이외의 값으로 설정된 경우 현재 Azure Blob 인덱서에서 생성된 “/document/normalized_images” 필드에만 작동합니다.

기술 출력

출력 이름 설명
adult 출력은 부울 필드(isAdultContent, isGoryContent, isRacyContent) 및 이중 형식 점수(adultScore, goreScore, racyScore)로 구성된 복합 형식의 단일 성인 개체입니다.
brands 출력은 브랜드 개체의 배열입니다. 여기서 개체는 name(문자열) 및 confidence 점수(double)로 구성된 복합 형식입니다. 또한 이미지 내부의 배치를 나타내는 4개의 경계 상자 좌표(x, y, w, h(픽셀 단위))로 rectangle을 반환합니다. 사각형의 경우 xy는 왼쪽 위에 있습니다. 왼쪽 아래는 x, y+h입니다. 오른쪽 위는 x+w, y입니다. 오른 쪽 아래는 x+w, y+h입니다.
categories 출력은 범주 개체의 배열입니다. 여기서 각 범주 개체는 name(문자열), score(double) 및 유명인 또는 랜드마크 세부 정보가 포함된 선택적 detail로 구성된 복합 형식입니다. 범주 이름의 전체 목록은 범주 분류를 참조하세요. 세부 정보는 중첩된 복합 형식입니다. 유명 인사 세부 정보는 이름, 신뢰도 점수 및 얼굴 경계 상자로 구성됩니다. 랜드마크 세부 정보는 이름과 신뢰도 점수로 구성됩니다.
description 출력은 tagscaption 목록(Text(문자열) 및 confidence(double)로 구성된 배열)으로 구성된 복합 형식의 단일 설명 개체입니다.
faces age, genderfaceBoundingBox로 구성된 복합 형식이며 이미지 내부의 배치를 나타내는 4개의 경계 상자 좌표(픽셀 단위)가 있습니다. 좌표는 top, left, width, height입니다.
objects 출력은 시각적 기능 개체의 배열입니다. 각 개체는 object(문자열), confidence(double), rectangle(이미지 내부의 배치를 나타내는 4개의 경계 상자 좌표 포함) 및 개체 이름과 신뢰도를 포함하는 parent로 구성된 복합 형식입니다.
tags 출력은 imageTag 개체의 배열입니다. 여기서 태그 개체는 name(문자열), hint(문자열) 및 confidence(double)로 구성된 복합 형식입니다. 힌트를 추가하는 경우는 드뭅니다. 태그가 모호한 경우에만 생성됩니다. 예를 들어 "curling"으로 태그가 지정된 이미지에는 콘텐츠를 더 잘 나타내기 위한 "sports"의 힌트가 있을 수 있습니다.

샘플 기술 정의

{
    "description": "Extract image analysis.",
    "@odata.type": "#Microsoft.Skills.Vision.ImageAnalysisSkill",
    "context": "/document/normalized_images/*",
    "defaultLanguageCode": "en",
    "visualFeatures": [
        "adult",
        "brands",
        "categories",
        "description",
        "faces",
        "objects",
        "tags"
    ],
    "inputs": [
        {
            "name": "image",
            "source": "/document/normalized_images/*"
        }
    ],
    "outputs": [
        {
            "name": "adult"
        },
        {
            "name": "brands"
        },
        {
            "name": "categories"
        },
        {
            "name": "description"
        },
        {
            "name": "faces"
        },
        {
            "name": "objects"
        },
        {
            "name": "tags"
        }
    ]
}

샘플 인덱스

단일 개체(예: adultdescription)의 경우 인덱스에서 Collection(Edm.ComplexType)으로 구성하여 모든 개체에 대해 adultdescription 출력을 반환할 수 있습니다. 출력을 인덱스 필드에 매핑하는 방법에 대한 자세한 내용은 복합 형식의 정보 평면화를 참조하세요.

{
    "fields": [
        {
            "name": "metadata_storage_name",
            "type": "Edm.String",
            "key": true,
            "searchable": true,
            "filterable": false,
            "facetable": false,
            "sortable": true
        },
        {
            "name": "metadata_storage_path",
            "type": "Edm.String",
            "searchable": true,
            "filterable": false,
            "facetable": false,
            "sortable": true
        },
        {
            "name": "content",
            "type": "Edm.String",
            "sortable": false,
            "searchable": true,
            "filterable": false,
            "facetable": false
        },
        {
            "name": "adult",
            "type": "Edm.ComplexType",
            "fields": [
                {
                    "name": "isAdultContent",
                    "type": "Edm.Boolean",
                    "searchable": false,
                    "filterable": true,
                    "facetable": true
                },
                {
                    "name": "isGoryContent",
                    "type": "Edm.Boolean",
                    "searchable": false,
                    "filterable": true,
                    "facetable": true
                },
                {
                    "name": "isRacyContent",
                    "type": "Edm.Boolean",
                    "searchable": false,
                    "filterable": true,
                    "facetable": true
                },
                {
                    "name": "adultScore",
                    "type": "Edm.Double",
                    "searchable": false,
                    "filterable": false,
                    "facetable": false
                },
                {
                    "name": "goreScore",
                    "type": "Edm.Double",
                    "searchable": false,
                    "filterable": false,
                    "facetable": false
                },
                {
                    "name": "racyScore",
                    "type": "Edm.Double",
                    "searchable": false,
                    "filterable": false,
                    "facetable": false
                }
            ]
        },
        {
            "name": "brands",
            "type": "Collection(Edm.ComplexType)",
            "fields": [
                {
                    "name": "name",
                    "type": "Edm.String",
                    "searchable": true,
                    "filterable": false,
                    "facetable": false
                },
                {
                    "name": "confidence",
                    "type": "Edm.Double",
                    "searchable": false,
                    "filterable": false,
                    "facetable": false
                },
                {
                    "name": "rectangle",
                    "type": "Edm.ComplexType",
                    "fields": [
                        {
                            "name": "x",
                            "type": "Edm.Int32",
                            "searchable": false,
                            "filterable": false,
                            "facetable": false
                        },
                        {
                            "name": "y",
                            "type": "Edm.Int32",
                            "searchable": false,
                            "filterable": false,
                            "facetable": false
                        },
                        {
                            "name": "w",
                            "type": "Edm.Int32",
                            "searchable": false,
                            "filterable": false,
                            "facetable": false
                        },
                        {
                            "name": "h",
                            "type": "Edm.Int32",
                            "searchable": false,
                            "filterable": false,
                            "facetable": false
                        }
                    ]
                }
            ]
        },
        {
            "name": "categories",
            "type": "Collection(Edm.ComplexType)",
            "fields": [
                {
                    "name": "name",
                    "type": "Edm.String",
                    "searchable": true,
                    "filterable": false,
                    "facetable": false
                },
                {
                    "name": "score",
                    "type": "Edm.Double",
                    "searchable": false,
                    "filterable": false,
                    "facetable": false
                },
                {
                    "name": "detail",
                    "type": "Edm.ComplexType",
                    "fields": [
                        {
                            "name": "celebrities",
                            "type": "Collection(Edm.ComplexType)",
                            "fields": [
                                {
                                    "name": "name",
                                    "type": "Edm.String",
                                    "searchable": true,
                                    "filterable": false,
                                    "facetable": false
                                },
                                {
                                    "name": "faceBoundingBox",
                                    "type": "Collection(Edm.ComplexType)",
                                    "fields": [
                                        {
                                            "name": "x",
                                            "type": "Edm.Int32",
                                            "searchable": false,
                                            "filterable": false,
                                            "facetable": false
                                        },
                                        {
                                            "name": "y",
                                            "type": "Edm.Int32",
                                            "searchable": false,
                                            "filterable": false,
                                            "facetable": false
                                        }
                                    ]
                                },
                                {
                                    "name": "confidence",
                                    "type": "Edm.Double",
                                    "searchable": false,
                                    "filterable": false,
                                    "facetable": false
                                }
                            ]
                        },
                        {
                            "name": "landmarks",
                            "type": "Collection(Edm.ComplexType)",
                            "fields": [
                                {
                                    "name": "name",
                                    "type": "Edm.String",
                                    "searchable": true,
                                    "filterable": false,
                                    "facetable": false
                                },
                                {
                                    "name": "confidence",
                                    "type": "Edm.Double",
                                    "searchable": false,
                                    "filterable": false,
                                    "facetable": false
                                }
                            ]
                        }
                    ]
                }
            ]
        },
        {
            "name": "description",
            "type": "Collection(Edm.ComplexType)",
            "fields": [
                {
                    "name": "tags",
                    "type": "Collection(Edm.String)",
                    "searchable": true,
                    "filterable": false,
                    "facetable": false
                },
                {
                    "name": "captions",
                    "type": "Collection(Edm.ComplexType)",
                    "fields": [
                        {
                            "name": "text",
                            "type": "Edm.String",
                            "searchable": true,
                            "filterable": false,
                            "facetable": false
                        },
                        {
                            "name": "confidence",
                            "type": "Edm.Double",
                            "searchable": false,
                            "filterable": false,
                            "facetable": false
                        }
                    ]
                }
            ]
        },
        {
            "name": "faces",
            "type": "Collection(Edm.ComplexType)",
            "fields": [
                {
                    "name": "age",
                    "type": "Edm.Int32",
                    "searchable": false,
                    "filterable": false,
                    "facetable": false
                },
                {
                    "name": "gender",
                    "type": "Edm.String",
                    "searchable": false,
                    "filterable": false,
                    "facetable": false
                },
                {
                    "name": "faceBoundingBox",
                    "type": "Collection(Edm.ComplexType)",
                    "fields": [
                        {
                            "name": "top",
                            "type": "Edm.Int32",
                            "searchable": false,
                            "filterable": false,
                            "facetable": false
                        },
                        {
                            "name": "left",
                            "type": "Edm.Int32",
                            "searchable": false,
                            "filterable": false,
                            "facetable": false
                        },
                        {
                            "name": "width",
                            "type": "Edm.Int32",
                            "searchable": false,
                            "filterable": false,
                            "facetable": false
                        },
                        {
                            "name": "height",
                            "type": "Edm.Int32",
                            "searchable": false,
                            "filterable": false,
                            "facetable": false
                        }
                    ]
                }
            ]
        },
        {
            "name": "objects",
            "type": "Collection(Edm.ComplexType)",
            "fields": [
                {
                    "name": "object",
                    "type": "Edm.String",
                    "searchable": true,
                    "filterable": false,
                    "facetable": false
                },
                {
                    "name": "confidence",
                    "type": "Edm.Double",
                    "searchable": false,
                    "filterable": false,
                    "facetable": false
                },
                {
                    "name": "rectangle",
                    "type": "Edm.ComplexType",
                    "fields": [
                        {
                            "name": "x",
                            "type": "Edm.Int32",
                            "searchable": false,
                            "filterable": false,
                            "facetable": false
                        },
                        {
                            "name": "y",
                            "type": "Edm.Int32",
                            "searchable": false,
                            "filterable": false,
                            "facetable": false
                        },
                        {
                            "name": "w",
                            "type": "Edm.Int32",
                            "searchable": false,
                            "filterable": false,
                            "facetable": false
                        },
                        {
                            "name": "h",
                            "type": "Edm.Int32",
                            "searchable": false,
                            "filterable": false,
                            "facetable": false
                        }
                    ]
                },
                {
                    "name": "parent",
                    "type": "Edm.ComplexType",
                    "fields": [
                        {
                            "name": "object",
                            "type": "Edm.String",
                            "searchable": true,
                            "filterable": false,
                            "facetable": false
                        },
                        {
                            "name": "confidence",
                            "type": "Edm.Double",
                            "searchable": false,
                            "filterable": false,
                            "facetable": false
                        }
                    ]
                }
            ]
        },
        {
            "name": "tags",
            "type": "Collection(Edm.ComplexType)",
            "fields": [
                {
                    "name": "name",
                    "type": "Edm.String",
                    "searchable": true,
                    "filterable": false,
                    "facetable": false
                },
                {
                    "name": "hint",
                    "type": "Edm.String",
                    "searchable": true,
                    "filterable": false,
                    "facetable": false
                },
                {
                    "name": "confidence",
                    "type": "Edm.Double",
                    "searchable": false,
                    "filterable": false,
                    "facetable": false
                }
            ]
        }
    ]
}

샘플 출력 필드 매핑

대상 필드는 복합 필드 또는 컬렉션일 수 있습니다. 인덱스 정의는 하위 필드를 지정합니다.

"outputFieldMappings": [
    {
        "sourceFieldName": "/document/normalized_images/*/adult",
        "targetFieldName": "adult"
    },
    {
        "sourceFieldName": "/document/normalized_images/*/brands/*",
        "targetFieldName": "brands"
    },
    {
        "sourceFieldName": "/document/normalized_images/*/categories/*",
        "targetFieldName": "categories"
    },
    {
        "sourceFieldName": "/document/normalized_images/*/description",
        "targetFieldName": "description"
    },
    {
        "sourceFieldName": "/document/normalized_images/*/faces/*",
        "targetFieldName": "faces"
    },
    {
        "sourceFieldName": "/document/normalized_images/*/objects/*",
        "targetFieldName": "objects"
    },
    {
        "sourceFieldName": "/document/normalized_images/*/tags/*",
        "targetFieldName": "tags"
    }

출력 필드 매핑의 변형(중첩 속성)

유명인이나 랜드마크와 같은 하위 수준 속성에 대한 출력 필드 매핑을 정의할 수 있습니다. 이 경우 인덱스 스키마에 특별히 각 세부 정보를 포함하는 필드가 있는지 확인합니다.

"outputFieldMappings": [
    {
        "sourceFieldName": "/document/normalized_images/*/categories/detail/celebrities/*",
        "targetFieldName": "celebrities"
    },
    {
        "sourceFieldName": "/document/normalized_images/*/categories/detail/landmarks/*",
        "targetFieldName": "landmarks"
    }

샘플 입력

{
    "values": [
        {
            "recordId": "1",
            "data": {
                "image": {
                    "data": "BASE64 ENCODED STRING OF A JPEG IMAGE",
                    "width": 500,
                    "height": 300,
                    "originalWidth": 5000,
                    "originalHeight": 3000,
                    "rotationFromOriginal": 90,
                    "contentOffset": 500,
                    "pageNumber": 2
                }
            }
        }
    ]
}

샘플 출력

{
  "values": [
    {
      "recordId": "1",
      "data": {
        "categories": [
          {
            "name": "abstract_",
            "score": 0.00390625
          },
          {
            "name": "people_",
            "score": 0.83984375,
            "detail": {
              "celebrities": [
                {
                  "name": "Satya Nadella",
                  "faceBoundingBox": [
                        {
                            "x": 273,
                            "y": 309
                        },
                        {
                            "x": 395,
                            "y": 309
                        },
                        {
                            "x": 395,
                            "y": 431
                        },
                        {
                            "x": 273,
                            "y": 431
                        }
                    ],
                  "confidence": 0.999028444
                }
              ],
              "landmarks": [ ]
            }
          }
        ],
        "adult": {
          "isAdultContent": false,
          "isRacyContent": false,
          "isGoryContent": false,
          "adultScore": 0.0934349000453949,
          "racyScore": 0.068613491952419281,
          "goreScore": 0.08928389008070282
        },
        "tags": [
          {
            "name": "person",
            "confidence": 0.98979085683822632
          },
          {
            "name": "man",
            "confidence": 0.94493889808654785
          },
          {
            "name": "outdoor",
            "confidence": 0.938492476940155
          },
          {
            "name": "window",
            "confidence": 0.89513939619064331
          }
        ],
        "description": {
          "tags": [
            "person",
            "man",
            "outdoor",
            "window",
            "glasses"
          ],
          "captions": [
            {
              "text": "Satya Nadella sitting on a bench",
              "confidence": 0.48293603002174407
            }
          ]
        },
        "faces": [
          {
            "age": 44,
            "gender": "Male",
            "faceBoundingBox": [
                {
                    "x": 1601,
                    "y": 395
                },
                {
                    "x": 1653,
                    "y": 395
                },
                {
                    "x": 1653,
                    "y": 447
                },
                {
                    "x": 1601,
                    "y": 447
                }
            ]
          }
        ],
        "objects": [
          {
            "rectangle": {
              "x": 25,
              "y": 43,
              "w": 172,
              "h": 140
            },
            "object": "person",
            "confidence": 0.931
          }
        ],
        "brands":[  
           {  
              "name":"Microsoft",
              "confidence": 0.903,
              "rectangle":{  
                 "x":20,
                 "y":97,
                 "w":62,
                 "h":52
              }
           }
        ]
      }
    }
  ]
}

오류 사례

다음 오류 사례에서는 요소가 추출되지 않습니다.

오류 코드 설명
NotSupportedLanguage 제공된 언어는 지원되지 않습니다.
InvalidImageUrl 이미지 URL의 형식이 잘못되었거나 액세스할 수 없습니다.
InvalidImageFormat 입력 데이터가 유효한 이미지가 아닙니다.
InvalidImageSize 입력 이미지가 너무 큽합니다.
NotSupportedVisualFeature 지정한 기능 유형이 잘못되었습니다.
NotSupportedImage 지원되지 않는 이미지(예: 아동 포르노).
InvalidDetails 지원되지 않는 도메인별 모델입니다.

이와 유사한 "One or more skills are invalid. Details: Error in skill #<num>: Outputs are not supported by skill: Landmarks"오류가 발생하면 경로를 확인합니다. 유명 인사와 랜드 마크 모두 아래 detail속성입니다.

"categories":[  
      {  
         "name":"building_",
         "score":0.97265625,
         "detail":{  
            "landmarks":[  
               {  
                  "name":"Forbidden City",
                  "confidence":0.92013400793075562
               }
            ]

참고 항목