Image batch processing

In addition to streaming processing, you can choose batch processing as a way to get information from data. This non-streaming processing mode lets you build applications to support other media types.

You can batch process image files stored in Cloud Storage with select models. The output is stored in Cloud Storage.

Supported models

The following models support batch processing:

  • Tag recognizer
  • Product recognizer

Supported data types

This page describes how you batch process the following types of data:

  • Image data

Before you begin

User journey

To batch process image data, complete the following general steps:

  1. Enable the Gemini Enterprise Agent Platform Vision API.

  2. Create a supported processor (Product recognizer or Tag recognizer).

  3. Create an application.

    1. Input: Add a universal input node that specifies the files to process in Cloud Storage.

    2. Processing: Add your model node.

    3. Output: Add the output storage node specifying where the processed data is stored in Cloud Storage.

  4. Create batch instances of your app, each instance corresponding to a Cloud Storage bucket input location.

  5. Deploy the app and app instances.

  6. After the batch processing instance finishes, examine the output stored in Cloud Storage.

Batch process images

The steps to send a batch processing request vary from model to model. Follow the instructions for your target model to batch process images.

Product recognizer model

Use these samples to batch process images with a Product recognizer model.

Console

Create an image batch processing request in the Google Cloud console.

Create a new application

  1. Open the Applications tab of the Gemini Enterprise Agent Platform Vision dashboard.

    Go to the Applications tab

  2. Click the Create button.

  3. Enter an app name and choose your region.

  4. Click Continue.

  5. Choose your billing method. For more information about the pay as you go versus monthly billing, see the pricing page.

  6. Click Create.

Specify batch processing inputs

  1. In the graph app builder page, click on the Universal input node.

  2. In the side Universal input pane, click Select input sources.

  3. In the Select input sources page, select Batch prediction.

  4. Click Continue.

  5. In the Sources pane, click Browse in the location picker field to indicate where your files are in Cloud Storage.

  6. Optional. To specify more sources, click Add an item and repeat the previous step.

  7. Click Submit.

Add the model

  1. In the graph app builder page, click the Product recognizer model node from the Specialized models section.

  2. In the Product recognizer pane, click Select model.

  3. Select Select existing product recognizer model.

    If you need to create a new model or index, select the corresponding option to create the resources.

  4. Choose the model from the list.

  5. Click Select.

  6. Optional. Modify the Confidence threshold.

  7. Click Apply settings.

Add an output destination

  1. In the graph app builder page, click the Cloud Storage model node from the Output section.

  2. In the Cloud Storage pane, click Browse to select your batch prediction output destination in Cloud Storage.

Deploy the application

  1. In the graph app builder page, click Deploy.

REST & CMD LINE

Complete the following steps to send your image batch processing request.

  1. Create a Product recognizer model with the projects.locations.processors.create method.

    This request includes reference to Catalog and ProductRecognitionIndex resources. For information about creating Catalog and ProductRecognitionIndex resources, see the Product recognizer model guide.

    curl -X POST \
     -H "Authorization: Bearer $(gcloud auth print-access-token)" \
     -H "Content-Type: application/json" \
     https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/LOCATION_ID/processors?processor_id=product-recognition-model1 \
     -d '{
       "display_name": "DISPLAY_NAME",