Skip to content

Commit

Permalink
added one more result
Browse files Browse the repository at this point in the history
  • Loading branch information
braindotai committed Dec 1, 2020
1 parent 161f6a4 commit c415f98
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 8 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,22 @@ I'm simply using MS Paint for that. And per image, it hardly takes 1 minute to d

Here are some sample overlays...

![Overlay example](outputs/watermark-unavailable/overlays/overlay0.png)

![Overlay example](outputs/watermark-unavailable/overlays/overlay1.png)

![Overlay example](outputs/watermark-unavailable/overlays/overlay2.png)

## # Time for the results

A sample progress of the generator:

![Progress](outputs/watermark-unavailable/progress.gif)

### Experiment 0

![Experiment result](outputs/watermark-unavailable/output0.png)

### Experiment 1

![Experiment result](outputs/watermark-unavailable/output1.png)
Expand Down
File renamed without changes
Binary file not shown.
Binary file not shown.
Binary file not shown.
15 changes: 7 additions & 8 deletions notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@
},
"source": [
"def pil_to_np_array(pil_image):\n",
" ar = np.array(pil_image)\n",
" ar = ar.transpose(2,0,1)\n",
" return ar.astype(np.float32) / 255.\n",
" array = np.array(pil_image).transpose(2,0,1)\n",
" return array.astype(np.float32) / 255.\n",
"\n",
"def np_to_torch_array(np_array):\n",
" return torch.from_numpy(np_array)[None, :]\n",
Expand All @@ -58,7 +57,7 @@
"\n",
"def save_image(np_array, step):\n",
" pil_image = Image.fromarray((np_array * 255.0).transpose(1, 2, 0).astype('uint8'), 'RGB')\n",
" pil_image.save(f'progress-with-watermark/{str(step).zfill(len(str(TRAINING_STEPS)))}.png')\n",
" pil_image.save(f'progress/{str(step).zfill(len(str(TRAINING_STEPS)))}.png')\n",
"\n",
"def get_image_grid(images, nrow = 3):\n",
" torch_images = [torch.from_numpy(x) for x in images]\n",
Expand Down Expand Up @@ -248,7 +247,7 @@
" def forward(self, x):\n",
" return self.model(x)\n",
"\n",
"def input_noise(input_depth, spatial_size, scale = 1./10):\n",
"def input_noise(input_depth, spatial_size, scale = 1.0/10):\n",
" shape = [1, input_depth, spatial_size[0], spatial_size[1]]\n",
" return torch.rand(*shape) * scale"
],
Expand Down Expand Up @@ -294,9 +293,9 @@
"tags": []
},
"source": [
"if os.path.isdir('progress-with-watermark'):\n",
" rmtree('progress-with-watermark')\n",
"os.mkdir('progress-with-watermark')\n",
"if os.path.isdir('progress'):\n",
" rmtree('progress')\n",
"os.mkdir('progress')\n",
"\n",
"for step in range(TRAINING_STEPS):\n",
" optimizer.zero_grad()\n",
Expand Down
Binary file added outputs/watermark-unavailable/output0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added outputs/watermark-unavailable/progress.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c415f98

Please sign in to comment.