In this blog post, we are going to adapt deepdream to “not dream too much” in some areas and thus create inceptionist profile pics.
Deep dreaming or Inceptionism is a funny by-product of deep-learning for computer vision. Some developers at Google recently invented the technique to visualize what’s going on inside a deep neural net. By forcing the net to iteratively adapt the input data to its own expectations, the input image is changed in strange and surrealist ways.
The resulting “dreams” have been all over the media, and are certainly exciting. But you can’t use the method that easily for creating profile pics, as after some iterations the original image will be entirely gone. To prevent this, we can adapt the code so that it never touches some parts of the image.
Let’s first mark an ellipse in the input image:
We can now customize the make_step function such that the specified ellipse mask is excluded from the updates. We also set the scale coefficient to 0, in order to avoid scaling our mask. However, this could be implemented easily.
We could even add more ellipses at different scales and adjust their “color”, in order to not get hard transitions between our masked area and the inceptionist “art”.
The resulting image might then look like this (original image; here I added two additional ellipses and set the transparency in the inner mask to 0.03):