Integrate Oracle Analytics with OCI Vision

Integrate Oracle Analytics with Oracle Cloud Infrastructure (OCI) Vision to perform object detection, image classification, and text detection without needing machine learning or artificial intelligence expertise. For example, you might want to identify cars in photographs.

Overview to Integrating Oracle Analytics with Vision

Vision is one of several artificial intelligence (AI) services provided by Oracle Cloud Infrastructure. It gives you the power to apply machine learning and artificial intelligence without needing data science expertise.



Integrating Oracle Analytics Cloud with Vision enables object detection, image classification, and text detection from within Oracle Analytics Cloud. You perform this AI analysis by invoking the Vision service from a data flow in Oracle Analytics Cloud.

Vision includes pre-trained models and custom-trained models.

Pre-trained models

Pre-trained models allow users to perform image analysis tasks on generic datasets.

  • Object Detection finds instances of real-world objects or specific patterns in images or videos, for example, cats, dogs, bicycles, or aircraft.

  • Image Classification uses a fixed category set to assign labels to images.

  • Text Detection - Convert printed or handwritten text into a digital format.

Custom-trained model

Custom-trained models are calibrated and fine-tuned to detect images and patterns for specific purposes. For example, whereas a pre-trained model might identify electric circuits, you can design a custom-trained model to identify the electric components that make up an electric circuit, for example, resistors, LEDs, diodes, and capacitors.

Policies Required to Integrate OCI Vision with Oracle Analytics

To integrate Oracle Analytics with OCI Vision, make sure that you have the required security policies.

The OCI user that you specify in the connection between Oracle Analytics Cloud and your OCI tenancy must have read, write, and delete permissions on the compartment containing the OCI resources you want to use. Ensure that the OCI user belongs to a user group with the following minimum OCI security policies. When you connect to an OCI tenancy from Oracle Analytics, you can use either an OCI API key or resource principal.

Note: For resource principal, to include all Analytics instances under a compartment, specify {request.principal.type='analyticsinstance', request.principal.compartment.id='<compartmentA_ocid>'} instead of {request.principal.id='<analytics_instance_ocid>'}.

Table 32-7 Security policies required for OCI Vision integration

API Key Policies Resource Principal Policies
Allow group <group_name> to manage ai-service-vision-family in tenancy Allow any-user to manage ai-service-vision-family in tenancy where all {request.principal.id='<analytics_instance_ocid>'}
Allow group <group_name> to read buckets in compartment <compartment_name> Allow any-user to read buckets in compartment <compartment_name> where all {request.principal.id='<analytics_instance_ocid>'}
Allow group <group_name> to manage objects in compartment <compartment_name> where target.bucket.name='<staging_bucket_name>' Allow any-user to manage objects in compartment <compartment_name> where all {request.principal.id='<analytics_instance_ocid>', target.bucket.name='<staging_bucket_name>'}
Allow group <group_name> to read objects in compartment <compartment_name> where target.bucket.name='<images_bucket_name>' Allow any-user to read objects in compartment <compartment_name> where all {request.principal.id='<analytics_instance_ocid>', target.bucket.name='<images_bucket_name>'}
Allow group <group_name> to read objectstorage-namespaces in tenancy Allow any-user to read objectstorage-namespaces in tenancy where all {request.principal.id='<analytics_instance_ocid>'}

Typical Workflow to Integrate Oracle Analytics with Vision

Perform these tasks required to integrate Oracle Analytics with Vision and perform object detection, image classification, or text detection.

Task Description More Information
Review prerequisites Make sure that the user connecting from Oracle Analytics to the OCI tenancy has the required security policies. Policies Required to Integrate OCI Vision with Oracle Analytics
Connect to OCI Vision Create a reusable connection to your Vision service. Create a Connection to Your OCI Tenancy
Prepare images to analyze Create a dataset for the source images that you want to analyze, and upload it to Oracle Analytics. Prepare Images for Analysis With an Vision Model
Make a model available in Oracle Analytics Register a Vision model in Oracle Analytics to make it available to data flows. Make a Vision Model Available in Oracle Analytics
Process your images Use a data flow to perform object detection, image classification, or text detection. Perform Object Detection, Image Classification, and Text Detection Analysis
Analyze the results Use the dataset generated by your data flow to analyze the results. Output Data Generated for Object Detection, Image Classification, and Text Detection Analysis Models

Prepare Images for Analysis With an Vision Model

You use buckets in OCI Object Storage to store the images that you want to analyze, then create a dataset to access these images in Oracle Analytics.

In most cases, input images and Vision models are stored in the same Oracle Cloud account (tenancy). If your input images and Vision model are stored on different tenancies, you must ensure that the visibility of the storage bucket containing your input images is public and the input dataset for the data flow contains individual image URLs (as described in step 4). To learn how to make a bucket public, see Change the visibility of a bucket.

Data flows in Oracle Analytics can process up to 20,000 images in one run. If you have more than 20,000 images to process, in OCI's Object Storage & Archive Storage create multiple buckets containing no more than 20,000 images in each one. Then, create a separate dataset and data flow for each bucket, and use a Sequence to sequentially process multiple data flows.
  1. In OCI Console, navigate to Object Storage & Archive Storage, and create a bucket to store your images.

  2. Upload your images to the bucket.
    Make sure that the bucket contains no extraneous files. Oracle Analytics processes every file in the bucket.
    The bucket can be private or public, but must be accessible to the OCI user and comply with OCI's generic limits on images. See OCI documentation.
  3. To process every image in a bucket, add the bucket URL to a CSV file.
    1. In Object Storage, select the bucket to display the images in the Objects dialog.
    2. Copy the URL from the browser's URL bar.
    3. Create a CSV file with fields for ID, Bucket Name, and Bucket URL.
    4. Paste the bucket URL into the CSV file as the Bucket URL value.
  4. To process images individually, add image URIs to a CSV file.
    1. Create a CSV file with fields for ID, Image Name, and File Location.
    2. For each image in Object Storage, click the ellipsis icon ellipsis icon, and select View Object Details.
    3. Copy the Name value and URL Path (URI) value.
    4. Paste the Name value into Image Name, and paste the URL Path (URI) value into File Location.
  5. In Oracle Analytics, click Create, then Dataset.
  6. Upload the CSV file that you created in Step 3 or Step 4, and save the dataset.
If you have more than 20,000 images, you typically create multiple buckets of up to 20,000 images and create a separate dataset for each bucket.

Make a Vision Model Available in Oracle Analytics

Make a Vision model available in Oracle Analytics so that you can perform object detection, image classification, or text detection using data flows.

  1. In OCI Object Storage, create a bucket in a compartment using a suitable name (for example, MyVisionModelStagingBucket).
    This staging bucket:
    • Must be created in the accessible compartment.
    • Must be created before registering a model.
    • Can have private visibility.
    • Can be used for multiple models.
    • Can be changed in the Inspect screen.
  2. In the Oracle Analytics home page, click Page Menu Page Menu ellipsis, select Register Model/Function, and then select OCI Vision Models.
  3. At the Register a Vision Model dialog, under From a Connection click the connection that you created in Create a Connection to Your OCI Tenancy.

    A list of available models is displayed.
  4. In the list of available models, click the model you want to apply to your image data.
    For example, to detect cars in photographs, select Pretrained Object Detection. An information panel pops up displaying the model details.

  5. In Model Name, specify a name to identify the model in Oracle Analytics.
  6. In Staging Bucket Name, enter the name that you specified in Step 1 (for example, MyVisionModelStagingBucket).
  7. Click Register.
To review the registered model, from the Oracle Analytics home page, navigate to Machine Learning, then Models.