Skip to content

Latest commit

 

History

History
66 lines (45 loc) · 2.3 KB

File metadata and controls

66 lines (45 loc) · 2.3 KB

Multi-to-One Style Transfer: Region-Based Styles Assignment for Single Content Image

Introduction

Multi-to-One Style Transfer is a novel style transfer method, aiming to assemble various styles like puzzle pieces to construct a stylized image 🎨

Requirements

  • Python 3.8 or later
  • Conda

Usage

  1. Clone this repository:

    git clone https://github.com/Charles-T-T/M2O_StyleTransfer.git
  2. Create and activate the Conda environment:

    conda env create -f environment.yml
    conda activate StyleTransfer
  3. Run the M2O_ST.py :

    python M2O_ST.py

    You can choose your own style images and content images by adding arguments like this:

    python M2O_ST.py --style_paths path/to/style1 path/to/style2 --content_path path/to/content

    Run python M2O_ST.py --help to see all arguments:

    usage: M2O_ST.py [-h] [--style_paths STYLE_PATHS [STYLE_PATHS ...]] [--content_path CONTENT_PATH] [--save_dir SAVE_DIR] [--n_epoch N_EPOCH]
    
    Multi-to-One Style Transfer
    
    optional arguments:
      -h, --help            show this help message and exit
      --style_paths STYLE_PATHS [STYLE_PATHS ...]
                            Paths to style images (provide multiple paths separated by space)
      --content_path CONTENT_PATH
                            Path to the content image
      --save_dir SAVE_DIR   Directory to save the result image
      --n_epoch N_EPOCH     Number of training epochs, default to 1000

Demo

Content Styles Result
chicago_0 Tsunami guernica ss

Acknowledgment

Thanks to Chenjun(a3377596@126.com) for key algorithm design and implementation.