anuragshas commited on
Commit
4657882
1 Parent(s): 052ffc4

Upload cyclegan.ipynb

Browse files
Files changed (1) hide show
  1. cyclegan.ipynb +2138 -0
cyclegan.ipynb ADDED
@@ -0,0 +1,2138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "metadata": {
6
+ "id": "VRNFFldCsmkI"
7
+ },
8
+ "source": [
9
+ "# CycleGAN\n",
10
+ "\n",
11
+ "**Author:** [A_K_Nain](https://twitter.com/A_K_Nain)<br>\n",
12
+ "**Date created:** 2020/08/12<br>\n",
13
+ "**Last modified:** 2020/08/12<br>\n",
14
+ "**Description:** Implementation of CycleGAN."
15
+ ]
16
+ },
17
+ {
18
+ "cell_type": "markdown",
19
+ "metadata": {
20
+ "id": "jVwB_Ph0smkK"
21
+ },
22
+ "source": [
23
+ "## CycleGAN\n",
24
+ "\n",
25
+ "CycleGAN is a model that aims to solve the image-to-image translation\n",
26
+ "problem. The goal of the image-to-image translation problem is to learn the\n",
27
+ "mapping between an input image and an output image using a training set of\n",
28
+ "aligned image pairs. However, obtaining paired examples isn't always feasible.\n",
29
+ "CycleGAN tries to learn this mapping without requiring paired input-output images,\n",
30
+ "using cycle-consistent adversarial networks.\n",
31
+ "\n",
32
+ "- [Paper](https://arxiv.org/pdf/1703.10593.pdf)\n",
33
+ "- [Original implementation](https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix)"
34
+ ]
35
+ },
36
+ {
37
+ "cell_type": "markdown",
38
+ "metadata": {
39
+ "id": "bOpg5meHsmkL"
40
+ },
41
+ "source": [
42
+ "## Setup"
43
+ ]
44
+ },
45
+ {
46
+ "cell_type": "code",
47
+ "execution_count": null,
48
+ "metadata": {
49
+ "id": "v46aKoQZtNcW"
50
+ },
51
+ "outputs": [],
52
+ "source": [
53
+ "%%capture\n",
54
+ "!pip install tensorflow_addons tensorflow_datasets"
55
+ ]
56
+ },
57
+ {
58
+ "cell_type": "code",
59
+ "execution_count": null,
60
+ "metadata": {
61
+ "id": "BgLCBj6asmkL"
62
+ },
63
+ "outputs": [],
64
+ "source": [
65
+ "import os\n",
66
+ "import numpy as np\n",
67
+ "import matplotlib.pyplot as plt\n",
68
+ "\n",
69
+ "import tensorflow as tf\n",
70
+ "from tensorflow import keras\n",
71
+ "from tensorflow.keras import layers\n",
72
+ "\n",
73
+ "import tensorflow_addons as tfa\n",
74
+ "import tensorflow_datasets as tfds\n",
75
+ "\n",
76
+ "tfds.disable_progress_bar()\n",
77
+ "autotune = tf.data.AUTOTUNE\n"
78
+ ]
79
+ },
80
+ {
81
+ "cell_type": "markdown",
82
+ "metadata": {
83
+ "id": "pa0OuHEhsmkM"
84
+ },
85
+ "source": [
86
+ "## Prepare the dataset\n",
87
+ "\n",
88
+ "In this example, we will be using the\n",
89
+ "[horse to zebra](https://www.tensorflow.org/datasets/catalog/cycle_gan#cycle_ganhorse2zebra)\n",
90
+ "dataset."
91
+ ]
92
+ },
93
+ {
94
+ "cell_type": "code",
95
+ "execution_count": null,
96
+ "metadata": {
97
+ "id": "ejy7DeR-smkM"
98
+ },
99
+ "outputs": [],
100
+ "source": [
101
+ "# Load the horse-zebra dataset using tensorflow-datasets.\n",
102
+ "dataset, _ = tfds.load(\"cycle_gan/horse2zebra\", with_info=True, as_supervised=True)\n",
103
+ "train_horses, train_zebras = dataset[\"trainA\"], dataset[\"trainB\"]\n",
104
+ "test_horses, test_zebras = dataset[\"testA\"], dataset[\"testB\"]\n",
105
+ "\n",
106
+ "# Define the standard image size.\n",
107
+ "orig_img_size = (286, 286)\n",
108
+ "# Size of the random crops to be used during training.\n",
109
+ "input_img_size = (256, 256, 3)\n",
110
+ "# Weights initializer for the layers.\n",
111
+ "kernel_init = keras.initializers.RandomNormal(mean=0.0, stddev=0.02)\n",
112
+ "# Gamma initializer for instance normalization.\n",
113
+ "gamma_init = keras.initializers.RandomNormal(mean=0.0, stddev=0.02)\n",
114
+ "\n",
115
+ "buffer_size = 256\n",
116
+ "batch_size = 1\n",
117
+ "\n",
118
+ "\n",
119
+ "def normalize_img(img):\n",
120
+ " img = tf.cast(img, dtype=tf.float32)\n",
121
+ " # Map values in the range [-1, 1]\n",
122
+ " return (img / 127.5) - 1.0\n",
123
+ "\n",
124
+ "\n",
125
+ "def preprocess_train_image(img, label):\n",
126
+ " # Random flip\n",
127
+ " img = tf.image.random_flip_left_right(img)\n",
128
+ " # Resize to the original size first\n",
129
+ " img = tf.image.resize(img, [*orig_img_size])\n",
130
+ " # Random crop to 256X256\n",
131
+ " img = tf.image.random_crop(img, size=[*input_img_size])\n",
132
+ " # Normalize the pixel values in the range [-1, 1]\n",
133
+ " img = normalize_img(img)\n",
134
+ " return img\n",
135
+ "\n",
136
+ "\n",
137
+ "def preprocess_test_image(img, label):\n",
138
+ " # Only resizing and normalization for the test images.\n",
139
+ " img = tf.image.resize(img, [input_img_size[0], input_img_size[1]])\n",
140
+ " img = normalize_img(img)\n",
141
+ " return img\n"
142
+ ]
143
+ },
144
+ {
145
+ "cell_type": "markdown",
146
+ "metadata": {
147
+ "id": "ZjNdjd9PsmkN"
148
+ },
149
+ "source": [
150
+ "## Create `Dataset` objects"
151
+ ]
152
+ },
153
+ {
154
+ "cell_type": "code",
155
+ "execution_count": null,
156
+ "metadata": {
157
+ "id": "bFRrL22WsmkO"
158
+ },
159
+ "outputs": [],
160
+ "source": [
161
+ "\n",
162
+ "# Apply the preprocessing operations to the training data\n",
163
+ "train_horses = (\n",
164
+ " train_horses.map(preprocess_train_image, num_parallel_calls=autotune)\n",
165
+ " .cache()\n",
166
+ " .shuffle(buffer_size)\n",
167
+ " .batch(batch_size)\n",
168
+ ")\n",
169
+ "train_zebras = (\n",
170
+ " train_zebras.map(preprocess_train_image, num_parallel_calls=autotune)\n",
171
+ " .cache()\n",
172
+ " .shuffle(buffer_size)\n",
173
+ " .batch(batch_size)\n",
174
+ ")\n",
175
+ "\n",
176
+ "# Apply the preprocessing operations to the test data\n",
177
+ "test_horses = (\n",
178
+ " test_horses.map(preprocess_test_image, num_parallel_calls=autotune)\n",
179
+ " .cache()\n",
180
+ " .shuffle(buffer_size)\n",
181
+ " .batch(batch_size)\n",
182
+ ")\n",
183
+ "test_zebras = (\n",
184
+ " test_zebras.map(preprocess_test_image, num_parallel_calls=autotune)\n",
185
+ " .cache()\n",
186
+ " .shuffle(buffer_size)\n",
187
+ " .batch(batch_size)\n",
188
+ ")\n"
189
+ ]
190
+ },
191
+ {
192
+ "cell_type": "markdown",
193
+ "metadata": {
194
+ "id": "cqnAgImAsmkO"
195
+ },
196
+ "source": [
197
+ "## Visualize some samples"
198
+ ]
199
+ },
200
+ {
201
+ "cell_type": "code",
202
+ "execution_count": null,
203
+ "metadata": {
204
+ "id": "vs6JE_nksmkP"
205
+ },
206
+ "outputs": [],
207
+ "source": [
208
+ "\n",
209
+ "_, ax = plt.subplots(4, 2, figsize=(10, 15))\n",
210
+ "for i, samples in enumerate(zip(train_horses.take(4), train_zebras.take(4))):\n",
211
+ " horse = (((samples[0][0] * 127.5) + 127.5).numpy()).astype(np.uint8)\n",
212
+ " zebra = (((samples[1][0] * 127.5) + 127.5).numpy()).astype(np.uint8)\n",
213
+ " ax[i, 0].imshow(horse)\n",
214
+ " ax[i, 1].imshow(zebra)\n",
215
+ "plt.show()\n"
216
+ ]
217
+ },
218
+ {
219
+ "cell_type": "markdown",
220
+ "metadata": {
221
+ "id": "m7Wlng40smkP"
222
+ },
223
+ "source": [
224
+ "## Building blocks used in the CycleGAN generators and discriminators"
225
+ ]
226
+ },
227
+ {
228
+ "cell_type": "code",
229
+ "execution_count": null,
230
+ "metadata": {
231
+ "id": "gZgsli56smkQ"
232
+ },
233
+ "outputs": [],
234
+ "source": [
235
+ "\n",
236
+ "class ReflectionPadding2D(layers.Layer):\n",
237
+ " \"\"\"Implements Reflection Padding as a layer.\n",
238
+ "\n",
239
+ " Args:\n",
240
+ " padding(tuple): Amount of padding for the\n",
241
+ " spatial dimensions.\n",
242
+ "\n",
243
+ " Returns:\n",
244
+ " A padded tensor with the same type as the input tensor.\n",
245
+ " \"\"\"\n",
246
+ "\n",
247
+ " def __init__(self, padding=(1, 1), **kwargs):\n",
248
+ " self.padding = tuple(padding)\n",
249
+ " super(ReflectionPadding2D, self).__init__(**kwargs)\n",
250
+ "\n",
251
+ " def call(self, input_tensor, mask=None):\n",
252
+ " padding_width, padding_height = self.padding\n",
253
+ " padding_tensor = [\n",
254
+ " [0, 0],\n",
255
+ " [padding_height, padding_height],\n",
256
+ " [padding_width, padding_width],\n",
257
+ " [0, 0],\n",
258
+ " ]\n",
259
+ " return tf.pad(input_tensor, padding_tensor, mode=\"REFLECT\")\n",
260
+ "\n",
261
+ "\n",
262
+ "def residual_block(\n",
263
+ " x,\n",
264
+ " activation,\n",
265
+ " kernel_initializer=kernel_init,\n",
266
+ " kernel_size=(3, 3),\n",
267
+ " strides=(1, 1),\n",
268
+ " padding=\"valid\",\n",
269
+ " gamma_initializer=gamma_init,\n",
270
+ " use_bias=False,\n",
271
+ "):\n",
272
+ " dim = x.shape[-1]\n",
273
+ " input_tensor = x\n",
274
+ "\n",
275
+ " x = ReflectionPadding2D()(input_tensor)\n",
276
+ " x = layers.Conv2D(\n",
277
+ " dim,\n",
278
+ " kernel_size,\n",
279
+ " strides=strides,\n",
280
+ " kernel_initializer=kernel_initializer,\n",
281
+ " padding=padding,\n",
282
+ " use_bias=use_bias,\n",
283
+ " )(x)\n",
284
+ " x = tfa.layers.InstanceNormalization(gamma_initializer=gamma_initializer)(x)\n",
285
+ " x = activation(x)\n",
286
+ "\n",
287
+ " x = ReflectionPadding2D()(x)\n",
288
+ " x = layers.Conv2D(\n",
289
+ " dim,\n",
290
+ " kernel_size,\n",
291
+ " strides=strides,\n",
292
+ " kernel_initializer=kernel_initializer,\n",
293
+ " padding=padding,\n",
294
+ " use_bias=use_bias,\n",
295
+ " )(x)\n",
296
+ " x = tfa.layers.InstanceNormalization(gamma_initializer=gamma_initializer)(x)\n",
297
+ " x = layers.add([input_tensor, x])\n",
298
+ " return x\n",
299
+ "\n",
300
+ "\n",
301
+ "def downsample(\n",
302
+ " x,\n",
303
+ " filters,\n",
304
+ " activation,\n",
305
+ " kernel_initializer=kernel_init,\n",
306
+ " kernel_size=(3, 3),\n",
307
+ " strides=(2, 2),\n",
308
+ " padding=\"same\",\n",
309
+ " gamma_initializer=gamma_init,\n",
310
+ " use_bias=False,\n",
311
+ "):\n",
312
+ " x = layers.Conv2D(\n",
313
+ " filters,\n",
314
+ " kernel_size,\n",
315
+ " strides=strides,\n",
316
+ " kernel_initializer=kernel_initializer,\n",
317
+ " padding=padding,\n",
318
+ " use_bias=use_bias,\n",
319
+ " )(x)\n",
320
+ " x = tfa.layers.InstanceNormalization(gamma_initializer=gamma_initializer)(x)\n",
321
+ " if activation:\n",
322
+ " x = activation(x)\n",
323
+ " return x\n",
324
+ "\n",
325
+ "\n",
326
+ "def upsample(\n",
327
+ " x,\n",
328
+ " filters,\n",
329
+ " activation,\n",
330
+ " kernel_size=(3, 3),\n",
331
+ " strides=(2, 2),\n",
332
+ " padding=\"same\",\n",
333
+ " kernel_initializer=kernel_init,\n",
334
+ " gamma_initializer=gamma_init,\n",
335
+ " use_bias=False,\n",
336
+ "):\n",
337
+ " x = layers.Conv2DTranspose(\n",
338
+ " filters,\n",
339
+ " kernel_size,\n",
340
+ " strides=strides,\n",
341
+ " padding=padding,\n",
342
+ " kernel_initializer=kernel_initializer,\n",
343
+ " use_bias=use_bias,\n",
344
+ " )(x)\n",
345
+ " x = tfa.layers.InstanceNormalization(gamma_initializer=gamma_initializer)(x)\n",
346
+ " if activation:\n",
347
+ " x = activation(x)\n",
348
+ " return x\n"
349
+ ]
350
+ },
351
+ {
352
+ "cell_type": "markdown",
353
+ "metadata": {
354
+ "id": "fXdgpeLGsmkQ"
355
+ },
356
+ "source": [
357
+ "## Build the generators\n",
358
+ "\n",
359
+ "The generator consists of downsampling blocks: nine residual blocks\n",
360
+ "and upsampling blocks. The structure of the generator is the following:\n",
361
+ "\n",
362
+ "```\n",
363
+ "c7s1-64 ==> Conv block with `relu` activation, filter size of 7\n",
364
+ "d128 ====|\n",
365
+ " |-> 2 downsampling blocks\n",
366
+ "d256 ====|\n",
367
+ "R256 ====|\n",
368
+ "R256 |\n",
369
+ "R256 |\n",
370
+ "R256 |\n",
371
+ "R256 |-> 9 residual blocks\n",
372
+ "R256 |\n",
373
+ "R256 |\n",
374
+ "R256 |\n",
375
+ "R256 ====|\n",
376
+ "u128 ====|\n",
377
+ " |-> 2 upsampling blocks\n",
378
+ "u64 ====|\n",
379
+ "c7s1-3 => Last conv block with `tanh` activation, filter size of 7.\n",
380
+ "```"
381
+ ]
382
+ },
383
+ {
384
+ "cell_type": "code",
385
+ "execution_count": null,
386
+ "metadata": {
387
+ "id": "G67IU1n_smkR"
388
+ },
389
+ "outputs": [],
390
+ "source": [
391
+ "\n",
392
+ "def get_resnet_generator(\n",
393
+ " filters=64,\n",
394
+ " num_downsampling_blocks=2,\n",
395
+ " num_residual_blocks=9,\n",
396
+ " num_upsample_blocks=2,\n",
397
+ " gamma_initializer=gamma_init,\n",
398
+ " name=None,\n",
399
+ "):\n",
400
+ " img_input = layers.Input(shape=input_img_size, name=name + \"_img_input\")\n",
401
+ " x = ReflectionPadding2D(padding=(3, 3))(img_input)\n",
402
+ " x = layers.Conv2D(filters, (7, 7), kernel_initializer=kernel_init, use_bias=False)(\n",
403
+ " x\n",
404
+ " )\n",
405
+ " x = tfa.layers.InstanceNormalization(gamma_initializer=gamma_initializer)(x)\n",
406
+ " x = layers.Activation(\"relu\")(x)\n",
407
+ "\n",
408
+ " # Downsampling\n",
409
+ " for _ in range(num_downsampling_blocks):\n",
410
+ " filters *= 2\n",
411
+ " x = downsample(x, filters=filters, activation=layers.Activation(\"relu\"))\n",
412
+ "\n",
413
+ " # Residual blocks\n",
414
+ " for _ in range(num_residual_blocks):\n",
415
+ " x = residual_block(x, activation=layers.Activation(\"relu\"))\n",
416
+ "\n",
417
+ " # Upsampling\n",
418
+ " for _ in range(num_upsample_blocks):\n",
419
+ " filters //= 2\n",
420
+ " x = upsample(x, filters, activation=layers.Activation(\"relu\"))\n",
421
+ "\n",
422
+ " # Final block\n",
423
+ " x = ReflectionPadding2D(padding=(3, 3))(x)\n",
424
+ " x = layers.Conv2D(3, (7, 7), padding=\"valid\")(x)\n",
425
+ " x = layers.Activation(\"tanh\")(x)\n",
426
+ "\n",
427
+ " model = keras.models.Model(img_input, x, name=name)\n",
428
+ " return model\n"
429
+ ]
430
+ },
431
+ {
432
+ "cell_type": "markdown",
433
+ "metadata": {
434
+ "id": "72QKJBi8smkR"
435
+ },
436
+ "source": [
437
+ "## Build the discriminators\n",
438
+ "\n",
439
+ "The discriminators implement the following architecture:\n",
440
+ "`C64->C128->C256->C512`"
441
+ ]
442
+ },
443
+ {
444
+ "cell_type": "code",
445
+ "execution_count": null,
446
+ "metadata": {
447
+ "id": "IWRDg78-smkR"
448
+ },
449
+ "outputs": [],
450
+ "source": [
451
+ "\n",
452
+ "def get_discriminator(\n",
453
+ " filters=64, kernel_initializer=kernel_init, num_downsampling=3, name=None\n",
454
+ "):\n",
455
+ " img_input = layers.Input(shape=input_img_size, name=name + \"_img_input\")\n",
456
+ " x = layers.Conv2D(\n",
457
+ " filters,\n",
458
+ " (4, 4),\n",
459
+ " strides=(2, 2),\n",
460
+ " padding=\"same\",\n",
461
+ " kernel_initializer=kernel_initializer,\n",
462
+ " )(img_input)\n",
463
+ " x = layers.LeakyReLU(0.2)(x)\n",
464
+ "\n",
465
+ " num_filters = filters\n",
466
+ " for num_downsample_block in range(3):\n",
467
+ " num_filters *= 2\n",
468
+ " if num_downsample_block < 2:\n",
469
+ " x = downsample(\n",
470
+ " x,\n",
471
+ " filters=num_filters,\n",
472
+ " activation=layers.LeakyReLU(0.2),\n",
473
+ " kernel_size=(4, 4),\n",
474
+ " strides=(2, 2),\n",
475
+ " )\n",
476
+ " else:\n",
477
+ " x = downsample(\n",
478
+ " x,\n",
479
+ " filters=num_filters,\n",
480
+ " activation=layers.LeakyReLU(0.2),\n",
481
+ " kernel_size=(4, 4),\n",
482
+ " strides=(1, 1),\n",
483
+ " )\n",
484
+ "\n",
485
+ " x = layers.Conv2D(\n",
486
+ " 1, (4, 4), strides=(1, 1), padding=\"same\", kernel_initializer=kernel_initializer\n",
487
+ " )(x)\n",
488
+ "\n",
489
+ " model = keras.models.Model(inputs=img_input, outputs=x, name=name)\n",
490
+ " return model\n",
491
+ "\n",
492
+ "\n",
493
+ "# Get the generators\n",
494
+ "gen_G = get_resnet_generator(name=\"generator_G\")\n",
495
+ "gen_F = get_resnet_generator(name=\"generator_F\")\n",
496
+ "\n",
497
+ "# Get the discriminators\n",
498
+ "disc_X = get_discriminator(name=\"discriminator_X\")\n",
499
+ "disc_Y = get_discriminator(name=\"discriminator_Y\")\n"
500
+ ]
501
+ },
502
+ {
503
+ "cell_type": "markdown",
504
+ "metadata": {
505
+ "id": "aX9EntYasmkS"
506
+ },
507
+ "source": [
508
+ "## Build the CycleGAN model\n",
509
+ "\n",
510
+ "We will override the `train_step()` method of the `Model` class\n",
511
+ "for training via `fit()`."
512
+ ]
513
+ },
514
+ {
515
+ "cell_type": "code",
516
+ "execution_count": null,
517
+ "metadata": {
518
+ "id": "n8gUdq8gsmkS"
519
+ },
520
+ "outputs": [],
521
+ "source": [
522
+ "\n",
523
+ "class CycleGan(keras.Model):\n",
524
+ " def __init__(\n",
525
+ " self,\n",
526
+ " generator_G,\n",
527
+ " generator_F,\n",
528
+ " discriminator_X,\n",
529
+ " discriminator_Y,\n",
530
+ " lambda_cycle=10.0,\n",
531
+ " lambda_identity=0.5,\n",
532
+ " ):\n",
533
+ " super(CycleGan, self).__init__()\n",
534
+ " self.gen_G = generator_G\n",
535
+ " self.gen_F = generator_F\n",
536
+ " self.disc_X = discriminator_X\n",
537
+ " self.disc_Y = discriminator_Y\n",
538
+ " self.lambda_cycle = lambda_cycle\n",
539
+ " self.lambda_identity = lambda_identity\n",
540
+ "\n",
541
+ " def compile(\n",
542
+ " self,\n",
543
+ " gen_G_optimizer,\n",
544
+ " gen_F_optimizer,\n",
545
+ " disc_X_optimizer,\n",
546
+ " disc_Y_optimizer,\n",
547
+ " gen_loss_fn,\n",
548
+ " disc_loss_fn,\n",
549
+ " ):\n",
550
+ " super(CycleGan, self).compile()\n",
551
+ " self.gen_G_optimizer = gen_G_optimizer\n",
552
+ " self.gen_F_optimizer = gen_F_optimizer\n",
553
+ " self.disc_X_optimizer = disc_X_optimizer\n",
554
+ " self.disc_Y_optimizer = disc_Y_optimizer\n",
555
+ " self.generator_loss_fn = gen_loss_fn\n",
556
+ " self.discriminator_loss_fn = disc_loss_fn\n",
557
+ " self.cycle_loss_fn = keras.losses.MeanAbsoluteError()\n",
558
+ " self.identity_loss_fn = keras.losses.MeanAbsoluteError()\n",
559
+ "\n",
560
+ " def train_step(self, batch_data):\n",
561
+ " # x is Horse and y is zebra\n",
562
+ " real_x, real_y = batch_data\n",
563
+ "\n",
564
+ " # For CycleGAN, we need to calculate different\n",
565
+ " # kinds of losses for the generators and discriminators.\n",
566
+ " # We will perform the following steps here:\n",
567
+ " #\n",
568
+ " # 1. Pass real images through the generators and get the generated images\n",
569
+ " # 2. Pass the generated images back to the generators to check if we\n",
570
+ " # we can predict the original image from the generated image.\n",
571
+ " # 3. Do an identity mapping of the real images using the generators.\n",
572
+ " # 4. Pass the generated images in 1) to the corresponding discriminators.\n",
573
+ " # 5. Calculate the generators total loss (adverserial + cycle + identity)\n",
574
+ " # 6. Calculate the discriminators loss\n",
575
+ " # 7. Update the weights of the generators\n",
576
+ " # 8. Update the weights of the discriminators\n",
577
+ " # 9. Return the losses in a dictionary\n",
578
+ "\n",
579
+ " with tf.GradientTape(persistent=True) as tape:\n",
580
+ " # Horse to fake zebra\n",
581
+ " fake_y = self.gen_G(real_x, training=True)\n",
582
+ " # Zebra to fake horse -> y2x\n",
583
+ " fake_x = self.gen_F(real_y, training=True)\n",
584
+ "\n",
585
+ " # Cycle (Horse to fake zebra to fake horse): x -> y -> x\n",
586
+ " cycled_x = self.gen_F(fake_y, training=True)\n",
587
+ " # Cycle (Zebra to fake horse to fake zebra) y -> x -> y\n",
588
+ " cycled_y = self.gen_G(fake_x, training=True)\n",
589
+ "\n",
590
+ " # Identity mapping\n",
591
+ " same_x = self.gen_F(real_x, training=True)\n",
592
+ " same_y = self.gen_G(real_y, training=True)\n",
593
+ "\n",
594
+ " # Discriminator output\n",
595
+ " disc_real_x = self.disc_X(real_x, training=True)\n",
596
+ " disc_fake_x = self.disc_X(fake_x, training=True)\n",
597
+ "\n",
598
+ " disc_real_y = self.disc_Y(real_y, training=True)\n",
599
+ " disc_fake_y = self.disc_Y(fake_y, training=True)\n",
600
+ "\n",
601
+ " # Generator adverserial loss\n",
602
+ " gen_G_loss = self.generator_loss_fn(disc_fake_y)\n",
603
+ " gen_F_loss = self.generator_loss_fn(disc_fake_x)\n",
604
+ "\n",
605
+ " # Generator cycle loss\n",
606
+ " cycle_loss_G = self.cycle_loss_fn(real_y, cycled_y) * self.lambda_cycle\n",
607
+ " cycle_loss_F = self.cycle_loss_fn(real_x, cycled_x) * self.lambda_cycle\n",
608
+ "\n",
609
+ " # Generator identity loss\n",
610
+ " id_loss_G = (\n",
611
+ " self.identity_loss_fn(real_y, same_y)\n",
612
+ " * self.lambda_cycle\n",
613
+ " * self.lambda_identity\n",
614
+ " )\n",
615
+ " id_loss_F = (\n",
616
+ " self.identity_loss_fn(real_x, same_x)\n",
617
+ " * self.lambda_cycle\n",
618
+ " * self.lambda_identity\n",
619
+ " )\n",
620
+ "\n",
621
+ " # Total generator loss\n",
622
+ " total_loss_G = gen_G_loss + cycle_loss_G + id_loss_G\n",
623
+ " total_loss_F = gen_F_loss + cycle_loss_F + id_loss_F\n",
624
+ "\n",
625
+ " # Discriminator loss\n",
626
+ " disc_X_loss = self.discriminator_loss_fn(disc_real_x, disc_fake_x)\n",
627
+ " disc_Y_loss = self.discriminator_loss_fn(disc_real_y, disc_fake_y)\n",
628
+ "\n",
629
+ " # Get the gradients for the generators\n",
630
+ " grads_G = tape.gradient(total_loss_G, self.gen_G.trainable_variables)\n",
631
+ " grads_F = tape.gradient(total_loss_F, self.gen_F.trainable_variables)\n",
632
+ "\n",
633
+ " # Get the gradients for the discriminators\n",
634
+ " disc_X_grads = tape.gradient(disc_X_loss, self.disc_X.trainable_variables)\n",
635
+ " disc_Y_grads = tape.gradient(disc_Y_loss, self.disc_Y.trainable_variables)\n",
636
+ "\n",
637
+ " # Update the weights of the generators\n",
638
+ " self.gen_G_optimizer.apply_gradients(\n",
639
+ " zip(grads_G, self.gen_G.trainable_variables)\n",
640
+ " )\n",
641
+ " self.gen_F_optimizer.apply_gradients(\n",
642
+ " zip(grads_F, self.gen_F.trainable_variables)\n",
643
+ " )\n",
644
+ "\n",
645
+ " # Update the weights of the discriminators\n",
646
+ " self.disc_X_optimizer.apply_gradients(\n",
647
+ " zip(disc_X_grads, self.disc_X.trainable_variables)\n",
648
+ " )\n",
649
+ " self.disc_Y_optimizer.apply_gradients(\n",
650
+ " zip(disc_Y_grads, self.disc_Y.trainable_variables)\n",
651
+ " )\n",
652
+ "\n",
653
+ " return {\n",
654
+ " \"G_loss\": total_loss_G,\n",
655
+ " \"F_loss\": total_loss_F,\n",
656
+ " \"D_X_loss\": disc_X_loss,\n",
657
+ " \"D_Y_loss\": disc_Y_loss,\n",
658
+ " }\n"
659
+ ]
660
+ },
661
+ {
662
+ "cell_type": "markdown",
663
+ "metadata": {
664
+ "id": "S5tmLYeBsmkT"
665
+ },
666
+ "source": [
667
+ "## Create a callback that periodically saves generated images"
668
+ ]
669
+ },
670
+ {
671
+ "cell_type": "code",
672
+ "execution_count": null,
673
+ "metadata": {
674
+ "id": "t9EqZ5uBsmkV"
675
+ },
676
+ "outputs": [],
677
+ "source": [
678
+ "\n",
679
+ "class GANMonitor(keras.callbacks.Callback):\n",
680
+ " \"\"\"A callback to generate and save images after each epoch\"\"\"\n",
681
+ "\n",
682
+ " def __init__(self, num_img=4):\n",
683
+ " self.num_img = num_img\n",
684
+ "\n",
685
+ " def on_epoch_end(self, epoch, logs=None):\n",
686
+ " _, ax = plt.subplots(4, 2, figsize=(12, 12))\n",
687
+ " for i, img in enumerate(test_horses.take(self.num_img)):\n",
688
+ " prediction = self.model.gen_G(img)[0].numpy()\n",
689
+ " prediction = (prediction * 127.5 + 127.5).astype(np.uint8)\n",
690
+ " img = (img[0] * 127.5 + 127.5).numpy().astype(np.uint8)\n",
691
+ "\n",
692
+ " ax[i, 0].imshow(img)\n",
693
+ " ax[i, 1].imshow(prediction)\n",
694
+ " ax[i, 0].set_title(\"Input image\")\n",
695
+ " ax[i, 1].set_title(\"Translated image\")\n",
696
+ " ax[i, 0].axis(\"off\")\n",
697
+ " ax[i, 1].axis(\"off\")\n",
698
+ "\n",
699
+ " prediction = keras.preprocessing.image.array_to_img(prediction)\n",
700
+ " prediction.save(\n",
701
+ " \"generated_img_{i}_{epoch}.png\".format(i=i, epoch=epoch + 1)\n",
702
+ " )\n",
703
+ " plt.show()\n",
704
+ " plt.close()\n"
705
+ ]
706
+ },
707
+ {
708
+ "cell_type": "markdown",
709
+ "metadata": {
710
+ "id": "ARuT30Z0smkV"
711
+ },
712
+ "source": [
713
+ "## Train the end-to-end model"
714
+ ]
715
+ },
716
+ {
717
+ "cell_type": "code",
718
+ "execution_count": null,
719
+ "metadata": {
720
+ "id": "5I6aQE7SsmkV"
721
+ },
722
+ "outputs": [],
723
+ "source": [
724
+ "\n",
725
+ "# Loss function for evaluating adversarial loss\n",
726
+ "adv_loss_fn = keras.losses.MeanSquaredError()\n",
727
+ "\n",
728
+ "# Define the loss function for the generators\n",
729
+ "def generator_loss_fn(fake):\n",
730
+ " fake_loss = adv_loss_fn(tf.ones_like(fake), fake)\n",
731
+ " return fake_loss\n",
732
+ "\n",
733
+ "\n",
734
+ "# Define the loss function for the discriminators\n",
735
+ "def discriminator_loss_fn(real, fake):\n",
736
+ " real_loss = adv_loss_fn(tf.ones_like(real), real)\n",
737
+ " fake_loss = adv_loss_fn(tf.zeros_like(fake), fake)\n",
738
+ " return (real_loss + fake_loss) * 0.5\n",
739
+ "\n",
740
+ "\n",
741
+ "# Create cycle gan model\n",
742
+ "cycle_gan_model = CycleGan(\n",
743
+ " generator_G=gen_G, generator_F=gen_F, discriminator_X=disc_X, discriminator_Y=disc_Y\n",
744
+ ")\n",
745
+ "\n",
746
+ "# Compile the model\n",
747
+ "cycle_gan_model.compile(\n",
748
+ " gen_G_optimizer=keras.optimizers.Adam(learning_rate=2e-4, beta_1=0.5),\n",
749
+ " gen_F_optimizer=keras.optimizers.Adam(learning_rate=2e-4, beta_1=0.5),\n",
750
+ " disc_X_optimizer=keras.optimizers.Adam(learning_rate=2e-4, beta_1=0.5),\n",
751
+ " disc_Y_optimizer=keras.optimizers.Adam(learning_rate=2e-4, beta_1=0.5),\n",
752
+ " gen_loss_fn=generator_loss_fn,\n",
753
+ " disc_loss_fn=discriminator_loss_fn,\n",
754
+ ")\n",
755
+ "# Callbacks\n",
756
+ "plotter = GANMonitor()\n",
757
+ "checkpoint_filepath = \"./model_checkpoints/cyclegan_checkpoints.{epoch:03d}\"\n",
758
+ "model_checkpoint_callback = keras.callbacks.ModelCheckpoint(\n",
759
+ " filepath=checkpoint_filepath\n",
760
+ ")\n",
761
+ "\n",
762
+ "# Here we will train the model for just one epoch as each epoch takes around\n",
763
+ "# 7 minutes on a single P100 backed machine.\n",
764
+ "cycle_gan_model.fit(\n",
765
+ " tf.data.Dataset.zip((train_horses, train_zebras)),\n",
766
+ " epochs=1,\n",
767
+ " callbacks=[plotter, model_checkpoint_callback],\n",
768
+ ")"
769
+ ]
770
+ },
771
+ {
772
+ "cell_type": "markdown",
773
+ "metadata": {
774
+ "id": "2PsVmLKAsmkW"
775
+ },
776
+ "source": [
777
+ "Test the performance of the model."
778
+ ]
779
+ },
780
+ {
781
+ "cell_type": "code",
782
+ "execution_count": null,
783
+ "metadata": {
784
+ "id": "aHEDqhP1smkW"
785
+ },
786
+ "outputs": [],
787
+ "source": [
788
+ "\n",
789
+ "# This model was trained for 90 epochs. We will be loading those weights\n",
790
+ "# here. Once the weights are loaded, we will take a few samples from the test\n",
791
+ "# data and check the model's performance."
792
+ ]
793
+ },
794
+ {
795
+ "cell_type": "code",
796
+ "execution_count": null,
797
+ "metadata": {
798
+ "id": "O-dNKakasmkW",
799
+ "colab": {
800
+ "base_uri": "https://localhost:8080/"
801
+ },
802
+ "outputId": "b988e2a2-2eb3-4e60-dfd1-3f6b5670aadb"
803
+ },
804
+ "outputs": [
805
+ {
806
+ "output_type": "stream",
807
+ "name": "stdout",
808
+ "text": [
809
+ " % Total % Received % Xferd Average Speed Time Time Time Current\n",
810
+ " Dload Upload Total Spent Left Speed\n",
811
+ "100 660 100 660 0 0 1880 0 --:--:-- --:--:-- --:--:-- 1880\n",
812
+ "100 273M 100 273M 0 0 6400k 0 0:00:43 0:00:43 --:--:-- 9.8M\n"
813
+ ]
814
+ }
815
+ ],
816
+ "source": [
817
+ "!curl -LO https://github.com/AakashKumarNain/CycleGAN_TF2/releases/download/v1.0/saved_checkpoints.zip\n",
818
+ "!unzip -qq saved_checkpoints.zip"
819
+ ]
820
+ },
821
+ {
822
+ "cell_type": "code",
823
+ "execution_count": null,
824
+ "metadata": {
825
+ "id": "HSYC0yy_smkW"
826
+ },
827
+ "outputs": [],
828
+ "source": [
829
+ "\n",
830
+ "# Load the checkpoints\n",
831
+ "weight_file = \"./saved_checkpoints/cyclegan_checkpoints.090\"\n",
832
+ "cycle_gan_model.load_weights(weight_file).expect_partial()\n",
833
+ "print(\"Weights loaded successfully\")\n",
834
+ "\n",
835
+ "_, ax = plt.subplots(4, 2, figsize=(10, 15))\n",
836
+ "for i, img in enumerate(test_horses.take(4)):\n",
837
+ " prediction = cycle_gan_model.gen_G(img, training=False)[0].numpy()\n",
838
+ " prediction = (prediction * 127.5 + 127.5).astype(np.uint8)\n",
839
+ " img = (img[0] * 127.5 + 127.5).numpy().astype(np.uint8)\n",
840
+ "\n",
841
+ " ax[i, 0].imshow(img)\n",
842
+ " ax[i, 1].imshow(prediction)\n",
843
+ " ax[i, 0].set_title(\"Input image\")\n",
844
+ " ax[i, 0].set_title(\"Input image\")\n",
845
+ " ax[i, 1].set_title(\"Translated image\")\n",
846
+ " ax[i, 0].axis(\"off\")\n",
847
+ " ax[i, 1].axis(\"off\")\n",
848
+ "\n",
849
+ " prediction = keras.preprocessing.image.array_to_img(prediction)\n",
850
+ " prediction.save(\"predicted_img_{i}.png\".format(i=i))\n",
851
+ "plt.tight_layout()\n",
852
+ "plt.show()"
853
+ ]
854
+ },
855
+ {
856
+ "cell_type": "code",
857
+ "execution_count": null,
858
+ "metadata": {
859
+ "id": "dqGvqRtn3FCK"
860
+ },
861
+ "outputs": [],
862
+ "source": [
863
+ "%%capture\n",
864
+ "!pip install huggingface-hub\n",
865
+ "!sudo apt-get install git-lfs\n",
866
+ "!git-lfs install"
867
+ ]
868
+ },
869
+ {
870
+ "cell_type": "code",
871
+ "execution_count": null,
872
+ "metadata": {
873
+ "id": "dGDIa_LR0tMe",
874
+ "colab": {
875
+ "base_uri": "https://localhost:8080/"
876
+ },
877
+ "outputId": "3fb3f53b-1834-45e7-9915-d14d83241565"
878
+ },
879
+ "outputs": [
880
+ {
881
+ "output_type": "stream",
882
+ "name": "stdout",
883
+ "text": [
884
+ "\n",
885
+ " _| _| _| _| _|_|_| _|_|_| _|_|_| _| _| _|_|_| _|_|_|_| _|_| _|_|_| _|_|_|_|\n",
886
+ " _| _| _| _| _| _| _| _|_| _| _| _| _| _| _| _|\n",
887
+ " _|_|_|_| _| _| _| _|_| _| _|_| _| _| _| _| _| _|_| _|_|_| _|_|_|_| _| _|_|_|\n",
888
+ " _| _| _| _| _| _| _| _| _| _| _|_| _| _| _| _| _| _| _|\n",
889
+ " _| _| _|_| _|_|_| _|_|_| _|_|_| _| _| _|_|_| _| _| _| _|_|_| _|_|_|_|\n",
890
+ "\n",
891
+ " To login, `huggingface_hub` now requires a token generated from https://huggingface.co/settings/token.\n",
892
+ " (Deprecated, will be removed in v0.3.0) To login with username and password instead, interrupt with Ctrl+C.\n",
893
+ " \n",
894
+ "Token: \n",
895
+ "Login successful\n",
896
+ "Your token has been saved to /root/.huggingface/token\n",
897
+ "\u001b[1m\u001b[31mAuthenticated through git-credential store but this isn't the helper defined on your machine.\n",
898
+ "You might have to re-authenticate when pushing to the Hugging Face Hub. Run the following command in your terminal in case you want to set this credential helper as the default\n",
899
+ "\n",
900
+ "git config --global credential.helper store\u001b[0m\n"
901
+ ]
902
+ }
903
+ ],
904
+ "source": [
905
+ "!huggingface-cli login"
906
+ ]
907
+ },
908
+ {
909
+ "cell_type": "code",
910
+ "source": [
911
+ "from huggingface_hub.keras_mixin import push_to_hub_keras\n",
912
+ "push_to_hub_keras(model = cycle_gan_model.gen_G, repo_url = \"https://huggingface.co/keras-io/CycleGAN\", organization = \"keras-io\")"
913
+ ],
914
+ "metadata": {
915
+ "colab": {
916
+ "base_uri": "https://localhost:8080/",
917
+ "height": 392,
918
+ "referenced_widgets": [
919
+ "9f66f2bc1fb84f53b2c326b515daa96f",
920
+ "4b348f6741934ab6b88ad5e886a82434",
921
+ "2c3728bab3284ee395e46c1d22e2ac7d",
922
+ "77ed1e6d34f5418fad61533c421aed45",
923
+ "b29512c9852440af8becf8d6864a163d",
924
+ "0a775f600f814d2c8b50ee5e329cc3dd",
925
+ "bec9223c3e21469187d5746a54fd8c00",
926
+ "6c4ce2edb90346ebaf8ceb9d214f8fcd",
927
+ "f2681a3f49674709828d886bc4369a00",
928
+ "48874b08b0e544bab61728cc706c1a77",
929
+ "68dafbdb04584e31bfa5781c19305f60",
930
+ "6a7cd029c1aa40608cc9d1a05e7d81e1",
931
+ "45cdd8e8b1d5481983054e6882d02681",
932
+ "f992b2e503ba461883ba92754f32c243",
933
+ "7c6d35b412564fa0aa57589e7a275f94",
934
+ "cd21fb3fe0804a2ab93afa9ff0006b31",
935
+ "b10d2fc6597f4264a6be63cf44293b30",
936
+ "68faaabe6b434d11801f2a5020471535",
937
+ "f569a72bcb1d4a26904e0cdccc48f710",
938
+ "ce2bb30406be4dcc8a0ff75cc133e520",
939
+ "077a56dbea0147aca3f30345474dbcd4",
940
+ "58a2ad54a42943faa8dbc4eeaf511791",
941
+ "9e8f7edd06c14ff785d0fa8913817164",
942
+ "5669cfef918f4bb886cb8326b76750c3",
943
+ "358b5b20b965421b958ef8b8b9ce8ffd",
944
+ "27c9ac578d6047cd83910befa69939ae",
945
+ "43e4512b87104f9b965cebcb3b52d1fe",
946
+ "281d15cdd58243389661e4ecc12b3379",
947
+ "d9aae11f4cd34b56ab92ebb379b86db0",
948
+ "e602268e25884e0c8ef24c7f7e55b10e",
949
+ "60bbe43fe4334d5aa81f0d3204245edc",
950
+ "ba2a44729ca94e7d9c0b7acb43417e36",
951
+ "66b4845f1cb64ba28eb49ea7b7f5bad1"
952
+ ]
953
+ },
954
+ "id": "VSuvZe2bCzRZ",
955
+ "outputId": "623a7592-2f61-40af-9746-a301d18042b8"
956
+ },
957
+ "execution_count": null,
958
+ "outputs": [
959
+ {
960
+ "output_type": "stream",
961
+ "name": "stderr",
962
+ "text": [
963
+ "Cloning https://huggingface.co/keras-io/CycleGAN into local empty directory.\n",
964
+ "WARNING:huggingface_hub.repository:Cloning https://huggingface.co/keras-io/CycleGAN into local empty directory.\n"
965
+ ]
966
+ },
967
+ {
968
+ "output_type": "stream",
969
+ "name": "stdout",
970
+ "text": [
971
+ "WARNING:tensorflow:Compiled the loaded model, but the compiled metrics have yet to be built. `model.compile_metrics` will be empty until you train or evaluate the model.\n"
972
+ ]
973
+ },
974
+ {
975
+ "output_type": "stream",
976
+ "name": "stderr",
977
+ "text": [
978
+ "WARNING:tensorflow:Compiled the loaded model, but the compiled metrics have yet to be built. `model.compile_metrics` will be empty until you train or evaluate the model.\n",
979
+ "WARNING:absl:Function `_wrapped_model` contains input name(s) generator_G_img_input with unsupported characters which will be renamed to generator_g_img_input in the SavedModel.\n"
980
+ ]
981
+ },
982
+ {
983
+ "output_type": "stream",
984
+ "name": "stdout",
985
+ "text": [
986
+ "INFO:tensorflow:Assets written to: CycleGAN/assets\n"
987
+ ]
988
+ },
989
+ {
990
+ "output_type": "stream",
991
+ "name": "stderr",
992
+ "text": [
993
+ "INFO:tensorflow:Assets written to: CycleGAN/assets\n",
994
+ "Adding files tracked by Git LFS: ['variables/variables.data-00000-of-00001']. This may take a bit of time if the files are large.\n",
995
+ "WARNING:huggingface_hub.repository:Adding files tracked by Git LFS: ['variables/variables.data-00000-of-00001']. This may take a bit of time if the files are large.\n"
996
+ ]
997
+ },
998
+ {
999
+ "output_type": "display_data",
1000
+ "data": {
1001
+ "application/vnd.jupyter.widget-view+json": {
1002
+ "model_id": "9f66f2bc1fb84f53b2c326b515daa96f",
1003
+ "version_minor": 0,
1004
+ "version_major": 2
1005
+ },
1006
+ "text/plain": [
1007
+ "Upload file variables/variables.data-00000-of-00001: 0%| | 3.39k/43.5M [00:00<?, ?B/s]"
1008
+ ]
1009
+ },
1010
+ "metadata": {}
1011
+ },
1012
+ {
1013
+ "output_type": "display_data",
1014
+ "data": {
1015
+ "application/vnd.jupyter.widget-view+json": {
1016
+ "model_id": "6a7cd029c1aa40608cc9d1a05e7d81e1",
1017
+ "version_minor": 0,
1018
+ "version_major": 2
1019
+ },
1020
+ "text/plain": [
1021
+ "Upload file saved_model.pb: 0%| | 3.40k/1.51M [00:00<?, ?B/s]"
1022
+ ]
1023
+ },
1024
+ "metadata": {}
1025
+ },
1026
+ {
1027
+ "output_type": "display_data",
1028
+ "data": {
1029
+ "application/vnd.jupyter.widget-view+json": {
1030
+ "model_id": "9e8f7edd06c14ff785d0fa8913817164",
1031
+ "version_minor": 0,
1032
+ "version_major": 2
1033
+ },
1034
+ "text/plain": [
1035
+ "Upload file keras_metadata.pb: 3%|2 | 3.40k/115k [00:00<?, ?B/s]"
1036
+ ]
1037
+ },
1038
+ "metadata": {}
1039
+ },
1040
+ {
1041
+ "output_type": "stream",
1042
+ "name": "stderr",
1043
+ "text": [
1044
+ "To https://huggingface.co/keras-io/CycleGAN\n",
1045
+ " 39b9bac..0b34793 main -> main\n",
1046
+ "\n",
1047
+ "WARNING:huggingface_hub.repository:To https://huggingface.co/keras-io/CycleGAN\n",
1048
+ " 39b9bac..0b34793 main -> main\n",
1049
+ "\n"
1050
+ ]
1051
+ },
1052
+ {
1053
+ "output_type": "execute_result",
1054
+ "data": {
1055
+ "application/vnd.google.colaboratory.intrinsic+json": {
1056
+ "type": "string"
1057
+ },
1058
+ "text/plain": [
1059
+ "'https://huggingface.co/keras-io/CycleGAN/commit/0b34793d94f9a0cc57128b6195f6b6358c0c4eaf'"
1060
+ ]
1061
+ },
1062
+ "metadata": {},
1063
+ "execution_count": 19
1064
+ }
1065
+ ]
1066
+ },
1067
+ {
1068
+ "cell_type": "code",
1069
+ "source": [
1070
+ ""
1071
+ ],
1072
+ "metadata": {
1073
+ "id": "npl2kR1rDCgX"
1074
+ },
1075
+ "execution_count": null,
1076
+ "outputs": []
1077
+ }
1078
+ ],
1079
+ "metadata": {
1080
+ "accelerator": "GPU",
1081
+ "colab": {
1082
+ "collapsed_sections": [],
1083
+ "machine_shape": "hm",
1084
+ "name": "cyclegan",
1085
+ "provenance": [],
1086
+ "toc_visible": true
1087
+ },
1088
+ "kernelspec": {
1089
+ "display_name": "Python 3",
1090
+ "language": "python",
1091
+ "name": "python3"
1092
+ },
1093
+ "language_info": {
1094
+ "codemirror_mode": {
1095
+ "name": "ipython",
1096
+ "version": 3
1097
+ },
1098
+ "file_extension": ".py",
1099
+ "mimetype": "text/x-python",
1100
+ "name": "python",
1101
+ "nbconvert_exporter": "python",
1102
+ "pygments_lexer": "ipython3",
1103
+ "version": "3.7.0"
1104
+ },
1105
+ "widgets": {
1106
+ "application/vnd.jupyter.widget-state+json": {
1107
+ "9f66f2bc1fb84f53b2c326b515daa96f": {
1108
+ "model_module": "@jupyter-widgets/controls",
1109
+ "model_name": "HBoxModel",
1110
+ "model_module_version": "1.5.0",
1111
+ "state": {
1112
+ "_view_name": "HBoxView",
1113
+ "_dom_classes": [],
1114
+ "_model_name": "HBoxModel",
1115
+ "_view_module": "@jupyter-widgets/controls",
1116
+ "_model_module_version": "1.5.0",
1117
+ "_view_count": null,
1118
+ "_view_module_version": "1.5.0",
1119
+ "box_style": "",
1120
+ "layout": "IPY_MODEL_4b348f6741934ab6b88ad5e886a82434",
1121
+ "_model_module": "@jupyter-widgets/controls",
1122
+ "children": [
1123
+ "IPY_MODEL_2c3728bab3284ee395e46c1d22e2ac7d",
1124
+ "IPY_MODEL_77ed1e6d34f5418fad61533c421aed45",
1125
+ "IPY_MODEL_b29512c9852440af8becf8d6864a163d"
1126
+ ]
1127
+ }
1128
+ },
1129
+ "4b348f6741934ab6b88ad5e886a82434": {
1130
+ "model_module": "@jupyter-widgets/base",
1131
+ "model_name": "LayoutModel",
1132
+ "model_module_version": "1.2.0",
1133
+ "state": {
1134
+ "_view_name": "LayoutView",
1135
+ "grid_template_rows": null,
1136
+ "right": null,
1137
+ "justify_content": null,
1138
+ "_view_module": "@jupyter-widgets/base",
1139
+ "overflow": null,
1140
+ "_model_module_version": "1.2.0",
1141
+ "_view_count": null,
1142
+ "flex_flow": null,
1143
+ "width": null,
1144
+ "min_width": null,
1145
+ "border": null,
1146
+ "align_items": null,
1147
+ "bottom": null,
1148
+ "_model_module": "@jupyter-widgets/base",
1149
+ "top": null,
1150
+ "grid_column": null,
1151
+ "overflow_y": null,
1152
+ "overflow_x": null,
1153
+ "grid_auto_flow": null,
1154
+ "grid_area": null,
1155
+ "grid_template_columns": null,
1156
+ "flex": null,
1157
+ "_model_name": "LayoutModel",
1158
+ "justify_items": null,
1159
+ "grid_row": null,
1160
+ "max_height": null,
1161
+ "align_content": null,
1162
+ "visibility": null,
1163
+ "align_self": null,
1164
+ "height": null,
1165
+ "min_height": null,
1166
+ "padding": null,
1167
+ "grid_auto_rows": null,
1168
+ "grid_gap": null,
1169
+ "max_width": null,
1170
+ "order": null,
1171
+ "_view_module_version": "1.2.0",
1172
+ "grid_template_areas": null,
1173
+ "object_position": null,
1174
+ "object_fit": null,
1175
+ "grid_auto_columns": null,
1176
+ "margin": null,
1177
+ "display": null,
1178
+ "left": null
1179
+ }
1180
+ },
1181
+ "2c3728bab3284ee395e46c1d22e2ac7d": {
1182
+ "model_module": "@jupyter-widgets/controls",
1183
+ "model_name": "HTMLModel",
1184
+ "model_module_version": "1.5.0",
1185
+ "state": {
1186
+ "_view_name": "HTMLView",
1187
+ "style": "IPY_MODEL_0a775f600f814d2c8b50ee5e329cc3dd",
1188
+ "_dom_classes": [],
1189
+ "description": "",
1190
+ "_model_name": "HTMLModel",
1191
+ "placeholder": "​",
1192
+ "_view_module": "@jupyter-widgets/controls",
1193
+ "_model_module_version": "1.5.0",
1194
+ "value": "Upload file variables/variables.data-00000-of-00001: 100%",
1195
+ "_view_count": null,
1196
+ "_view_module_version": "1.5.0",
1197
+ "description_tooltip": null,
1198
+ "_model_module": "@jupyter-widgets/controls",
1199
+ "layout": "IPY_MODEL_bec9223c3e21469187d5746a54fd8c00"
1200
+ }
1201
+ },
1202
+ "77ed1e6d34f5418fad61533c421aed45": {
1203
+ "model_module": "@jupyter-widgets/controls",
1204
+ "model_name": "FloatProgressModel",
1205
+ "model_module_version": "1.5.0",
1206
+ "state": {
1207
+ "_view_name": "ProgressView",
1208
+ "style": "IPY_MODEL_6c4ce2edb90346ebaf8ceb9d214f8fcd",
1209
+ "_dom_classes": [],
1210
+ "description": "",
1211
+ "_model_name": "FloatProgressModel",
1212
+ "bar_style": "success",
1213
+ "max": 45592214,
1214
+ "_view_module": "@jupyter-widgets/controls",
1215
+ "_model_module_version": "1.5.0",
1216
+ "value": 45592214,
1217
+ "_view_count": null,
1218
+ "_view_module_version": "1.5.0",
1219
+ "orientation": "horizontal",
1220
+ "min": 0,
1221
+ "description_tooltip": null,
1222
+ "_model_module": "@jupyter-widgets/controls",
1223
+ "layout": "IPY_MODEL_f2681a3f49674709828d886bc4369a00"
1224
+ }
1225
+ },
1226
+ "b29512c9852440af8becf8d6864a163d": {
1227
+ "model_module": "@jupyter-widgets/controls",
1228
+ "model_name": "HTMLModel",
1229
+ "model_module_version": "1.5.0",
1230
+ "state": {
1231
+ "_view_name": "HTMLView",
1232
+ "style": "IPY_MODEL_48874b08b0e544bab61728cc706c1a77",
1233
+ "_dom_classes": [],
1234
+ "description": "",
1235
+ "_model_name": "HTMLModel",
1236
+ "placeholder": "​",
1237
+ "_view_module": "@jupyter-widgets/controls",
1238
+ "_model_module_version": "1.5.0",
1239
+ "value": " 43.5M/43.5M [00:33&lt;00:00, 1.24MB/s]",
1240
+ "_view_count": null,
1241
+ "_view_module_version": "1.5.0",
1242
+ "description_tooltip": null,
1243
+ "_model_module": "@jupyter-widgets/controls",
1244
+ "layout": "IPY_MODEL_68dafbdb04584e31bfa5781c19305f60"
1245
+ }
1246
+ },
1247
+ "0a775f600f814d2c8b50ee5e329cc3dd": {
1248
+ "model_module": "@jupyter-widgets/controls",
1249
+ "model_name": "DescriptionStyleModel",
1250
+ "model_module_version": "1.5.0",
1251
+ "state": {
1252
+ "_view_name": "StyleView",
1253
+ "_model_name": "DescriptionStyleModel",
1254
+ "description_width": "",
1255
+ "_view_module": "@jupyter-widgets/base",
1256
+ "_model_module_version": "1.5.0",
1257
+ "_view_count": null,
1258
+ "_view_module_version": "1.2.0",
1259
+ "_model_module": "@jupyter-widgets/controls"
1260
+ }
1261
+ },
1262
+ "bec9223c3e21469187d5746a54fd8c00": {
1263
+ "model_module": "@jupyter-widgets/base",
1264
+ "model_name": "LayoutModel",
1265
+ "model_module_version": "1.2.0",
1266
+ "state": {
1267
+ "_view_name": "LayoutView",
1268
+ "grid_template_rows": null,
1269
+ "right": null,
1270
+ "justify_content": null,
1271
+ "_view_module": "@jupyter-widgets/base",
1272
+ "overflow": null,
1273
+ "_model_module_version": "1.2.0",
1274
+ "_view_count": null,
1275
+ "flex_flow": null,
1276
+ "width": null,
1277
+ "min_width": null,
1278
+ "border": null,
1279
+ "align_items": null,
1280
+ "bottom": null,
1281
+ "_model_module": "@jupyter-widgets/base",
1282
+ "top": null,
1283
+ "grid_column": null,
1284
+ "overflow_y": null,
1285
+ "overflow_x": null,
1286
+ "grid_auto_flow": null,
1287
+ "grid_area": null,
1288
+ "grid_template_columns": null,
1289
+ "flex": null,
1290
+ "_model_name": "LayoutModel",
1291
+ "justify_items": null,
1292
+ "grid_row": null,
1293
+ "max_height": null,
1294
+ "align_content": null,
1295
+ "visibility": null,
1296
+ "align_self": null,
1297
+ "height": null,
1298
+ "min_height": null,
1299
+ "padding": null,
1300
+ "grid_auto_rows": null,
1301
+ "grid_gap": null,
1302
+ "max_width": null,
1303
+ "order": null,
1304
+ "_view_module_version": "1.2.0",
1305
+ "grid_template_areas": null,
1306
+ "object_position": null,
1307
+ "object_fit": null,
1308
+ "grid_auto_columns": null,
1309
+ "margin": null,
1310
+ "display": null,
1311
+ "left": null
1312
+ }
1313
+ },
1314
+ "6c4ce2edb90346ebaf8ceb9d214f8fcd": {
1315
+ "model_module": "@jupyter-widgets/controls",
1316
+ "model_name": "ProgressStyleModel",
1317
+ "model_module_version": "1.5.0",
1318
+ "state": {
1319
+ "_view_name": "StyleView",
1320
+ "_model_name": "ProgressStyleModel",
1321
+ "description_width": "",
1322
+ "_view_module": "@jupyter-widgets/base",
1323
+ "_model_module_version": "1.5.0",
1324
+ "_view_count": null,
1325
+ "_view_module_version": "1.2.0",
1326
+ "bar_color": null,
1327
+ "_model_module": "@jupyter-widgets/controls"
1328
+ }
1329
+ },
1330
+ "f2681a3f49674709828d886bc4369a00": {
1331
+ "model_module": "@jupyter-widgets/base",
1332
+ "model_name": "LayoutModel",
1333
+ "model_module_version": "1.2.0",
1334
+ "state": {
1335
+ "_view_name": "LayoutView",
1336
+ "grid_template_rows": null,
1337
+ "right": null,
1338
+ "justify_content": null,
1339
+ "_view_module": "@jupyter-widgets/base",
1340
+ "overflow": null,
1341
+ "_model_module_version": "1.2.0",
1342
+ "_view_count": null,
1343
+ "flex_flow": null,
1344
+ "width": null,
1345
+ "min_width": null,
1346
+ "border": null,
1347
+ "align_items": null,
1348
+ "bottom": null,
1349
+ "_model_module": "@jupyter-widgets/base",
1350
+ "top": null,
1351
+ "grid_column": null,
1352
+ "overflow_y": null,
1353
+ "overflow_x": null,
1354
+ "grid_auto_flow": null,
1355
+ "grid_area": null,
1356
+ "grid_template_columns": null,
1357
+ "flex": null,
1358
+ "_model_name": "LayoutModel",
1359
+ "justify_items": null,
1360
+ "grid_row": null,
1361
+ "max_height": null,
1362
+ "align_content": null,
1363
+ "visibility": null,
1364
+ "align_self": null,
1365
+ "height": null,
1366
+ "min_height": null,
1367
+ "padding": null,
1368
+ "grid_auto_rows": null,
1369
+ "grid_gap": null,
1370
+ "max_width": null,
1371
+ "order": null,
1372
+ "_view_module_version": "1.2.0",
1373
+ "grid_template_areas": null,
1374
+ "object_position": null,
1375
+ "object_fit": null,
1376
+ "grid_auto_columns": null,
1377
+ "margin": null,
1378
+ "display": null,
1379
+ "left": null
1380
+ }
1381
+ },
1382
+ "48874b08b0e544bab61728cc706c1a77": {
1383
+ "model_module": "@jupyter-widgets/controls",
1384
+ "model_name": "DescriptionStyleModel",
1385
+ "model_module_version": "1.5.0",
1386
+ "state": {
1387
+ "_view_name": "StyleView",
1388
+ "_model_name": "DescriptionStyleModel",
1389
+ "description_width": "",
1390
+ "_view_module": "@jupyter-widgets/base",
1391
+ "_model_module_version": "1.5.0",
1392
+ "_view_count": null,
1393
+ "_view_module_version": "1.2.0",
1394
+ "_model_module": "@jupyter-widgets/controls"
1395
+ }
1396
+ },
1397
+ "68dafbdb04584e31bfa5781c19305f60": {
1398
+ "model_module": "@jupyter-widgets/base",
1399
+ "model_name": "LayoutModel",
1400
+ "model_module_version": "1.2.0",
1401
+ "state": {
1402
+ "_view_name": "LayoutView",
1403
+ "grid_template_rows": null,
1404
+ "right": null,
1405
+ "justify_content": null,
1406
+ "_view_module": "@jupyter-widgets/base",
1407
+ "overflow": null,
1408
+ "_model_module_version": "1.2.0",
1409
+ "_view_count": null,
1410
+ "flex_flow": null,
1411
+ "width": null,
1412
+ "min_width": null,
1413
+ "border": null,
1414
+ "align_items": null,
1415
+ "bottom": null,
1416
+ "_model_module": "@jupyter-widgets/base",
1417
+ "top": null,
1418
+ "grid_column": null,
1419
+ "overflow_y": null,
1420
+ "overflow_x": null,
1421
+ "grid_auto_flow": null,
1422
+ "grid_area": null,
1423
+ "grid_template_columns": null,
1424
+ "flex": null,
1425
+ "_model_name": "LayoutModel",
1426
+ "justify_items": null,
1427
+ "grid_row": null,
1428
+ "max_height": null,
1429
+ "align_content": null,
1430
+ "visibility": null,
1431
+ "align_self": null,
1432
+ "height": null,
1433
+ "min_height": null,
1434
+ "padding": null,
1435
+ "grid_auto_rows": null,
1436
+ "grid_gap": null,
1437
+ "max_width": null,
1438
+ "order": null,
1439
+ "_view_module_version": "1.2.0",
1440
+ "grid_template_areas": null,
1441
+ "object_position": null,
1442
+ "object_fit": null,
1443
+ "grid_auto_columns": null,
1444
+ "margin": null,
1445
+ "display": null,
1446
+ "left": null
1447
+ }
1448
+ },
1449
+ "6a7cd029c1aa40608cc9d1a05e7d81e1": {
1450
+ "model_module": "@jupyter-widgets/controls",
1451
+ "model_name": "HBoxModel",
1452
+ "model_module_version": "1.5.0",
1453
+ "state": {
1454
+ "_view_name": "HBoxView",
1455
+ "_dom_classes": [],
1456
+ "_model_name": "HBoxModel",
1457
+ "_view_module": "@jupyter-widgets/controls",
1458
+ "_model_module_version": "1.5.0",
1459
+ "_view_count": null,
1460
+ "_view_module_version": "1.5.0",
1461
+ "box_style": "",
1462
+ "layout": "IPY_MODEL_45cdd8e8b1d5481983054e6882d02681",
1463
+ "_model_module": "@jupyter-widgets/controls",
1464
+ "children": [
1465
+ "IPY_MODEL_f992b2e503ba461883ba92754f32c243",
1466
+ "IPY_MODEL_7c6d35b412564fa0aa57589e7a275f94",
1467
+ "IPY_MODEL_cd21fb3fe0804a2ab93afa9ff0006b31"
1468
+ ]
1469
+ }
1470
+ },
1471
+ "45cdd8e8b1d5481983054e6882d02681": {
1472
+ "model_module": "@jupyter-widgets/base",
1473
+ "model_name": "LayoutModel",
1474
+ "model_module_version": "1.2.0",
1475
+ "state": {
1476
+ "_view_name": "LayoutView",
1477
+ "grid_template_rows": null,
1478
+ "right": null,
1479
+ "justify_content": null,
1480
+ "_view_module": "@jupyter-widgets/base",
1481
+ "overflow": null,
1482
+ "_model_module_version": "1.2.0",
1483
+ "_view_count": null,
1484
+ "flex_flow": null,
1485
+ "width": null,
1486
+ "min_width": null,
1487
+ "border": null,
1488
+ "align_items": null,
1489
+ "bottom": null,
1490
+ "_model_module": "@jupyter-widgets/base",
1491
+ "top": null,
1492
+ "grid_column": null,
1493
+ "overflow_y": null,
1494
+ "overflow_x": null,
1495
+ "grid_auto_flow": null,
1496
+ "grid_area": null,
1497
+ "grid_template_columns": null,
1498
+ "flex": null,
1499
+ "_model_name": "LayoutModel",
1500
+ "justify_items": null,
1501
+ "grid_row": null,
1502
+ "max_height": null,
1503
+ "align_content": null,
1504
+ "visibility": null,
1505
+ "align_self": null,
1506
+ "height": null,
1507
+ "min_height": null,
1508
+ "padding": null,
1509
+ "grid_auto_rows": null,
1510
+ "grid_gap": null,
1511
+ "max_width": null,
1512
+ "order": null,
1513
+ "_view_module_version": "1.2.0",
1514
+ "grid_template_areas": null,
1515
+ "object_position": null,
1516
+ "object_fit": null,
1517
+ "grid_auto_columns": null,
1518
+ "margin": null,
1519
+ "display": null,
1520
+ "left": null
1521
+ }
1522
+ },
1523
+ "f992b2e503ba461883ba92754f32c243": {
1524
+ "model_module": "@jupyter-widgets/controls",
1525
+ "model_name": "HTMLModel",
1526
+ "model_module_version": "1.5.0",
1527
+ "state": {
1528
+ "_view_name": "HTMLView",
1529
+ "style": "IPY_MODEL_b10d2fc6597f4264a6be63cf44293b30",
1530
+ "_dom_classes": [],
1531
+ "description": "",
1532
+ "_model_name": "HTMLModel",
1533
+ "placeholder": "​",
1534
+ "_view_module": "@jupyter-widgets/controls",
1535
+ "_model_module_version": "1.5.0",
1536
+ "value": "Upload file saved_model.pb: 100%",
1537
+ "_view_count": null,
1538
+ "_view_module_version": "1.5.0",
1539
+ "description_tooltip": null,
1540
+ "_model_module": "@jupyter-widgets/controls",
1541
+ "layout": "IPY_MODEL_68faaabe6b434d11801f2a5020471535"
1542
+ }
1543
+ },
1544
+ "7c6d35b412564fa0aa57589e7a275f94": {
1545
+ "model_module": "@jupyter-widgets/controls",
1546
+ "model_name": "FloatProgressModel",
1547
+ "model_module_version": "1.5.0",
1548
+ "state": {
1549
+ "_view_name": "ProgressView",
1550
+ "style": "IPY_MODEL_f569a72bcb1d4a26904e0cdccc48f710",
1551
+ "_dom_classes": [],
1552
+ "description": "",
1553
+ "_model_name": "FloatProgressModel",
1554
+ "bar_style": "success",
1555
+ "max": 1580532,
1556
+ "_view_module": "@jupyter-widgets/controls",
1557
+ "_model_module_version": "1.5.0",
1558
+ "value": 1580532,
1559
+ "_view_count": null,
1560
+ "_view_module_version": "1.5.0",
1561
+ "orientation": "horizontal",
1562
+ "min": 0,
1563
+ "description_tooltip": null,
1564
+ "_model_module": "@jupyter-widgets/controls",
1565
+ "layout": "IPY_MODEL_ce2bb30406be4dcc8a0ff75cc133e520"
1566
+ }
1567
+ },
1568
+ "cd21fb3fe0804a2ab93afa9ff0006b31": {
1569
+ "model_module": "@jupyter-widgets/controls",
1570
+ "model_name": "HTMLModel",
1571
+ "model_module_version": "1.5.0",
1572
+ "state": {
1573
+ "_view_name": "HTMLView",
1574
+ "style": "IPY_MODEL_077a56dbea0147aca3f30345474dbcd4",
1575
+ "_dom_classes": [],
1576
+ "description": "",
1577
+ "_model_name": "HTMLModel",
1578
+ "placeholder": "​",
1579
+ "_view_module": "@jupyter-widgets/controls",
1580
+ "_model_module_version": "1.5.0",
1581
+ "value": " 1.51M/1.51M [00:33&lt;00:00, 33.1kB/s]",
1582
+ "_view_count": null,
1583
+ "_view_module_version": "1.5.0",
1584
+ "description_tooltip": null,
1585
+ "_model_module": "@jupyter-widgets/controls",
1586
+ "layout": "IPY_MODEL_58a2ad54a42943faa8dbc4eeaf511791"
1587
+ }
1588
+ },
1589
+ "b10d2fc6597f4264a6be63cf44293b30": {
1590
+ "model_module": "@jupyter-widgets/controls",
1591
+ "model_name": "DescriptionStyleModel",
1592
+ "model_module_version": "1.5.0",
1593
+ "state": {
1594
+ "_view_name": "StyleView",
1595
+ "_model_name": "DescriptionStyleModel",
1596
+ "description_width": "",
1597
+ "_view_module": "@jupyter-widgets/base",
1598
+ "_model_module_version": "1.5.0",
1599
+ "_view_count": null,
1600
+ "_view_module_version": "1.2.0",
1601
+ "_model_module": "@jupyter-widgets/controls"
1602
+ }
1603
+ },
1604
+ "68faaabe6b434d11801f2a5020471535": {
1605
+ "model_module": "@jupyter-widgets/base",
1606
+ "model_name": "LayoutModel",
1607
+ "model_module_version": "1.2.0",
1608
+ "state": {
1609
+ "_view_name": "LayoutView",
1610
+ "grid_template_rows": null,
1611
+ "right": null,
1612
+ "justify_content": null,
1613
+ "_view_module": "@jupyter-widgets/base",
1614
+ "overflow": null,
1615
+ "_model_module_version": "1.2.0",
1616
+ "_view_count": null,
1617
+ "flex_flow": null,
1618
+ "width": null,
1619
+ "min_width": null,
1620
+ "border": null,
1621
+ "align_items": null,
1622
+ "bottom": null,
1623
+ "_model_module": "@jupyter-widgets/base",
1624
+ "top": null,
1625
+ "grid_column": null,
1626
+ "overflow_y": null,
1627
+ "overflow_x": null,
1628
+ "grid_auto_flow": null,
1629
+ "grid_area": null,
1630
+ "grid_template_columns": null,
1631
+ "flex": null,
1632
+ "_model_name": "LayoutModel",
1633
+ "justify_items": null,
1634
+ "grid_row": null,
1635
+ "max_height": null,
1636
+ "align_content": null,
1637
+ "visibility": null,
1638
+ "align_self": null,
1639
+ "height": null,
1640
+ "min_height": null,
1641
+ "padding": null,
1642
+ "grid_auto_rows": null,
1643
+ "grid_gap": null,
1644
+ "max_width": null,
1645
+ "order": null,
1646
+ "_view_module_version": "1.2.0",
1647
+ "grid_template_areas": null,
1648
+ "object_position": null,
1649
+ "object_fit": null,
1650
+ "grid_auto_columns": null,
1651
+ "margin": null,
1652
+ "display": null,
1653
+ "left": null
1654
+ }
1655
+ },
1656
+ "f569a72bcb1d4a26904e0cdccc48f710": {
1657
+ "model_module": "@jupyter-widgets/controls",
1658
+ "model_name": "ProgressStyleModel",
1659
+ "model_module_version": "1.5.0",
1660
+ "state": {
1661
+ "_view_name": "StyleView",
1662
+ "_model_name": "ProgressStyleModel",
1663
+ "description_width": "",
1664
+ "_view_module": "@jupyter-widgets/base",
1665
+ "_model_module_version": "1.5.0",
1666
+ "_view_count": null,
1667
+ "_view_module_version": "1.2.0",
1668
+ "bar_color": null,
1669
+ "_model_module": "@jupyter-widgets/controls"
1670
+ }
1671
+ },
1672
+ "ce2bb30406be4dcc8a0ff75cc133e520": {
1673
+ "model_module": "@jupyter-widgets/base",
1674
+ "model_name": "LayoutModel",
1675
+ "model_module_version": "1.2.0",
1676
+ "state": {
1677
+ "_view_name": "LayoutView",
1678
+ "grid_template_rows": null,
1679
+ "right": null,
1680
+ "justify_content": null,
1681
+ "_view_module": "@jupyter-widgets/base",
1682
+ "overflow": null,
1683
+ "_model_module_version": "1.2.0",
1684
+ "_view_count": null,
1685
+ "flex_flow": null,
1686
+ "width": null,
1687
+ "min_width": null,
1688
+ "border": null,
1689
+ "align_items": null,
1690
+ "bottom": null,
1691
+ "_model_module": "@jupyter-widgets/base",
1692
+ "top": null,
1693
+ "grid_column": null,
1694
+ "overflow_y": null,
1695
+ "overflow_x": null,
1696
+ "grid_auto_flow": null,
1697
+ "grid_area": null,
1698
+ "grid_template_columns": null,
1699
+ "flex": null,
1700
+ "_model_name": "LayoutModel",
1701
+ "justify_items": null,
1702
+ "grid_row": null,
1703
+ "max_height": null,
1704
+ "align_content": null,
1705
+ "visibility": null,
1706
+ "align_self": null,
1707
+ "height": null,
1708
+ "min_height": null,
1709
+ "padding": null,
1710
+ "grid_auto_rows": null,
1711
+ "grid_gap": null,
1712
+ "max_width": null,
1713
+ "order": null,
1714
+ "_view_module_version": "1.2.0",
1715
+ "grid_template_areas": null,
1716
+ "object_position": null,
1717
+ "object_fit": null,
1718
+ "grid_auto_columns": null,
1719
+ "margin": null,
1720
+ "display": null,
1721
+ "left": null
1722
+ }
1723
+ },
1724
+ "077a56dbea0147aca3f30345474dbcd4": {
1725
+ "model_module": "@jupyter-widgets/controls",
1726
+ "model_name": "DescriptionStyleModel",
1727
+ "model_module_version": "1.5.0",
1728
+ "state": {
1729
+ "_view_name": "StyleView",
1730
+ "_model_name": "DescriptionStyleModel",
1731
+ "description_width": "",
1732
+ "_view_module": "@jupyter-widgets/base",
1733
+ "_model_module_version": "1.5.0",
1734
+ "_view_count": null,
1735
+ "_view_module_version": "1.2.0",
1736
+ "_model_module": "@jupyter-widgets/controls"
1737
+ }
1738
+ },
1739
+ "58a2ad54a42943faa8dbc4eeaf511791": {
1740
+ "model_module": "@jupyter-widgets/base",
1741
+ "model_name": "LayoutModel",
1742
+ "model_module_version": "1.2.0",
1743
+ "state": {
1744
+ "_view_name": "LayoutView",
1745
+ "grid_template_rows": null,
1746
+ "right": null,
1747
+ "justify_content": null,
1748
+ "_view_module": "@jupyter-widgets/base",
1749
+ "overflow": null,
1750
+ "_model_module_version": "1.2.0",
1751
+ "_view_count": null,
1752
+ "flex_flow": null,
1753
+ "width": null,
1754
+ "min_width": null,
1755
+ "border": null,
1756
+ "align_items": null,
1757
+ "bottom": null,
1758
+ "_model_module": "@jupyter-widgets/base",
1759
+ "top": null,
1760
+ "grid_column": null,
1761
+ "overflow_y": null,
1762
+ "overflow_x": null,
1763
+ "grid_auto_flow": null,
1764
+ "grid_area": null,
1765
+ "grid_template_columns": null,
1766
+ "flex": null,
1767
+ "_model_name": "LayoutModel",
1768
+ "justify_items": null,
1769
+ "grid_row": null,
1770
+ "max_height": null,
1771
+ "align_content": null,
1772
+ "visibility": null,
1773
+ "align_self": null,
1774
+ "height": null,
1775
+ "min_height": null,
1776
+ "padding": null,
1777
+ "grid_auto_rows": null,
1778
+ "grid_gap": null,
1779
+ "max_width": null,
1780
+ "order": null,
1781
+ "_view_module_version": "1.2.0",
1782
+ "grid_template_areas": null,
1783
+ "object_position": null,
1784
+ "object_fit": null,
1785
+ "grid_auto_columns": null,
1786
+ "margin": null,
1787
+ "display": null,
1788
+ "left": null
1789
+ }
1790
+ },
1791
+ "9e8f7edd06c14ff785d0fa8913817164": {
1792
+ "model_module": "@jupyter-widgets/controls",
1793
+ "model_name": "HBoxModel",
1794
+ "model_module_version": "1.5.0",
1795
+ "state": {
1796
+ "_view_name": "HBoxView",
1797
+ "_dom_classes": [],
1798
+ "_model_name": "HBoxModel",
1799
+ "_view_module": "@jupyter-widgets/controls",
1800
+ "_model_module_version": "1.5.0",
1801
+ "_view_count": null,
1802
+ "_view_module_version": "1.5.0",
1803
+ "box_style": "",
1804
+ "layout": "IPY_MODEL_5669cfef918f4bb886cb8326b76750c3",
1805
+ "_model_module": "@jupyter-widgets/controls",
1806
+ "children": [
1807
+ "IPY_MODEL_358b5b20b965421b958ef8b8b9ce8ffd",
1808
+ "IPY_MODEL_27c9ac578d6047cd83910befa69939ae",
1809
+ "IPY_MODEL_43e4512b87104f9b965cebcb3b52d1fe"
1810
+ ]
1811
+ }
1812
+ },
1813
+ "5669cfef918f4bb886cb8326b76750c3": {
1814
+ "model_module": "@jupyter-widgets/base",
1815
+ "model_name": "LayoutModel",
1816
+ "model_module_version": "1.2.0",
1817
+ "state": {
1818
+ "_view_name": "LayoutView",
1819
+ "grid_template_rows": null,
1820
+ "right": null,
1821
+ "justify_content": null,
1822
+ "_view_module": "@jupyter-widgets/base",
1823
+ "overflow": null,
1824
+ "_model_module_version": "1.2.0",
1825
+ "_view_count": null,
1826
+ "flex_flow": null,
1827
+ "width": null,
1828
+ "min_width": null,
1829
+ "border": null,
1830
+ "align_items": null,
1831
+ "bottom": null,
1832
+ "_model_module": "@jupyter-widgets/base",
1833
+ "top": null,
1834
+ "grid_column": null,
1835
+ "overflow_y": null,
1836
+ "overflow_x": null,
1837
+ "grid_auto_flow": null,
1838
+ "grid_area": null,
1839
+ "grid_template_columns": null,
1840
+ "flex": null,
1841
+ "_model_name": "LayoutModel",
1842
+ "justify_items": null,
1843
+ "grid_row": null,
1844
+ "max_height": null,
1845
+ "align_content": null,
1846
+ "visibility": null,
1847
+ "align_self": null,
1848
+ "height": null,
1849
+ "min_height": null,
1850
+ "padding": null,
1851
+ "grid_auto_rows": null,
1852
+ "grid_gap": null,
1853
+ "max_width": null,
1854
+ "order": null,
1855
+ "_view_module_version": "1.2.0",
1856
+ "grid_template_areas": null,
1857
+ "object_position": null,
1858
+ "object_fit": null,
1859
+ "grid_auto_columns": null,
1860
+ "margin": null,
1861
+ "display": null,
1862
+ "left": null
1863
+ }
1864
+ },
1865
+ "358b5b20b965421b958ef8b8b9ce8ffd": {
1866
+ "model_module": "@jupyter-widgets/controls",
1867
+ "model_name": "HTMLModel",
1868
+ "model_module_version": "1.5.0",
1869
+ "state": {
1870
+ "_view_name": "HTMLView",
1871
+ "style": "IPY_MODEL_281d15cdd58243389661e4ecc12b3379",
1872
+ "_dom_classes": [],
1873
+ "description": "",
1874
+ "_model_name": "HTMLModel",
1875
+ "placeholder": "​",
1876
+ "_view_module": "@jupyter-widgets/controls",
1877
+ "_model_module_version": "1.5.0",
1878
+ "value": "Upload file keras_metadata.pb: 100%",
1879
+ "_view_count": null,
1880
+ "_view_module_version": "1.5.0",
1881
+ "description_tooltip": null,
1882
+ "_model_module": "@jupyter-widgets/controls",
1883
+ "layout": "IPY_MODEL_d9aae11f4cd34b56ab92ebb379b86db0"
1884
+ }
1885
+ },
1886
+ "27c9ac578d6047cd83910befa69939ae": {
1887
+ "model_module": "@jupyter-widgets/controls",
1888
+ "model_name": "FloatProgressModel",
1889
+ "model_module_version": "1.5.0",
1890
+ "state": {
1891
+ "_view_name": "ProgressView",
1892
+ "style": "IPY_MODEL_e602268e25884e0c8ef24c7f7e55b10e",
1893
+ "_dom_classes": [],
1894
+ "description": "",
1895
+ "_model_name": "FloatProgressModel",
1896
+ "bar_style": "success",
1897
+ "max": 118258,
1898
+ "_view_module": "@jupyter-widgets/controls",
1899
+ "_model_module_version": "1.5.0",
1900
+ "value": 118258,
1901
+ "_view_count": null,
1902
+ "_view_module_version": "1.5.0",
1903
+ "orientation": "horizontal",
1904
+ "min": 0,
1905
+ "description_tooltip": null,
1906
+ "_model_module": "@jupyter-widgets/controls",
1907
+ "layout": "IPY_MODEL_60bbe43fe4334d5aa81f0d3204245edc"
1908
+ }
1909
+ },
1910
+ "43e4512b87104f9b965cebcb3b52d1fe": {
1911
+ "model_module": "@jupyter-widgets/controls",
1912
+ "model_name": "HTMLModel",
1913
+ "model_module_version": "1.5.0",
1914
+ "state": {
1915
+ "_view_name": "HTMLView",
1916
+ "style": "IPY_MODEL_ba2a44729ca94e7d9c0b7acb43417e36",
1917
+ "_dom_classes": [],
1918
+ "description": "",
1919
+ "_model_name": "HTMLModel",
1920
+ "placeholder": "​",
1921
+ "_view_module": "@jupyter-widgets/controls",
1922
+ "_model_module_version": "1.5.0",
1923
+ "value": " 115k/115k [00:33&lt;00:00, 3.08kB/s]",
1924
+ "_view_count": null,
1925
+ "_view_module_version": "1.5.0",
1926
+ "description_tooltip": null,
1927
+ "_model_module": "@jupyter-widgets/controls",
1928
+ "layout": "IPY_MODEL_66b4845f1cb64ba28eb49ea7b7f5bad1"
1929
+ }
1930
+ },
1931
+ "281d15cdd58243389661e4ecc12b3379": {
1932
+ "model_module": "@jupyter-widgets/controls",
1933
+ "model_name": "DescriptionStyleModel",
1934
+ "model_module_version": "1.5.0",
1935
+ "state": {
1936
+ "_view_name": "StyleView",
1937
+ "_model_name": "DescriptionStyleModel",
1938
+ "description_width": "",
1939
+ "_view_module": "@jupyter-widgets/base",
1940
+ "_model_module_version": "1.5.0",
1941
+ "_view_count": null,
1942
+ "_view_module_version": "1.2.0",
1943
+ "_model_module": "@jupyter-widgets/controls"
1944
+ }
1945
+ },
1946
+ "d9aae11f4cd34b56ab92ebb379b86db0": {
1947
+ "model_module": "@jupyter-widgets/base",
1948
+ "model_name": "LayoutModel",
1949
+ "model_module_version": "1.2.0",
1950
+ "state": {
1951
+ "_view_name": "LayoutView",
1952
+ "grid_template_rows": null,
1953
+ "right": null,
1954
+ "justify_content": null,
1955
+ "_view_module": "@jupyter-widgets/base",
1956
+ "overflow": null,
1957
+ "_model_module_version": "1.2.0",
1958
+ "_view_count": null,
1959
+ "flex_flow": null,
1960
+ "width": null,
1961
+ "min_width": null,
1962
+ "border": null,
1963
+ "align_items": null,
1964
+ "bottom": null,
1965
+ "_model_module": "@jupyter-widgets/base",
1966
+ "top": null,
1967
+ "grid_column": null,
1968
+ "overflow_y": null,
1969
+ "overflow_x": null,
1970
+ "grid_auto_flow": null,
1971
+ "grid_area": null,
1972
+ "grid_template_columns": null,
1973
+ "flex": null,
1974
+ "_model_name": "LayoutModel",
1975
+ "justify_items": null,
1976
+ "grid_row": null,
1977
+ "max_height": null,
1978
+ "align_content": null,
1979
+ "visibility": null,
1980
+ "align_self": null,
1981
+ "height": null,
1982
+ "min_height": null,
1983
+ "padding": null,
1984
+ "grid_auto_rows": null,
1985
+ "grid_gap": null,
1986
+ "max_width": null,
1987
+ "order": null,
1988
+ "_view_module_version": "1.2.0",
1989
+ "grid_template_areas": null,
1990
+ "object_position": null,
1991
+ "object_fit": null,
1992
+ "grid_auto_columns": null,
1993
+ "margin": null,
1994
+ "display": null,
1995
+ "left": null
1996
+ }
1997
+ },
1998
+ "e602268e25884e0c8ef24c7f7e55b10e": {
1999
+ "model_module": "@jupyter-widgets/controls",
2000
+ "model_name": "ProgressStyleModel",
2001
+ "model_module_version": "1.5.0",
2002
+ "state": {
2003
+ "_view_name": "StyleView",
2004
+ "_model_name": "ProgressStyleModel",
2005
+ "description_width": "",
2006
+ "_view_module": "@jupyter-widgets/base",
2007
+ "_model_module_version": "1.5.0",
2008
+ "_view_count": null,
2009
+ "_view_module_version": "1.2.0",
2010
+ "bar_color": null,
2011
+ "_model_module": "@jupyter-widgets/controls"
2012
+ }
2013
+ },
2014
+ "60bbe43fe4334d5aa81f0d3204245edc": {
2015
+ "model_module": "@jupyter-widgets/base",
2016
+ "model_name": "LayoutModel",
2017
+ "model_module_version": "1.2.0",
2018
+ "state": {
2019
+ "_view_name": "LayoutView",
2020
+ "grid_template_rows": null,
2021
+ "right": null,
2022
+ "justify_content": null,
2023
+ "_view_module": "@jupyter-widgets/base",
2024
+ "overflow": null,
2025
+ "_model_module_version": "1.2.0",
2026
+ "_view_count": null,
2027
+ "flex_flow": null,
2028
+ "width": null,
2029
+ "min_width": null,
2030
+ "border": null,
2031
+ "align_items": null,
2032
+ "bottom": null,
2033
+ "_model_module": "@jupyter-widgets/base",
2034
+ "top": null,
2035
+ "grid_column": null,
2036
+ "overflow_y": null,
2037
+ "overflow_x": null,
2038
+ "grid_auto_flow": null,
2039
+ "grid_area": null,
2040
+ "grid_template_columns": null,
2041
+ "flex": null,
2042
+ "_model_name": "LayoutModel",
2043
+ "justify_items": null,
2044
+ "grid_row": null,
2045
+ "max_height": null,
2046
+ "align_content": null,
2047
+ "visibility": null,
2048
+ "align_self": null,
2049
+ "height": null,
2050
+ "min_height": null,
2051
+ "padding": null,
2052
+ "grid_auto_rows": null,
2053
+ "grid_gap": null,
2054
+ "max_width": null,
2055
+ "order": null,
2056
+ "_view_module_version": "1.2.0",
2057
+ "grid_template_areas": null,
2058
+ "object_position": null,
2059
+ "object_fit": null,
2060
+ "grid_auto_columns": null,
2061
+ "margin": null,
2062
+ "display": null,
2063
+ "left": null
2064
+ }
2065
+ },
2066
+ "ba2a44729ca94e7d9c0b7acb43417e36": {
2067
+ "model_module": "@jupyter-widgets/controls",
2068
+ "model_name": "DescriptionStyleModel",
2069
+ "model_module_version": "1.5.0",
2070
+ "state": {
2071
+ "_view_name": "StyleView",
2072
+ "_model_name": "DescriptionStyleModel",
2073
+ "description_width": "",
2074
+ "_view_module": "@jupyter-widgets/base",
2075
+ "_model_module_version": "1.5.0",
2076
+ "_view_count": null,
2077
+ "_view_module_version": "1.2.0",
2078
+ "_model_module": "@jupyter-widgets/controls"
2079
+ }
2080
+ },
2081
+ "66b4845f1cb64ba28eb49ea7b7f5bad1": {
2082
+ "model_module": "@jupyter-widgets/base",
2083
+ "model_name": "LayoutModel",
2084
+ "model_module_version": "1.2.0",
2085
+ "state": {
2086
+ "_view_name": "LayoutView",
2087
+ "grid_template_rows": null,
2088
+ "right": null,
2089
+ "justify_content": null,
2090
+ "_view_module": "@jupyter-widgets/base",
2091
+ "overflow": null,
2092
+ "_model_module_version": "1.2.0",
2093
+ "_view_count": null,
2094
+ "flex_flow": null,
2095
+ "width": null,
2096
+ "min_width": null,
2097
+ "border": null,
2098
+ "align_items": null,
2099
+ "bottom": null,
2100
+ "_model_module": "@jupyter-widgets/base",
2101
+ "top": null,
2102
+ "grid_column": null,
2103
+ "overflow_y": null,
2104
+ "overflow_x": null,
2105
+ "grid_auto_flow": null,
2106
+ "grid_area": null,
2107
+ "grid_template_columns": null,
2108
+ "flex": null,
2109
+ "_model_name": "LayoutModel",
2110
+ "justify_items": null,
2111
+ "grid_row": null,
2112
+ "max_height": null,
2113
+ "align_content": null,
2114
+ "visibility": null,
2115
+ "align_self": null,
2116
+ "height": null,
2117
+ "min_height": null,
2118
+ "padding": null,
2119
+ "grid_auto_rows": null,
2120
+ "grid_gap": null,
2121
+ "max_width": null,
2122
+ "order": null,
2123
+ "_view_module_version": "1.2.0",
2124
+ "grid_template_areas": null,
2125
+ "object_position": null,
2126
+ "object_fit": null,
2127
+ "grid_auto_columns": null,
2128
+ "margin": null,
2129
+ "display": null,
2130
+ "left": null
2131
+ }
2132
+ }
2133
+ }
2134
+ }
2135
+ },
2136
+ "nbformat": 4,
2137
+ "nbformat_minor": 0
2138
+ }