Class ImageAnalysisOptions

java.lang.Object
com.azure.ai.vision.imageanalysis.models.ImageAnalysisOptions

public final class ImageAnalysisOptions extends Object
Options for a single Image Analysis operation.
  • Constructor Details

    • ImageAnalysisOptions

      public ImageAnalysisOptions()
      Creates an instance of ImageAnalysisOptions class with default analysis options, as specified by the service. The Language used will be "en" (for English). Gender Neutral Caption is "false". One Smart Crop region with an aspect ratio the service sees fit. Model version is "latest".
  • Method Details

    • setLanguage

      public ImageAnalysisOptions setLanguage(String language)
      Sets the desired language for output generation. At the moment this only applies to the visual feature TAGS. If this parameter is not specified, the default value is "en" for English. See https://aka.ms/cv-languages for a list of supported languages and to which visual feature they apply.
      Parameters:
      language - The langauge code to set, as specified in https://aka.ms/cv-languages.
      Returns:
      Returns the same concrete type with the appropriate properties updated, to allow for fluent chaining of operations.
    • getLanguage

      public String getLanguage()
      Get the language code
      Returns:
      The language code
    • setGenderNeutralCaption

      public ImageAnalysisOptions setGenderNeutralCaption(Boolean genderNeutralCaption)
      Sets the gender-neutral captioning option for visual features CAPTION and DENSE_CAPTIONS. If this parameter is not specified, the default value is "false". By default captions may contain gender terms (for example: 'man', 'woman', or 'boy', 'girl'). If you set this to "true", those will be replaced with gender-neutral terms (for example: 'person' or 'child').
      Parameters:
      genderNeutralCaption - Set to "true" to get gender neutral captions.
      Returns:
      Returns the same concrete type with the appropriate properties updated, to allow for fluent chaining of operations.
    • isGenderNeutralCaption

      public Boolean isGenderNeutralCaption()
      Get the gender neutral caption selection
      Returns:
      The gender neutral caption selection
    • setSmartCropsAspectRatios

      public ImageAnalysisOptions setSmartCropsAspectRatios(List<Double> smartCropsAspectRatios)
      Set a list of aspect ratios for the visual feature SMART_CROPS. Aspect ratios are calculated by dividing the target crop width in pixels by the height in pixels. Supported values are between 0.75 and 1.8 (inclusive). If this parameter is not specified, the service will return one crop region with an aspect ratio it sees fit between 0.5 and 2.0 (inclusive).
      Parameters:
      smartCropsAspectRatios - The list of aspect ratios to set.
      Returns:
      Returns the same concrete type with the appropriate properties updated, to allow for fluent chaining of operations.
    • getSmartCropsAspectRatios

      public List<Double> getSmartCropsAspectRatios()
      Get the smart crop aspect rations
      Returns:
      The smart crop aspect rations
    • setModelVersion

      public ImageAnalysisOptions setModelVersion(String modelVersion)
      Set the version of cloud AI-model used for analysis. The format is the following: 'latest' (default value) or 'YYYY-MM-DD' or 'YYYY-MM-DD-preview', where 'YYYY', 'MM', 'DD' are the year, month and day associated with the model. This is not commonly set, as the default always gives the latest AI model with recent improvements. If however you would like to make sure analysis results do not change over time, set this value to a specific model version. Note that the model version is available in the Image Analysis Result (see com.azure.ai.vision.imageanalysis.models.ImageAnalysisResult.getModelVersion).
      Parameters:
      modelVersion - The model version to set.
      Returns:
      Returns the same concrete type with the appropriate properties updated, to allow for fluent chaining of operations.
    • getModelVersion

      public String getModelVersion()
      Get the model version
      Returns:
      The model version