-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: imagen 3 inpainting and outpainting samples #13049
base: main
Are you sure you want to change the base?
Conversation
Here is the summary of changes. You are about to add 6 region tags.
This comment is generated by snippet-bot.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @katiemn, reviewers, and future readers!
I'm Gemini, and I'm currently reviewing this pull request. In the meantime, I'm providing a summary for everyone to quickly grasp the changes and intent.
This pull request, titled "feat: imagen 3 inpainting and outpainting samples", aims to add new samples demonstrating Imagen 3's image editing capabilities, specifically inpainting and outpainting.
Here's a breakdown of the changes:
- New Python sample files added:
generative_ai/image_generation/imagen3_editing/edit_image_3_inpainting_insert_mask.py
: This sample shows how to perform inpainting by inserting an object into a masked area of an image using a user-provided mask. The example inserts a "red hat" into an image of a woman. (Lines 1-80)generative_ai/image_generation/imagen3_editing/edit_image_3_inpainting_insert_mask_mode.py
: This sample demonstrates inpainting using automatic mask modes ("background", "foreground", or "semantic") to insert objects or backgrounds. The example adds a "beach" to the background of an image of a woman. (Lines 1-81)generative_ai/image_generation/imagen3_editing/edit_image_3_inpainting_remove_mask.py
: This sample shows how to remove an object from an image using a user-provided mask. The example removes a player from a volleyball game image. (Lines 1-81)generative_ai/image_generation/imagen3_editing/edit_image_3_inpainting_remove_mask_mode.py
: This sample demonstrates removing objects or backgrounds using automatic mask modes. The example removes the foreground (woman) from an image, leaving only the background. (Lines 1-80)generative_ai/image_generation/imagen3_editing/edit_image_3_outpainting_mask.py
: This sample shows how to perform outpainting, expanding the image content beyond its original boundaries using a user-provided mask. The example expands a picture of roller skaters to include a city skyline. (Lines 1-80)
- Corresponding test files added: Each of the above sample files has a corresponding test file (e.g.,
..._test.py
) to ensure the functionality works as expected. These tests verify that the image editing functions produce outputs with a byte size greater than 1000 bytes. (Lines 1-42 for each test file)
All new files include standard copyright headers (Lines 1-14 in each file).
I'll have a more detailed review shortly. In the meantime, please let me know if you have any questions.
And now, a little haiku to brighten your day:
Pixels shift and change,
Images reborn, anew,
Code's magic unfolds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These samples demonstrate useful Imagen 3 editing features. The code is well-structured and easy to follow. The use of descriptive variable names and comments makes the code easy to understand. The test cases are also well-written and cover the main functionalities of the samples. A few minor suggestions for improvement are included below.
New samples for Imagen 3 editing