Multi-to-One Style Transfer is a novel style transfer method, aiming to assemble various styles like puzzle pieces to construct a stylized image 🎨
- Python 3.8 or later
- Conda
-
Clone this repository:
git clone https://github.com/Charles-T-T/M2O_StyleTransfer.git
-
Create and activate the Conda environment:
conda env create -f environment.yml conda activate StyleTransfer
-
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 --helpto 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
| Content | Styles | Result |
|---|---|---|
![]() |
![]() |
![]() |
Thanks to Chenjun(a3377596@126.com) for key algorithm design and implementation.



.png)