Rapidly generate text ads and ad backgrounds for your product using Google Ads and DV360 targeting.
Shape Shifter showcases the ability to replace product backgrounds accurately using Google AI. It is useful for:
- Replace advertising image backgrounds or text copy based on targeting such as:
- Geography or points of interest.
- Audience.
- Time of day.
- Device type.
- Or any other source of data.
There are two parts to this code:
- Demo - Shows a cool globe of various products rendered with different backgrounds base don country.
- Workflow - The logic that connects to DV360 and/or Google Ads and generates ads from targeting.
View the demo here. The coolest parts of the demo are:
- The product images are integrated flawlessly.
- The houses for the car background look like they're from that country.
- The AI correctly picks up the fauna and tile patterns of each country.
- The products are rendered correctly on shelves.
- Every image is first pass AI generated, we did not edit it, imagine what you can do with more variety.
The process is designed to be an end to end demo of how to integrate an AI process into both products.
- Process:
- A set of product images is used
- A query is run to select 180+ largest countries around the world to accommodate markers on map.
- The product images are cross joined with the countries to generate an Imagen 2 prompt for each.
- The AI generated images are saved using a naming convention to the local folder.
- A script combines the LAT/LONG coordinates of each country and the generated images.
- The index.html file contains a MapBox globe that renders everything.
- A few things to know:
- Vorato and Balm are completely independent. Click images on left to switch between them.
- Left images always show "original" image used as input to AI.
- Right images are 'ALL' the images generated for a country. Clicking one switch the map to use that image.
- For Vorato there are : 2 farm images, 2 landscape images, 1 street image.
- For Balm: there are: 1 counter image, 1 garden image, 1 flower/spa image
- All images were processed 100% using AI, the prompt for each image is shown under the image in the map ( they are the same across countries).
- Demo Page Instructions:
- press s: controls spin on and off
- press r: (party game) selects random place and show images ( ask users to guess location)
- press a: (party game) travels to answer and shows country
The prompts for each generated image are shown when you click on them on the globe.
To make things fun you can play a guess the background game.
- Press s to stop or start the spin.
- Press r to get a random set of images on the right.
- Have people guess the country or targeting option.
- Press a to get the answer.
Pitch your clients with a custom product demo, here is the source and how:
python ../bqflow/run.py demo/vorato.json -u ~user.json -p gcp-project -v
python ../bqflow/run.py demo/cbalm.json -u ~user.json -p gcp-project -v
python demo/ads.py
Generate ads from campaign targeting with minimal overhead.
New display ads are created in drive for review, then uploaded to DV360.
python ../bqflow/run.py dv360/targeting.json -u ~user.json -p gcp-project -v
python dv360/upload_assets.py
New text ads are created directly within Google Ads.
python ../bqflow/run.py gads/targeting.json -u ~user.json -p gcp-project -v
python ../bqflow/run.py gads/upload_assets.json -u ~user.json -p gcp-project -v
Copyright 2024 Google LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
This is NOT an official Google product.