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
- Review the supported models and
supported data types for the batch processing described on this
page.
- If you use a Product recognizer model, create a
CatalogandProductRecognitionIndexto use when you create a Product recognizer model for batch processing. Alternatively, identify an existing product recognizer index or Product recognizer model to use. - If you use a Tag recognizer model, create a model using the tag recognizer model guide.
- If you use a Product recognizer model, create a
- Create one or more Cloud Storage buckets for batch processing input and output.
- Locate supported files and upload them to your Cloud Storage input bucket to be processed.
User journey
To batch process image data, complete the following general steps:
Enable the Gemini Enterprise Agent Platform Vision API.
Create a supported processor (Product recognizer or Tag recognizer).
Create an application.
Input: Add a universal input node that specifies the files to process in Cloud Storage.
Processing: Add your model node.
Output: Add the output storage node specifying where the processed data is stored in Cloud Storage.
Create batch instances of your app, each instance corresponding to a Cloud Storage bucket input location.
Deploy the app and app instances.
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
Open the Applications tab of the Gemini Enterprise Agent Platform Vision dashboard.
Click the Create button.
Enter an app name and choose your region.
Click Continue.
Choose your billing method. For more information about the pay as you go versus monthly billing, see the pricing page.
Click Create.
Specify batch processing inputs
In the graph app builder page, click on the Universal input node.
In the side Universal input pane, click Select input sources.
In the Select input sources page, select Batch prediction.
Click Continue.
In the Sources pane, click Browse in the location picker field to indicate where your files are in Cloud Storage.
Optional. To specify more sources, click Add an item and repeat the previous step.
Click Submit.
Add the model
In the graph app builder page, click the Product recognizer model node from the Specialized models section.
In the Product recognizer pane, click Select model.
Select Select existing product recognizer model.
If you need to create a new model or index, select the corresponding option to create the resources.
Choose the model from the list.
Click Select.
Optional. Modify the Confidence threshold.
Click Apply settings.
Add an output destination
In the graph app builder page, click the Cloud Storage model node from the Output section.
In the Cloud Storage pane, click Browse to select your batch prediction output destination in Cloud Storage.
Deploy the application
- In the graph app builder page, click Deploy.
REST & CMD LINE
Complete the following steps to send your image batch processing request.
Create a Product recognizer model with the
projects.locations.processors.createmethod.This request includes reference to
CatalogandProductRecognitionIndexresources. For information about creatingCatalogandProductRecognitionIndexresources, 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",