In [1]:
import matplotlib.pyplot as plt
from PIL import Image

Part 1

Below are the images with l2 loss only on styleGAN, using z, w, w+ repectively. I found that using w+ space can achieve much smaller loss than w and z space, and the quality of generated images are much better. For different percetual loss weights, I don't see a significant difference in terms of the quality of generated results. It seems w+ space is the key factor for good image quality.

In [42]:
im1 = Image.open('./results/0_data.png')
# plt.subplots_adjust(wspace=1, hspace=None)
plt.figure(figsize=(15,15))

plt.subplot(4,4,1)
plt.title('original image')
plt.imshow(im1)

im1 = Image.open('./results/0_stylegan_z_0_5000.png')
plt.subplot(4,4,2)
plt.title('stylegan, perc weight 0, z space')
plt.imshow(im1)


im1 = Image.open('./results/0_stylegan_w_0_4500.png')
plt.subplot(4,4,3)
plt.title('stylegan, perc weight 0, w space')
plt.imshow(im1)

im1 = Image.open('./results/0_stylegan_w+_0_5000.png')
plt.subplot(4,4,4)
plt.title('stylegan, perc weight 0, w+ space')
plt.imshow(im1)

im1 = Image.open('./results/0_stylegan_z_1_5000.png')
plt.subplot(4,4,6)
plt.title('stylegan, perc weight 1, z space')
plt.imshow(im1)


im1 = Image.open('./results/0_stylegan_w_1_4500.png')
plt.subplot(4,4,7)
plt.title('stylegan, perc weight 1, w space')
plt.imshow(im1)

im1 = Image.open('./results/0_stylegan_w+_1_5000.png')
plt.subplot(4,4,8)
plt.title('stylegan, perc weight 1, w+ space')
plt.imshow(im1)


im1 = Image.open('./results/0_stylegan_z_3_4500.png')
plt.subplot(4,4,10)
plt.title('stylegan, perc weight 3, z space')
plt.imshow(im1)


im1 = Image.open('./results/0_stylegan_w_3_4250.png')
plt.subplot(4,4,11)
plt.title('stylegan, perc weight 3, w space')
plt.imshow(im1)

im1 = Image.open('./results/0_stylegan_w+_3_4500.png')
plt.subplot(4,4,12)
plt.title('stylegan, perc weight 3, w+ space')
plt.imshow(im1)
Out[42]:
<matplotlib.image.AxesImage at 0x176d065a790>

Below are the results using vanilla gan. We can see that the results are blurry and are much worse than the style gan results. It seems that the perception loss could help to generate a little bit more detail, but the overall quality is still bad.

In [31]:
im1 = Image.open('./results/0_data.png')
# plt.subplots_adjust(wspace=1, hspace=None)
plt.figure(figsize=(15,15))

plt.subplot(1,4,1)
plt.title('original image')
plt.imshow(im1)

#  vallina
im1 = Image.open('./results/0_vanilla_z_0_4750.png')
plt.subplot(1,4,2)
plt.title('vanilla, perc weight 0, z space')
plt.imshow(im1)


im1 = Image.open('./results/0_vanilla_z_1_4500.png')
plt.subplot(1,4,3)
plt.title('vanilla, perc weight 1, w space')
plt.imshow(im1)

im1 = Image.open('./results/0_vanilla_z_3_5000.png')
plt.subplot(1,4,4)
plt.title('vanilla, perc weight 3, w space')
plt.imshow(im1)
Out[31]:
<matplotlib.image.AxesImage at 0x176cf3ad3d0>

Part 2

Below are the interpolation results. It seems the background changes much faster than the cats' face. We can see that the cat's face's size & texture gradually changes from the source cat to the target cats, and the interpolated cats are also pretty realistic SegmentLocal SegmentLocal SegmentLocal

Part 3

The scribbles & generated images are shown below. I used perceptual loss along with the color constraint, and I set the perceptual loss weight to 2. Most generation results looks good to me. It seems that some small stroks will cause some unexpected effect on the generated images. For example, in the last scribble-image pair, I accidently put a red dot near the cat's ear in the scribble, and the generated image turned out to have a red background.

In [40]:
plt.figure(figsize=(15,15))
           
im1 = Image.open('./results/draw/0_data.png')
plt.subplot(4,4,1)
plt.title('scribble')
plt.imshow(im1)

#  vallina
im1 = Image.open('./results/draw/0_stylegan_w+.png')
plt.subplot(4,4,2)
plt.title('generated')
plt.imshow(im1)
           
im1 = Image.open('./results/draw/1_data.png')
plt.subplot(4,4,3)
plt.title('scribble')
plt.imshow(im1)

#  vallina
im1 = Image.open('./results/draw/1_stylegan_w+.png')
plt.subplot(4,4,4)
plt.title('generated')
plt.imshow(im1)

im1 = Image.open('./results/draw/2_data.png')
plt.subplot(4,4,5)
plt.title('scribble')
plt.imshow(im1)

#  vallina
im1 = Image.open('./results/draw/2_stylegan_w+.png')
plt.subplot(4,4,6)
plt.title('generated')
plt.imshow(im1)
           
im1 = Image.open('./results/draw/3_data.png')
plt.subplot(4,4,7)
plt.title('scribble')
plt.imshow(im1)

#  vallina
im1 = Image.open('./results/draw/3_stylegan_w+.png')
plt.subplot(4,4,8)
plt.title('generated')
plt.imshow(im1)

im1 = Image.open('./results/draw/4_data.png')
plt.subplot(4,4,9)
plt.title('scribble')
plt.imshow(im1)

#  vallina
im1 = Image.open('./results/draw/4_stylegan_w+.png')
plt.subplot(4,4,10)
plt.title('generated')
plt.imshow(im1)

im1 = Image.open('./results/my_0_data.png')
plt.subplot(4,4,11)
plt.title('scribble')
plt.imshow(im1)

#  vallina
im1 = Image.open('./results/my_0_stylegan_w+.png')
plt.subplot(4,4,12)
plt.title('generated')
plt.imshow(im1)
Out[40]:
<matplotlib.image.AxesImage at 0x176d298b940>