Initial commit of DALL-E and Segment Anything notebook (#406)
* Initial commit of DALL-E and Segment Anything notebook * Add example images and changed wording of the notebook * Updated comments and added base images * minor text amendments * fix typo * makes bullets more consistent * converts title DALLE to DALL·E * converts DALL-E to DALL·E * update original DALL-E notebook title * makes time of writing explicit * makes intro bullets more consistent * clarifies which version of Pytorch is appropriate * moves setup instructions into setup section (to help clarify that they do not need to be done separately from the notebook) * explains size of model checkpoint file * code linting * added more background info in the introduction for folks unfamiliar with segment anything * adds period to sentence * updates table of contents with new DALL·E guide --------- Co-authored-by: Ted Sanders <ted@openai.com>
@ -10,6 +10,7 @@ Most code examples are written in Python, though the concepts can be applied in
|
|||||||
|
|
||||||
## Recently added or updated 🆕 ✨
|
## Recently added or updated 🆕 ✨
|
||||||
|
|
||||||
|
- [How to create dynamic masks with DALL·E and Segment Anything](examples/dalle/How_to_create_dynamic_masks_with_DALL-E_and_Segment_Anything.ipynb) [May 19th, 2021]
|
||||||
- [Question answering using embeddings](examples/Question_answering_using_embeddings.ipynb) [Apr 14th, 2023]
|
- [Question answering using embeddings](examples/Question_answering_using_embeddings.ipynb) [Apr 14th, 2023]
|
||||||
- [Using vector databases for embeddings search](examples/vector_databases/) [various dates]
|
- [Using vector databases for embeddings search](examples/vector_databases/) [various dates]
|
||||||
- [Powering your products with ChatGPT and your own data](apps/chatbot-kickstarter/powering_your_products_with_chatgpt_and_your_data.ipynb) [Mar 10th, 2023]
|
- [Powering your products with ChatGPT and your own data](apps/chatbot-kickstarter/powering_your_products_with_chatgpt_and_your_data.ipynb) [Mar 10th, 2023]
|
||||||
@ -44,7 +45,8 @@ Most code examples are written in Python, though the concepts can be applied in
|
|||||||
- [Guide: best practices for fine-tuning GPT-3 to classify text](https://docs.google.com/document/d/1rqj7dkuvl7Byd5KQPUJRxc19BJt8wo0yHNwK84KfU3Q/edit)
|
- [Guide: best practices for fine-tuning GPT-3 to classify text](https://docs.google.com/document/d/1rqj7dkuvl7Byd5KQPUJRxc19BJt8wo0yHNwK84KfU3Q/edit)
|
||||||
- [Fine-tuned classification](examples/Fine-tuned_classification.ipynb)
|
- [Fine-tuned classification](examples/Fine-tuned_classification.ipynb)
|
||||||
- DALL-E
|
- DALL-E
|
||||||
- [How to generate and edit images with DALL-E](examples/dalle/Image_generations_edits_and_variations_with_DALL-E.ipynb)
|
- [How to generate and edit images with DALL·E](examples/dalle/Image_generations_edits_and_variations_with_DALL-E.ipynb)
|
||||||
|
- [How to create dynamic masks with DALL·E and Segment Anything](examples/dalle/How_to_create_dynamic_masks_with_DALL-E_and_Segment_Anything.ipynb)
|
||||||
- Azure OpenAI (alternative API from Microsoft Azure)
|
- Azure OpenAI (alternative API from Microsoft Azure)
|
||||||
- [How to use ChatGPT with Azure OpenAI](examples/azure/chat.ipynb)
|
- [How to use ChatGPT with Azure OpenAI](examples/azure/chat.ipynb)
|
||||||
- [How to get completions from Azure OpenAI](examples/azure/completions.ipynb)
|
- [How to get completions from Azure OpenAI](examples/azure/completions.ipynb)
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
{
|
{
|
||||||
"cells": [
|
"cells": [
|
||||||
{
|
{
|
||||||
|
"attachments": {},
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"# DALL-E\n",
|
"# How to use the DALL·E API\n",
|
||||||
"\n",
|
"\n",
|
||||||
"This notebook shows how to use OpenAI's DALL-E image API endpoints.\n",
|
"This notebook shows how to use OpenAI's DALL·E image API endpoints.\n",
|
||||||
"\n",
|
"\n",
|
||||||
"There are three API endpoints:\n",
|
"There are three API endpoints:\n",
|
||||||
"- **Generations:** generates an image or images based on an input caption\n",
|
"- **Generations:** generates an image or images based on an input caption\n",
|
||||||
@ -55,7 +56,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"source": [
|
"source": [
|
||||||
"# set a directory to save DALL-E images to\n",
|
"# set a directory to save DALL·E images to\n",
|
||||||
"image_dir_name = \"images\"\n",
|
"image_dir_name = \"images\"\n",
|
||||||
"image_dir = os.path.join(os.curdir, image_dir_name)\n",
|
"image_dir = os.path.join(os.curdir, image_dir_name)\n",
|
||||||
"\n",
|
"\n",
|
||||||
@ -318,12 +319,13 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"attachments": {},
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"## Edits\n",
|
"## Edits\n",
|
||||||
"\n",
|
"\n",
|
||||||
"The edit endpoint uses DALL-E to generate a specified portion of an existing image. Three inputs are needed: the image to edit, a mask specifying the portion to be regenerated, and a prompt describing the desired image.\n",
|
"The edit endpoint uses DALL·E to generate a specified portion of an existing image. Three inputs are needed: the image to edit, a mask specifying the portion to be regenerated, and a prompt describing the desired image.\n",
|
||||||
"\n",
|
"\n",
|
||||||
"**Required inputs:** \n",
|
"**Required inputs:** \n",
|
||||||
"- image (str): The image to edit. Must be a valid PNG file, less than 4MB, and square.\n",
|
"- image (str): The image to edit. Must be a valid PNG file, less than 4MB, and square.\n",
|
||||||
|
BIN
examples/dalle/images/01_generations/generation_1.png
Normal file
After Width: | Height: | Size: 3.0 MiB |
BIN
examples/dalle/images/01_generations/generation_2.png
Normal file
After Width: | Height: | Size: 3.0 MiB |
BIN
examples/dalle/images/01_generations/generation_3.png
Normal file
After Width: | Height: | Size: 3.0 MiB |
BIN
examples/dalle/images/02_masks/new_mask.png
Normal file
After Width: | Height: | Size: 7.6 KiB |
BIN
examples/dalle/images/03_edits/edits_0.png
Normal file
After Width: | Height: | Size: 3.0 MiB |
BIN
examples/dalle/images/03_edits/edits_1.png
Normal file
After Width: | Height: | Size: 3.0 MiB |
BIN
examples/dalle/images/03_edits/edits_2.png
Normal file
After Width: | Height: | Size: 3.0 MiB |
BIN
examples/dalle/images/03_edits/edits_3.png
Normal file
After Width: | Height: | Size: 3.0 MiB |