oracle.oci.oci_ai_vision_analyze_image_result_actions – Perform actions on an AnalyzeImageResult resource in Oracle Cloud Infrastructure

Note

This plugin is part of the oracle.oci collection (version 4.14.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install oracle.oci.

To use it in a playbook, specify: oracle.oci.oci_ai_vision_analyze_image_result_actions.

New in version 2.9.0: of oracle.oci

Synopsis

  • Perform actions on an AnalyzeImageResult resource in Oracle Cloud Infrastructure

  • For action=analyze_image, perform different types of image analysis.

Requirements

The below requirements are needed on the host that executes this module.

Parameters

Parameter Choices/Defaults Comments
action
string / required
    Choices:
  • analyze_image
The action to perform on the AnalyzeImageResult.
api_user
string
The OCID of the user, on whose behalf, OCI APIs are invoked. If not set, then the value of the OCI_USER_ID environment variable, if any, is used. This option is required if the user is not specified through a configuration file (See config_file_location). To get the user's OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_fingerprint
string
Fingerprint for the key pair being used. If not set, then the value of the OCI_USER_FINGERPRINT environment variable, if any, is used. This option is required if the key fingerprint is not specified through a configuration file (See config_file_location). To get the key pair's fingerprint value please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_key_file
string
Full path and filename of the private key (in PEM format). If not set, then the value of the OCI_USER_KEY_FILE variable, if any, is used. This option is required if the private key is not specified through a configuration file (See config_file_location). If the key is encrypted with a pass-phrase, the api_user_key_pass_phrase option must also be provided.
api_user_key_pass_phrase
string
Passphrase used by the key referenced in api_user_key_file, if it is encrypted. If not set, then the value of the OCI_USER_KEY_PASS_PHRASE variable, if any, is used. This option is required if the key passphrase is not specified through a configuration file (See config_file_location).
auth_purpose
string
    Choices:
  • service_principal
The auth purpose which can be used in conjunction with 'auth_type=instance_principal'. The default auth_purpose for instance_principal is None.
auth_type
string
    Choices:
  • api_key ←
  • instance_principal
  • instance_obo_user
  • resource_principal
The type of authentication to use for making API requests. By default auth_type="api_key" based authentication is performed and the API key (see api_user_key_file) in your config file will be used. If this 'auth_type' module option is not specified, the value of the OCI_ANSIBLE_AUTH_TYPE, if any, is used. Use auth_type="instance_principal" to use instance principal based authentication when running ansible playbooks within an OCI compute instance.
cert_bundle
string
The full path to a CA certificate bundle to be used for SSL verification. This will override the default CA certificate bundle. If not set, then the value of the OCI_ANSIBLE_CERT_BUNDLE variable, if any, is used.
compartment_id
string
The OCID of the compartment that calls the API.
config_file_location
string
Path to configuration file. If not set then the value of the OCI_CONFIG_FILE environment variable, if any, is used. Otherwise, defaults to ~/.oci/config.
config_profile_name
string
The profile to load from the config file referenced by config_file_location. If not set, then the value of the OCI_CONFIG_PROFILE environment variable, if any, is used. Otherwise, defaults to the "DEFAULT" profile in config_file_location.
features
list / elements=dictionary / required
The types of image analysis.
feature_type
string / required
    Choices:
  • TEXT_DETECTION
  • OBJECT_DETECTION
  • IMAGE_CLASSIFICATION
The type of image analysis requested. The allowed values are: - `IMAGE_CLASSIFICATION`: Label the image. - `OBJECT_DETECTION`: Identify objects in the image with bounding boxes. - `TEXT_DETECTION`: Recognize text in the image.
language
string
    Choices:
  • ENG
  • CES
  • DAN
  • NLD
  • FIN
  • FRA
  • DEU
  • ELL
  • HUN
  • ITA
  • NOR
  • POL
  • POR
  • RON
  • RUS
  • SLK
  • SPA
  • SWE
  • TUR
  • ARA
  • CHI_SIM
  • HIN
  • JPN
  • KOR
  • OTHERS
The language of the document image, abbreviated according to ISO 639-2.
Applicable when feature_type is 'TEXT_DETECTION'
max_results
integer
The maximum number of results to return.
Applicable when feature_type is one of ['IMAGE_CLASSIFICATION', 'OBJECT_DETECTION']
model_id
string
The custom model ID.
Applicable when feature_type is one of ['IMAGE_CLASSIFICATION', 'OBJECT_DETECTION']
image
dictionary / required
bucket_name
string
The Object Storage bucket name.
Required when source is 'OBJECT_STORAGE'
data
string
Raw image data.
Required when source is 'INLINE'
namespace_name
string
The Object Storage namespace.
Required when source is 'OBJECT_STORAGE'
object_name
string
The Object Storage object name.
Required when source is 'OBJECT_STORAGE'
source
string / required
    Choices:
  • OBJECT_STORAGE
  • INLINE
The location of the image data. The allowed values are: - `INLINE`: The data is included directly in the request payload. - `OBJECT_STORAGE`: The image is in OCI Object Storage.
region
string
The Oracle Cloud Infrastructure region to use for all OCI API requests. If not set, then the value of the OCI_REGION variable, if any, is used. This option is required if the region is not specified through a configuration file (See config_file_location). Please refer to https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm for more information on OCI regions.
tenancy
string
OCID of your tenancy. If not set, then the value of the OCI_TENANCY variable, if any, is used. This option is required if the tenancy OCID is not specified through a configuration file (See config_file_location). To get the tenancy OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm

Examples

- name: Perform action analyze_image on analyze_image_result
  oci_ai_vision_analyze_image_result_actions:
    # required
    features:
    - # required
      feature_type: TEXT_DETECTION

      # optional
      language: ENG
    image:
      # required
      namespace_name: namespace_name_example
      bucket_name: bucket_name_example
      object_name: object_name_example
      source: OBJECT_STORAGE
    action: analyze_image

    # optional
    compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
analyze_image_result
complex
on success
Details of the AnalyzeImageResult resource acted upon by the current operation

Sample:
{'errors': [{'code': 'code_example', 'message': 'message_example'}], 'image_classification_model_version': 'image_classification_model_version_example', 'image_objects': [{'bounding_polygon': {'normalized_vertices': [{'x': 1.2, 'y': 1.2}]}, 'confidence': 3.4, 'name': 'name_example'}], 'image_text': {'lines': [{'bounding_polygon': {'normalized_vertices': [{'x': 1.2, 'y': 1.2}]}, 'confidence': 3.4, 'text': 'text_example', 'word_indexes': []}], 'words': [{'bounding_polygon': {'normalized_vertices': [{'x': 1.2, 'y': 1.2}]}, 'confidence': 3.4, 'text': 'text_example'}]}, 'labels': [{'confidence': 3.4, 'name': 'name_example'}], 'object_detection_model_version': 'object_detection_model_version_example', 'ontology_classes': [{'name': 'name_example', 'parent_names': [], 'synonym_names': []}], 'text_detection_model_version': 'text_detection_model_version_example'}
 
errors
complex
on success
The errors encountered during image analysis.

   
code
string
on success
The error code.

Sample:
code_example
   
message
string
on success
The error message.

Sample:
message_example
 
image_classification_model_version
string
on success
The image classification model version.

Sample:
image_classification_model_version_example
 
image_objects
complex
on success
The detected objects.

   
bounding_polygon
complex
on success

     
normalized_vertices
complex
on success
An array of normalized points defining the polygon's perimeter, with an implicit segment between subsequent points and between the first and last point. Rectangles are defined with four points. For example, `[{"x": 0, "y": 0}, {"x": 1, "y": 0}, {"x": 1, "y": 0.5}, {"x": 0, "y": 0.5}]` represents the top half of an image.

       
x
float
on success
The X-axis normalized coordinate.

Sample:
1.2
       
y
float
on success
The Y-axis normalized coordinate.

Sample:
1.2
   
confidence
float
on success
The confidence score, between 0 and 1.

Sample:
3.4
   
name
string
on success
The object category name. Every value returned by the pre-deployed model is in English.

Sample:
name_example
 
image_text
complex
on success

   
lines
complex
on success
The lines of text recognized in an image.

     
bounding_polygon
complex
on success

       
normalized_vertices
complex
on success
An array of normalized points defining the polygon's perimeter, with an implicit segment between subsequent points and between the first and last point. Rectangles are defined with four points. For example, `[{"x": 0, "y": 0}, {"x": 1, "y": 0}, {"x": 1, "y": 0.5}, {"x": 0, "y": 0.5}]` represents the top half of an image.

         
x
float
on success
The X-axis normalized coordinate.

Sample:
1.2
         
y
float
on success
The Y-axis normalized coordinate.

Sample:
1.2
     
confidence
float
on success
The confidence score between 0 and 1.

Sample:
3.4
     
text
string
on success
The text recognized.

Sample:
text_example
     
word_indexes
list / elements=string
on success
The array of words.

   
words
complex
on success
The words recognized in an image.

     
bounding_polygon
complex
on success

       
normalized_vertices
complex
on success
An array of normalized points defining the polygon's perimeter, with an implicit segment between subsequent points and between the first and last point. Rectangles are defined with four points. For example, `[{"x": 0, "y": 0}, {"x": 1, "y": 0}, {"x": 1, "y": 0.5}, {"x": 0, "y": 0.5}]` represents the top half of an image.

         
x
float
on success
The X-axis normalized coordinate.

Sample:
1.2
         
y
float
on success
The Y-axis normalized coordinate.

Sample:
1.2
     
confidence
float
on success
the confidence score between 0 and 1.

Sample:
3.4
     
text
string
on success
The string of text characters in the word.

Sample:
text_example
 
labels
complex
on success
The image classification labels.

   
confidence
float
on success
The confidence score between 0 and 1.

Sample:
3.4
   
name
string
on success
The classification catagory label name.

Sample:
name_example
 
object_detection_model_version
string
on success
The object detection model version.

Sample:
object_detection_model_version_example
 
ontology_classes
complex
on success
The ontologyClasses of image labels.

   
name
string
on success
The label name.

Sample:
name_example
   
parent_names
list / elements=string
on success
The label parents.

   
synonym_names
list / elements=string
on success
The label synonyms.

 
text_detection_model_version
string
on success
The text detection model version.

Sample:
text_detection_model_version_example


Authors

  • Oracle (@oracle)