Imagen Product Recontextualization at Scale
This repository contains Jupyter notebooks and tools to perform large-scale product image recontextualization using Google’s Gemini and Imagen Product Recontext models. It includes both the generation pipeline and an evaluation framework.
Authors: Layolin Jesudhass & Isidro De Loera
Contents
Section titled “Contents”Notebooks
Section titled “Notebooks”-
imagen_product_recontext_at_scale.ipynb
Scales up product image recontextualization using Imagen. Handles:- Batch generation of recontextualized product images
- Prompt engineering for diverse product contexts
- Sequential and Parallel execution options.
-
evaluation_imagen_product_recontext_at_scale.ipynb
Evaluates the generated images on various axes, such as:- Product Fidelity
- Scene Realism
- Aesthetic Quality
- Brand Integrity
- Policy Compliance
- Imaging Quality
- Sequential and Parallel execution options.
Getting Started
Section titled “Getting Started”Requirements
Section titled “Requirements”- Python 3.8+
- Jupyter or VSCode
- Google Cloud Vertex AI and access to Imagen Product Recontext API
- Required Python libraries are listed in
requirements.txt.
Installation
Section titled “Installation”- Clone the repository:
Terminal window git clone https://github.com/GoogleCloudPlatform/vertex-ai-creative-studio.git - Navigate to the experiment directory:
Terminal window cd vertex-ai-creative-studio/experiments/Imagen_Product_Recontext - Install the required dependencies:
Terminal window pip install -r requirements.txt
- Generate Images: Open and run the
imagen_product_recontext_at_scale.ipynbnotebook to generate recontextualized product images. - Evaluate Images: Open and run the
evaluation_imagen_product_recontext_at_scale.ipynbnotebook to evaluate the generated images.