你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
ImageAnalysisOptions Class
- java.
lang. Object - com.
azure. ai. vision. imageanalysis. models. ImageAnalysisOptions
- com.
public final class ImageAnalysisOptions
Options for a single Image Analysis operation.
Constructor Summary
Constructor | Description |
---|---|
ImageAnalysisOptions() |
Creates an instance of Image |
Method Summary
Modifier and Type | Method and Description |
---|---|
String |
getLanguage()
Get the language code |
String |
getModelVersion()
Get the model version |
List<Double> |
getSmartCropsAspectRatios()
Get the smart crop aspect rations |
Boolean |
isGenderNeutralCaption()
Get the gender neutral caption selection |
Image |
setGenderNeutralCaption(Boolean genderNeutralCaption)
Sets the gender-neutral captioning option for visual features CAPTION and DENSE_CAPTIONS. |
Image |
setLanguage(String language)
Sets the desired language for output generation. |
Image |
setModelVersion(String modelVersion)
Set the version of cloud AI-model used for analysis. |
Image |
setSmartCropsAspectRatios(List<Double> smartCropsAspectRatios)
Set a list of aspect ratios for the visual feature SMART_CROPS. |
Methods inherited from java.lang.Object
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
getLanguage
public String getLanguage()
Get the language code
Returns:
getModelVersion
public String getModelVersion()
Get the model version
Returns:
getSmartCropsAspectRatios
public List
Get the smart crop aspect rations
Returns:
isGenderNeutralCaption
public Boolean isGenderNeutralCaption()
Get the gender neutral caption selection
Returns:
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:
Returns:
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:
Returns:
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:
Returns:
setSmartCropsAspectRatios
public ImageAnalysisOptions setSmartCropsAspectRatios(List
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:
Returns: