min-dalle-test/min_dalle.ipynb

282 lines
152 KiB
Plaintext
Raw Normal View History

2022-06-28 00:58:17 +00:00
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "view-in-github"
2022-06-28 00:58:17 +00:00
},
"source": [
"<a href=\"https://colab.research.google.com/github/kuprel/min-dalle/blob/main/min_dalle.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "3WL-G_f2_ld8"
},
"source": [
"# min(DALL·E)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Zl_ZFisFApeh"
},
"source": [
"### Download models and install dependencies"
2022-06-28 00:58:17 +00:00
]
},
{
"cell_type": "code",
2022-07-01 01:02:27 +00:00
"execution_count": 1,
2022-06-28 00:58:17 +00:00
"metadata": {
"cellView": "code",
2022-07-01 01:02:27 +00:00
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "ix_xt4X1_6F4",
"outputId": "a1b44041-6887-4f4c-d535-9de9eca173ee"
2022-06-28 00:58:17 +00:00
},
2022-07-01 01:02:27 +00:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
2022-07-01 01:02:27 +00:00
"text": [
"Cloning into 'min-dalle'...\n",
"remote: Enumerating objects: 420, done.\u001b[K\n",
"remote: Counting objects: 100% (224/224), done.\u001b[K\n",
"remote: Compressing objects: 100% (100/100), done.\u001b[K\n",
"remote: Total 420 (delta 149), reused 179 (delta 121), pack-reused 196\u001b[K\n",
"Receiving objects: 100% (420/420), 1.33 MiB | 14.81 MiB/s, done.\n",
"Resolving deltas: 100% (245/245), done.\n",
" % Total % Received % Xferd Average Speed Time Time Time Current\n",
" Dload Upload Total Spent Left Speed\n",
"100 234 100 234 0 0 1800 0 --:--:-- --:--:-- --:--:-- 1800\n",
"100 290M 100 290M 0 0 93.1M 0 0:00:03 0:00:03 --:--:-- 106M\n",
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
"Requirement already satisfied: torch in /usr/local/lib/python3.7/dist-packages (1.11.0+cu113)\n",
"Collecting flax==0.4.2\n",
" Downloading flax-0.4.2-py3-none-any.whl (186 kB)\n",
"\u001b[K |████████████████████████████████| 186 kB 5.3 MB/s \n",
"\u001b[?25hCollecting wandb\n",
" Downloading wandb-0.12.20-py2.py3-none-any.whl (1.8 MB)\n",
"\u001b[K |████████████████████████████████| 1.8 MB 60.0 MB/s \n",
"\u001b[?25hRequirement already satisfied: numpy>=1.12 in /usr/local/lib/python3.7/dist-packages (from flax==0.4.2) (1.21.6)\n",
"Requirement already satisfied: msgpack in /usr/local/lib/python3.7/dist-packages (from flax==0.4.2) (1.0.4)\n",
"Requirement already satisfied: typing-extensions>=4.1.1 in /usr/local/lib/python3.7/dist-packages (from flax==0.4.2) (4.1.1)\n",
"Collecting optax\n",
" Downloading optax-0.1.2-py3-none-any.whl (140 kB)\n",
"\u001b[K |████████████████████████████████| 140 kB 71.2 MB/s \n",
"\u001b[?25hRequirement already satisfied: matplotlib in /usr/local/lib/python3.7/dist-packages (from flax==0.4.2) (3.2.2)\n",
"Requirement already satisfied: jax>=0.3 in /usr/local/lib/python3.7/dist-packages (from flax==0.4.2) (0.3.8)\n",
"Requirement already satisfied: opt-einsum in /usr/local/lib/python3.7/dist-packages (from jax>=0.3->flax==0.4.2) (3.3.0)\n",
"Requirement already satisfied: absl-py in /usr/local/lib/python3.7/dist-packages (from jax>=0.3->flax==0.4.2) (1.1.0)\n",
"Requirement already satisfied: scipy>=1.2.1 in /usr/local/lib/python3.7/dist-packages (from jax>=0.3->flax==0.4.2) (1.4.1)\n",
"Requirement already satisfied: protobuf<4.0dev,>=3.12.0 in /usr/local/lib/python3.7/dist-packages (from wandb) (3.17.3)\n",
"Requirement already satisfied: setuptools in /usr/local/lib/python3.7/dist-packages (from wandb) (57.4.0)\n",
"Collecting GitPython>=1.0.0\n",
" Downloading GitPython-3.1.27-py3-none-any.whl (181 kB)\n",
"\u001b[K |████████████████████████████████| 181 kB 66.4 MB/s \n",
"\u001b[?25hRequirement already satisfied: six>=1.13.0 in /usr/local/lib/python3.7/dist-packages (from wandb) (1.15.0)\n",
"Collecting docker-pycreds>=0.4.0\n",
" Downloading docker_pycreds-0.4.0-py2.py3-none-any.whl (9.0 kB)\n",
"Requirement already satisfied: psutil>=5.0.0 in /usr/local/lib/python3.7/dist-packages (from wandb) (5.4.8)\n",
"Collecting shortuuid>=0.5.0\n",
" Downloading shortuuid-1.0.9-py3-none-any.whl (9.4 kB)\n",
"Collecting pathtools\n",
" Downloading pathtools-0.1.2.tar.gz (11 kB)\n",
"Requirement already satisfied: requests<3,>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from wandb) (2.23.0)\n",
"Requirement already satisfied: Click!=8.0.0,>=7.0 in /usr/local/lib/python3.7/dist-packages (from wandb) (7.1.2)\n",
"Collecting setproctitle\n",
" Downloading setproctitle-1.2.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (29 kB)\n",
"Collecting sentry-sdk>=1.0.0\n",
" Downloading sentry_sdk-1.6.0-py2.py3-none-any.whl (145 kB)\n",
"\u001b[K |████████████████████████████████| 145 kB 68.4 MB/s \n",
"\u001b[?25hRequirement already satisfied: PyYAML in /usr/local/lib/python3.7/dist-packages (from wandb) (3.13)\n",
"Requirement already satisfied: promise<3,>=2.0 in /usr/local/lib/python3.7/dist-packages (from wandb) (2.3)\n",
"Collecting gitdb<5,>=4.0.1\n",
" Downloading gitdb-4.0.9-py3-none-any.whl (63 kB)\n",
"\u001b[K |████████████████████████████████| 63 kB 2.2 MB/s \n",
"\u001b[?25hCollecting smmap<6,>=3.0.1\n",
" Downloading smmap-5.0.0-py3-none-any.whl (24 kB)\n",
"Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests<3,>=2.0.0->wandb) (3.0.4)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests<3,>=2.0.0->wandb) (2022.6.15)\n",
"Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests<3,>=2.0.0->wandb) (1.24.3)\n",
"Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests<3,>=2.0.0->wandb) (2.10)\n",
"Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.7/dist-packages (from matplotlib->flax==0.4.2) (0.11.0)\n",
"Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->flax==0.4.2) (1.4.3)\n",
"Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->flax==0.4.2) (2.8.2)\n",
"Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->flax==0.4.2) (3.0.9)\n",
"Requirement already satisfied: jaxlib>=0.1.37 in /usr/local/lib/python3.7/dist-packages (from optax->flax==0.4.2) (0.3.7+cuda11.cudnn805)\n",
"Collecting chex>=0.0.4\n",
" Downloading chex-0.1.3-py3-none-any.whl (72 kB)\n",
"\u001b[K |████████████████████████████████| 72 kB 691 kB/s \n",
"\u001b[?25hRequirement already satisfied: toolz>=0.9.0 in /usr/local/lib/python3.7/dist-packages (from chex>=0.0.4->optax->flax==0.4.2) (0.11.2)\n",
"Requirement already satisfied: dm-tree>=0.1.5 in /usr/local/lib/python3.7/dist-packages (from chex>=0.0.4->optax->flax==0.4.2) (0.1.7)\n",
"Requirement already satisfied: flatbuffers<3.0,>=1.12 in /usr/local/lib/python3.7/dist-packages (from jaxlib>=0.1.37->optax->flax==0.4.2) (2.0)\n",
"Building wheels for collected packages: pathtools\n",
" Building wheel for pathtools (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
" Created wheel for pathtools: filename=pathtools-0.1.2-py3-none-any.whl size=8806 sha256=7699646fac65684c2ccc2b48202e402265e5b09080ae1c581d247167f3668402\n",
" Stored in directory: /root/.cache/pip/wheels/3e/31/09/fa59cef12cdcfecc627b3d24273699f390e71828921b2cbba2\n",
"Successfully built pathtools\n",
"Installing collected packages: smmap, gitdb, chex, shortuuid, setproctitle, sentry-sdk, pathtools, optax, GitPython, docker-pycreds, wandb, flax\n",
"Successfully installed GitPython-3.1.27 chex-0.1.3 docker-pycreds-0.4.0 flax-0.4.2 gitdb-4.0.9 optax-0.1.2 pathtools-0.1.2 sentry-sdk-1.6.0 setproctitle-1.2.3 shortuuid-1.0.9 smmap-5.0.0 wandb-0.12.20\n",
"\u001b[34m\u001b[1mwandb\u001b[0m: Appending key for api.wandb.ai to your netrc file: /root/.netrc\n",
"\u001b[34m\u001b[1mwandb\u001b[0m: Downloading dataset artifact dalle-mini/dalle-mini/mini-1:v0\n",
"\u001b[34m\u001b[1mwandb\u001b[0m: Downloading large artifact mini-1:v0, 1673.43MB. 7 files... Done. 0:0:14.7\n",
"\u001b[34m\u001b[1mwandb\u001b[0m: Artifact downloaded to /content/min-dalle/pretrained/dalle_bart_mini\n",
"\u001b[34m\u001b[1mwandb\u001b[0m: Downloading dataset artifact dalle-mini/dalle-mini/mega-1-fp16:v14\n",
"\u001b[34m\u001b[1mwandb\u001b[0m: Downloading large artifact mega-1-fp16:v14, 4938.53MB. 7 files... Done. 0:0:53.4\n",
"\u001b[34m\u001b[1mwandb\u001b[0m: Artifact downloaded to /content/min-dalle/pretrained/dalle_bart_mega\n"
]
},
{
"data": {
"text/plain": []
2022-07-01 01:02:27 +00:00
},
"execution_count": 1,
2022-07-01 01:02:27 +00:00
"metadata": {},
"output_type": "execute_result"
2022-07-01 01:02:27 +00:00
}
],
2022-06-28 00:58:17 +00:00
"source": [
2022-06-29 20:32:51 +00:00
"%%shell\n",
"\n",
"git clone https://github.com/kuprel/min-dalle\n",
"mkdir -p /content/min-dalle/pretrained/vqgan/\n",
"curl https://huggingface.co/dalle-mini/vqgan_imagenet_f16_16384/resolve/main/flax_model.msgpack -L --output /content/min-dalle/pretrained/vqgan/flax_model.msgpack\n",
"pip install torch flax wandb\n",
2022-06-29 20:32:51 +00:00
"wandb login --anonymously\n",
"wandb artifact get --root=/content/min-dalle/pretrained/dalle_bart_mega dalle-mini/dalle-mini/mega-1-fp16:v14\n"
2022-06-28 00:58:17 +00:00
]
},
{
"cell_type": "markdown",
2022-06-30 15:25:24 +00:00
"metadata": {
"id": "kViq2dMbGDKt"
},
"source": [
"### Load Model"
2022-06-30 15:25:24 +00:00
]
},
{
"cell_type": "code",
2022-06-30 15:25:24 +00:00
"execution_count": 2,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
2022-06-30 15:25:24 +00:00
},
"id": "8W-L2ICFGFup",
2022-07-01 01:02:27 +00:00
"outputId": "a7008b7d-4c05-4860-e997-7b6e93062307"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"initializing MinDalleTorch\n",
"reading files from pretrained/dalle_bart_mega\n",
"converting params to torch\n",
"initializing DalleBartEncoderTorch\n",
"initializing DalleBartDecoderTorch\n",
"initializing VQGanDetokenizer\n"
]
}
2022-06-30 15:25:24 +00:00
],
"source": [
"import os\n",
"os.chdir('/content/min-dalle')\n",
"from min_dalle.min_dalle_torch import MinDalleTorch\n",
"\n",
2022-07-01 01:02:27 +00:00
"model = MinDalleTorch(is_mega=True, is_reusable=True)\n"
]
},
2022-06-28 00:58:17 +00:00
{
"cell_type": "markdown",
2022-06-28 15:01:31 +00:00
"metadata": {
2022-06-28 15:05:59 +00:00
"id": "c52TV1GbBNgS"
},
"source": [
"### Generate an Image"
]
2022-06-28 00:58:17 +00:00
},
{
"cell_type": "code",
2022-07-01 01:02:27 +00:00
"execution_count": 4,
2022-06-28 00:58:17 +00:00
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
2022-07-01 01:02:27 +00:00
"height": 426
2022-06-28 15:05:59 +00:00
},
"id": "nQ0UG05dA4p2",
2022-07-01 01:02:27 +00:00
"outputId": "00d01630-a892-4018-d5b2-ee0ea2047b98"
2022-06-28 00:58:17 +00:00
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
2022-06-28 00:58:17 +00:00
"text": [
"tokenizing text\n",
2022-07-01 01:02:27 +00:00
"['Ġartificial']\n",
"['Ġintelligence']\n",
"text tokens [0, 6316, 7815, 2]\n",
2022-06-28 00:58:17 +00:00
"encoding text tokens\n",
"sampling image tokens\n",
"detokenizing image\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAIAAADTED8xAAEAAElEQVR4nEz9V9NtSZIdiK3lHrH3PuITV6eozCzV1VXVWqIFGkA3MA3CoEgjMUPSbIZiaDZG4wP5MvMwf4i0MRIkxwAbwAgNNGZaVLWq6uquqqwskeLq+4kjtgh350PEudmZlpaZ3z3fPufsHeGxfPny5dR1UqogCQNgAKQL4BSqAkLUvwghQIIRIBkEKEKSCBAkCYIBBIj6EiFQLyAg43SlT/9B/SFBCAAESJD1Ojz9Edje4PWLX1+Bwvp2AEgCCEKogDMQlCBIitRrCkVOnycCDCgZwqAoSDDVtw8wTu9MISinD09C6vcDhASp0X7MAAlRYYBBCTBAqfcFhChAUusdCgrAen9J8XbTCESQpJAABBAyguLhUr8hEZD6vhFBkYggX9/P8GA4RYIM1Kfj7TcdCIQAQnhEBANRXwTUW06ERxAID3qAKCQiwsMjyCDoAY9gREREuxIiPCJCwoEIBCIQBODhiPphQxDhDtRXIxyEA1afavtJhAUQizLghnCA9S0YTiI8BB7mQHgYIhAhYV7vXL1ygOHFQRhhQKA+pwiGGhYwbEHq8sCikUBnQQSgSoeDEqJ1DaGtBSHpCAJRd4ioUMI9BGgrpq3WoESECj0grAuUBIPtSX1654MgE6U9DtS1VbcNgwSiXiH4eg3KacUHePoplMGQkLZ/2qcCJWkWc1BMAhBESN1LpEqOcFUgxCkSIhQ6LUUEhUIhA3X1iyiDFHGcd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hhTSceyoShp8qbmBIjfbuIWxgs
2022-06-28 00:58:17 +00:00
"text/plain": [
2022-07-01 01:02:27 +00:00
"<PIL.Image.Image image mode=RGB size=256x256 at 0x7F0671709D10>"
]
2022-06-28 00:58:17 +00:00
},
"metadata": {},
"output_type": "display_data"
2022-06-29 17:55:23 +00:00
},
{
"name": "stdout",
"output_type": "stream",
2022-06-29 17:55:23 +00:00
"text": [
2022-07-01 01:02:27 +00:00
"CPU times: user 7.4 s, sys: 8.11 ms, total: 7.41 s\n",
"Wall time: 7.38 s\n"
2022-06-29 17:55:23 +00:00
]
2022-06-28 00:58:17 +00:00
}
2022-06-28 15:05:59 +00:00
],
"source": [
2022-06-29 17:55:23 +00:00
"%%time\n",
"\n",
2022-07-01 01:02:27 +00:00
"text = \"artificial intelligence\" #@param {type:\"string\"}\n",
2022-06-29 14:37:12 +00:00
"seed = 10 #@param {type:\"integer\"}\n",
2022-06-28 15:05:59 +00:00
"\n",
"image = model.generate_image(text, seed)\n",
2022-06-28 15:05:59 +00:00
"display(image)"
2022-06-28 00:58:17 +00:00
]
}
],
"metadata": {
"accelerator": "GPU",
"colab": {
2022-06-28 15:05:59 +00:00
"collapsed_sections": [
"Zl_ZFisFApeh"
],
"include_colab_link": true,
2022-06-30 15:25:24 +00:00
"name": "min-dalle",
"provenance": []
2022-06-28 00:58:17 +00:00
},
"gpuClass": "standard",
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 0
}