{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure/json-schema/microsoft-azure-image-analysis-schema.json",
  "title": "ImageAnalysis",
  "description": "Result of AnalyzeImage operation.",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-analyze-api-openapi.yml#/components/schemas/ImageAnalysis",
  "type": "object",
  "properties": {
    "categories": {
      "type": "array",
      "description": "An array indicating identified categories.",
      "items": {
        "$ref": "#/$defs/Category"
      }
    },
    "adult": {
      "$ref": "#/$defs/AdultInfo"
    },
    "color": {
      "$ref": "#/$defs/ColorInfo"
    },
    "imageType": {
      "$ref": "#/$defs/ImageType"
    },
    "tags": {
      "type": "array",
      "description": "A list of tags with confidence level.",
      "items": {
        "$ref": "#/$defs/ImageTag"
      }
    },
    "description": {
      "$ref": "#/$defs/ImageDescriptionDetails"
    },
    "faces": {
      "type": "array",
      "description": "An array of possible faces within the image.",
      "items": {
        "$ref": "#/$defs/FaceDescription"
      }
    },
    "requestId": {
      "type": "string",
      "description": "Id of the request for tracking purposes."
    },
    "metadata": {
      "$ref": "#/$defs/ImageMetadata"
    }
  },
  "$defs": {
    "AdultInfo": {
      "type": "object",
      "description": "An object describing whether the image contains adult-oriented content and/or is racy.",
      "properties": {
        "isAdultContent": {
          "type": "boolean",
          "description": "A value indicating if the image contains adult-oriented content."
        },
        "isRacyContent": {
          "type": "boolean",
          "description": "A value indicating if the image is race."
        },
        "adultScore": {
          "type": "number",
          "format": "double",
          "description": "Score from 0 to 1 that indicates how much of adult content is within the image."
        },
        "racyScore": {
          "type": "number",
          "format": "double",
          "description": "Score from 0 to 1 that indicates how suggestive is the image."
        }
      }
    },
    "Category": {
      "type": "object",
      "description": "An object describing identified category.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the category."
        },
        "score": {
          "type": "number",
          "format": "double",
          "description": "Scoring of the category."
        },
        "detail": {
          "$ref": "#/$defs/CategoryDetail"
        }
      }
    },
    "CategoryDetail": {
      "type": "object",
      "description": "An object describing additional category details.",
      "properties": {
        "celebrities": {
          "type": "array",
          "description": "An array of celebrities if any identified.",
          "items": {
            "$ref": "#/$defs/CelebritiesModel"
          }
        }
      }
    },
    "CelebritiesModel": {
      "type": "object",
      "description": "An object describing possible celebrity identification.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the celebrity."
        },
        "confidence": {
          "type": "number",
          "format": "double",
          "description": "Level of confidence ranging from 0 to 1."
        },
        "faceRectangle": {
          "$ref": "#/$defs/FaceRectangle"
        }
      }
    },
    "ColorInfo": {
      "type": "object",
      "description": "An object providing additional metadata describing color attributes.",
      "properties": {
        "dominantColorForeground": {
          "type": "string",
          "description": "Possible dominant foreground color."
        },
        "dominantColorBackground": {
          "type": "string",
          "description": "Possible dominant background color."
        },
        "dominantColors": {
          "type": "array",
          "description": "An array of possible dominant colors.",
          "items": {
            "type": "string"
          }
        },
        "accentColor": {
          "type": "string",
          "description": "Possible accent color."
        },
        "isBWImg": {
          "type": "boolean",
          "description": "A value indicating if the image is black and white."
        }
      }
    },
    "FaceDescription": {
      "type": "object",
      "description": "An object describing a face identified in the image.",
      "properties": {
        "age": {
          "type": "integer",
          "description": "Possible age of the face."
        },
        "gender": {
          "type": "string",
          "description": "Possible gender of the face.",
          "x-ms-enum": {
            "name": "Gender-",
            "modelAsString": false
          },
          "enum": [
            "Male",
            "Female"
          ]
        },
        "faceRectangle": {
          "$ref": "#/$defs/FaceRectangle"
        }
      }
    },
    "FaceRectangle": {
      "type": "object",
      "description": "An object describing face rectangle.",
      "properties": {
        "left": {
          "type": "integer",
          "description": "X-coordinate of the top left point of the face."
        },
        "top": {
          "type": "integer",
          "description": "Y-coordinate of the top left point of the face."
        },
        "width": {
          "type": "integer",
          "description": "Width measured from the top-left point of the face."
        },
        "height": {
          "type": "integer",
          "description": "Height measured from the top-left point of the face."
        }
      }
    },
    "ImageCaption": {
      "type": "object",
      "description": "An image caption, i.e. a brief description of what the image depicts.",
      "properties": {
        "text": {
          "type": "string",
          "description": "The text of the caption"
        },
        "confidence": {
          "type": "number",
          "format": "double",
          "description": "The level of confidence the service has in the caption"
        }
      }
    },
    "ImageDescriptionDetails": {
      "type": "object",
      "description": "A collection of content tags, along with a list of captions sorted by confidence level, and image metadata.",
      "properties": {
        "tags": {
          "type": "array",
          "description": "A collection of image tags.",
          "items": {
            "type": "string"
          }
        },
        "captions": {
          "type": "array",
          "description": "A list of captions, sorted by confidence level.",
          "items": {
            "$ref": "#/$defs/ImageCaption"
          }
        },
        "requestId": {
          "type": "string",
          "description": "Id of the REST API request."
        },
        "metadata": {
          "$ref": "#/$defs/ImageMetadata"
        }
      }
    },
    "ImageMetadata": {
      "type": "object",
      "description": "Image metadata",
      "properties": {
        "width": {
          "type": "integer",
          "format": "int32",
          "description": "Image width"
        },
        "height": {
          "type": "integer",
          "format": "int32",
          "description": "Image height"
        },
        "format": {
          "type": "string",
          "description": "Image format"
        }
      }
    },
    "ImageTag": {
      "type": "object",
      "description": "An image caption, i.e. a brief description of what the image depicts.",
      "properties": {
        "name": {
          "type": "string",
          "description": "The tag value"
        },
        "confidence": {
          "type": "number",
          "format": "double",
          "description": "The level of confidence the service has in the caption"
        }
      }
    },
    "ImageType": {
      "type": "object",
      "description": "An object providing possible image types and matching confidence levels.",
      "properties": {
        "clipArtType": {
          "type": "number",
          "description": "Confidence level that the image is a clip art."
        },
        "lineDrawingType": {
          "type": "number",
          "description": "Confidence level that the image is a line drawing."
        }
      }
    }
  }
}