OpenViSTAI · Agents · Blockchain · Crypto
Menu
Image & Video AI

Photo2Cartoon

Photo2Cartoon is an MIT-licensed Python image-translation project that converts cropped portrait photos into cartoon-style images. Its public repository includes inference scripts, pretrained model assets and instructions for preparing data and training a model.

Independent OpenViST project profile, based on linked sources.

Photo2Cartoon — OpenViST project profile in Image & Video AI.
OpenViST project illustration. See the linked sources for product details.
Understand the project

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.
Before you choose

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.

Source-based practical guide

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

  1. Clone the repository and change into its directory.

  2. Download the required model assets and place them in the README-specified models and utils directories.

  3. Run the command below, replacing the input and output paths as needed.

    Documented command
    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.
Source-based practical guide

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

  1. Prepare portrait photos and cartoon images, detecting faces and landmarks, aligning faces, cropping face regions and setting the background to white.

  2. For portrait photos, run the command below.

    Documented command
    python data_process.py --data_path YourPhotoFolderPath --save_path YourSaveFolderPath
  3. Arrange processed photos in trainA and testA, and cartoon images in trainB and testB, under dataset/photo2cartoon.

  4. Start training with the command below; to load the provided weights, use the command below.

    Documented command
    python train.py --dataset photo2cartoon
    Documented command
    python 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

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.

ProjectDocumented purposePlatformAccess and requirements
Photo2CartoonConvert a portrait photo into a cartoon-style image using pretrained weights.Linux, macOS, Self-hosted, WindowsThe 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.5Generate a try-on preview from a person image and a garment image.CLI, Linux, macOS, Self-hostedThe repository is public and states an Apache-2.0 license. Local setup requires downloading approximately 2 GB of model weights.
PosteromniRescale a poster to a target aspect ratio using a text prompt.
Evidence and transparency

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