tyui592 / uncorrelated_feature_encoding_for_faster_style_transfer

Unofficial Pytorch Implementation of 'Uncorrelated feature encoding for faster style transfer'

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uncorrelated feature encoding for faster style transfer

Unofficial Pytorch Implementation of 'Uncorrelated feature encoding for faster style transfer'

This repository implements the above paper based on vgg19. Please refer to scripts.sh for differences in details.

Usage

  • Requirements

    • torch (version: 1.13.0)
    • torchvision (version: 0.14.0)
    • wandb
  • Dataset

Result

Training Loss

training_loss (From the top left to the bottom right.) style loss, content loss, uncorrelation loss and number of nonzero channels from the feature map. More details: wandb link.

Correlation Matrix

Correlation matrix of the feature map extracted from the vgg encoder calculated by the test data. The feature map has 512 channels, and the matrix is normalized to the total number of images.

correlation_matrix

Stylization with channel pruning

The value of accumulating and sorting the absolute values of the channel vectors. channel_magnitude

The stylization result of the network pruning the channels in the above order of magnitude. pruning_stylization

The above results were calculated through the jupyter notebook.

Stylization Result

Content Style w/o Uncorrealtion Loss w/ Uncorrealtion Loss
image1 image2 image3 imag4
imag5 image6 image7 image8
image9 image10 image11 image12

About

Unofficial Pytorch Implementation of 'Uncorrelated feature encoding for faster style transfer'


Languages

Language:Jupyter Notebook 98.7%Language:Python 1.3%Language:Shell 0.1%