Tensorflow implementation of paper - "Texture Synthesis Using Convolutional Neural Networks"
In this notebook, we'll generate new textures based on the given texture. The output will be generated from the scratch noisy image. The steps of the process is as follows. Also, the notebook is created to facilitate self-learning approach.
Step 1: Preprocessing the input image
Step 2: Computing the output for all the layers for the input image.
Step 3: What is loss function in this problem and computing the loss function.
Step 4: Running Tensorflow model to minimize the loss and optimize the input noise variable.
Step 5: Post processing and displaying the image.
Step 6: Automating the stuffs
Step 7: Plotting the successful results.
- helper.py - Used for pre-processing the image and post-processing the image
- tf_helper.py - Used to compute the layer wise output for a given texture sample image
- paper folder - contains the paper and its important cutouts
- tensorflow_vgg folder - contains the helper vgg16_avg_pool.py function to load the pre-trained weights ".npy" file
- image_resources/original - contrains original images as well as cropped in aspect ratio of 1:1 to use them
- image_resources/processed - contains down-sized images to be feed in to the CNN model
- image_resources/outputs - contains synthesised texture outputs for different texture input images
-
Paper link: https://arxiv.org/abs/1505.07376
-
VGG16 Tensorflow Model - https://github.com/machrisaa/tensorflow-vgg
Pre-trained VGG16 tensorflow model along with helper files. Big shoutout to the owner. Also, vgg16.npy can be downloaded from the link provided in this repository. I have modified the vgg16.py file to facilitate average pooling instead of max pooling.