Practical overview
When it fits
Use it when you need source code and model assets for portrait-to-cartoon inference or want to study and adapt the project's documented training workflow.
Who it is for
- Developers building portrait-cartoonization or batch image-conversion tools.
- Practitioners who want to inspect or adapt an image-to-image translation model.
- Users preparing portrait and cartoon datasets for model training.
Documented uses
- Convert a portrait photo into a cartoon-style image using pretrained weights.
- Run the documented inference path with an ONNX model.
- Prepare portrait and cartoon image domains for training.
- Train a cartoonization model from prepared data, optionally initializing from provided weights.
Requirements & limits
The repository is public on GitHub and lists an MIT license. Local inference and training require the documented dependencies and model assets. The README also points to an online platform and a WeChat mini-program for trying cartoonization.
- The model is designed around cropped face portraits; its segmentation model is not intended for half-body images.
- The authors describe the released training data as focused on young Asian women and recommend collecting representative data for other intended populations.
- The repository documents both PyTorch and ONNX inference scripts, with separate model assets for each path.
- The authors distinguish the open-source model's results from their online service, citing differences in data, input resolution and face-feature extraction.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Run portrait-to-cartoon inference with the PyTorch model
Use the documented test script to save a cartoon-style result from a portrait photo.
Before you start
- Python 3.6, PyTorch 1.4, TensorFlow-GPU 1.14, face-alignment, dlib and onnxruntime, as listed by the README.
- The repository and required pretrained assets: photo2cartoon_weights.pt, seg_model_384.pb and model_mobilefacenet.pth.
- A test portrait photo.
Steps
Clone the repository and change into its directory.
Download the required model assets and place them in the README-specified models and utils directories.
Run the command below, replacing the input and output paths as needed.
python test.py --photo_path ./images/photo_test.jpg --save_path ./images/cartoon_result.png
Expected outcome
The script is configured to save a cartoon-style image at the specified output path.
Guide limitations
- The README's example uses a test photo; it does not establish results for every input.
- The released model was trained mainly on young Asian women, and its authors report more limited coverage for other groups.
- The portrait-segmentation model is intended for cropped face regions, not half-body images.
Prepare data and start a custom training run
Prepare portrait and cartoon image folders and launch the repository's documented training command.
Before you start
- Python 3.6 and the listed project dependencies.
- About 1,000 portrait photos is recommended; the project provides 204 processed cartoon images.
- Portrait and cartoon data prepared as separate training and test sets.
Steps
Prepare portrait photos and cartoon images, detecting faces and landmarks, aligning faces, cropping face regions and setting the background to white.
For portrait photos, run the command below.
python data_process.py --data_path YourPhotoFolderPath --save_path YourSaveFolderPathArrange processed photos in
trainAandtestA, and cartoon images intrainBandtestB, underdataset/photo2cartoon.Start training with the command below; to load the provided weights, use the command below.
python train.py --dataset photo2cartoonpython train.py --dataset photo2cartoon --pretrained_weights models/photo2cartoon_weights.pt
Expected outcome
The training script is started with the prepared photo and cartoon domains, optionally initialized from the provided weights.
Guide limitations
- The README recommends matching the portrait data to the cartoon data and notes the released model's limited demographic coverage.
- The documentation describes dataset preparation and training commands, not a guaranteed training result or model quality.
Compare options for Model inference and serving
These projects document a common task and share a project role. This is a source-based comparison, not an execution benchmark or a guarantee of interchangeability.
| Project | Documented purpose | Platform | Access and requirements |
|---|---|---|---|
| Photo2Cartoon | Convert a portrait photo into a cartoon-style image using pretrained weights. | Linux, macOS, Self-hosted, Windows | The repository is public on GitHub and lists an MIT license. Local inference and training require the documented dependencies and model assets. The README also points to an online platform and a WeChat mini-program for trying cartoonization. |
| FASHN VTON v1.5 | Generate a try-on preview from a person image and a garment image. | CLI, Linux, macOS, Self-hosted | The repository is public and states an Apache-2.0 license. Local setup requires downloading approximately 2 GB of model weights. |
| Posteromni | Rescale a poster to a target aspect ratio using a text prompt. |
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 16 October 2026
- Original website title
- minivision-ai/photo2cartoon · Official homepage title · retained in its source language

