styler00dollar / Colab-PAMA

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PAMA

​ This is the Pytorch implementation of Progressive Attentional Manifold Alignment.

Requirements

  • python 3.6
  • pytorch 1.2.0+
  • PIL, numpy, matplotlib

Checkpoints

Please download the pre-trained checkpoints at google drive and put them in ./checkpoints.

Here we also provide some other pre-trained results with different loss weights:

Type Loss Download
high consistency w/o color loss PAMA_consistency.pth
high style 2x style loss PAMA_style.pth
high content 2x content loss PAMA_content.pth

The checkpionts will be uploaded recently.

Training

The training set consists of two parts, the content images from COCO2014 and style images from Wikiart.

python main.py train --lr 1e-4 --content_folder ./COCO2014 --style_folder ./Wikiart

Testing

To test the code, you need to specify the path of the content image and the style image.

python main.py eval --content ./content/1.jpg --style ./style/1.jpg

If you want to do a batch operation for all pictures under the folder at one time, please execute the following code.

python main.py eval --run_folder True --content ./content/ --style ./style/

Results Presentation

​ The results prove the quality of PAMA from three dimensions: Regional Consistency, Content Proservation, Style Quality.

Regional Consistency

39-13-content

8-35-content

Content preservation

18-4-content

27-8-consistency

Style Quality

4-29-style

13-32-style

Other Results

other

About


Languages

Language:Python 94.3%Language:Jupyter Notebook 5.7%