Practical overview
When it fits
Use Cpm when you need a code-based workflow for transferring a reference makeup style to an image and want control over color and pattern transfer separately or together.
Who it is for
- Computer-vision researchers studying or reproducing makeup-transfer methods.
- Developers creating a makeup-transfer demo or image-processing workflow for portrait images.
Documented uses
- Transfer both color and pattern makeup from a reference style to an input image.
- Generate a color-only or pattern-only transfer result to examine each branch independently.
- Train or evaluate the color and pattern branches using prepared face texture maps.
Requirements & limits
The repository is public and specifies the BSD-3-Clause license. Its README links a Google Colab notebook. The provided datasets have separate research-or-educational-use terms and may not be redistributed.
- The framework combines a color branch based on BeautyGAN with a distinct pattern branch.
- The documented local environment specifies Python 3.7, PyTorch 1.6.0, TensorFlow-GPU 1.14 and segmentation_models_pytorch.
- Local use requires downloading CPM color and pattern weights and a PRNet pretrained model into specified folders.
- The repository includes four datasets, but their stated terms differ from the code license and restrict redistribution.
- The project requests citation when its datasets or model implementation contribute to published results or are incorporated into other software.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Set up Cpm and transfer makeup from reference images
Prepare the documented environment and use Cpm's example to generate a color-and-pattern transfer result.
Before you start
- Python 3.7
- PyTorch 1.6.0
- TensorFlow-GPU 1.14
- segmentation_models_pytorch
- Conda and the repository's environment.yml
Steps
Clone the repository and change into its directory.
Create the Conda environment with
conda env create -f environment.yml.Place color.pth and pattern.pth in the
checkpointsfolder and the PRNet model inPRNet/net-data.Run the documented
main.pyexample with--styleand--inputimage paths; use--color_onlyor--pattern_onlyto select one branch.
Expected outcome
The example is documented to save the transferred image as result.png.
Guide limitations
- The README specifies a GPU-oriented environment and CUDA device selection in its examples.
- The recipe describes the repository's documented setup and usage, not independently verified execution.
- The datasets have separate research-or-educational-use and redistribution restrictions.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 15 October 2026
- Original website title
- VinAIResearch/CPM · Official homepage title · retained in its source language

