AnimeGANv3

TachibanaYoshino长期未更新

用 AnimeGANv3 把照片或视频一键转成日漫风格,支持 Colab、ONNX、CoreML、TFLite 等多种部署格式,方便直接产出动画作品。

Use AnimeGANv3 to make your own animation works, including turning photos or videos into anime.

v1.1.0发布于 2023-11-23 06:06 UTC2,050star268fork同步于 2026-11-07 07:30 UTC

怎么上手

由 README 提炼,执行前请确认
git clone https://github.com/TachibanaYoshino/AnimeGANv3.git
cd AnimeGANv3
pip install -r requirements.txt
python deploy/test_by_onnx.py -i inputs/imgs/ -o output/results -m deploy/AnimeGANv3_Hayao_36.onnx
硬件要求按 README 说明

README 未说明显存要求;提到 tiny 模型在 iPhone14 上 512*512 输入可达 50 FPS,并给出 TensorRT、rknn 推理分支,但未列出具体 GPU 型号。

支持 Apple Silicon
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

用 GAN 把照片和视频转成动漫风格,自带多种预训练 onnx 模型可直接推理

用 AnimeGANv3 把照片或视频一键转成日漫风格,支持 Colab、ONNX、CoreML、TFLite 等多种部署格式,方便直接产出动画作品。

核心能力

  • 提供照片转动漫的 onnx 推理脚本
  • 提供视频转动漫的 onnx 推理脚本
  • 覆盖吉卜力、新海诚、迪士尼等多种风格模型
  • 附带 UI 工具和官方在线 Demo
  • 提供 TensorRT 与 rknn 转换推理分支

容易踩的坑

推理需自行准备对应的 .onnx 模型文件,仓库不保证自带;部分风格模型和训练数据发布在 Patreon 等外部渠道;视频转动漫需另用 tools/video2anime.py 并指定模型路径。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

2 个版本v1.1.0
  1. v1.1.0The Hayao style and Shinkai style最新正式版2023-11-23 · 2023-11-23 06:06 UTC

    For the .tflite, its input shape is (1, 512, 512, 3). For the .mlmodel, its input is an image of 512*512 size.

  2. v1.0.3Hayao style and Shinkai style2023-11-23 · 2023-11-23 05:50 UTC
    查看更新说明

    old version

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    AnimeGANv3

    Paper Title: A Novel Double-Tail Generative Adversarial Network for Fast Photo Animation.

    Let's use AnimeGANv3 to produce our own animation.

    manuscript Paper Project Page HuggingFace Video twitter LICENSE Github Open In Colab Badge

    📢 Updates

    • 2025-08-22 Added a new AnimeGANv3 model for Face to Ghibli-c1 style. Its model files and training data have been open source. The training data of Ghibli-o1 style can be accessed here.
    • 2025-02-16 Released the TensorRT-based model conversion and inference repo.
    • 2024-12-15 Released the rknn-based model conversion and inference repo.
    • 2024-11-27 Disney and Trump styles updated to version 2.0.
    • 2024-10-31 Added a new styles of AnimeGANv3: Portrait to Pixar. :jack_o_lantern:
    • 2024-08-28 A repo more suitable for portrait style inference based on the AnimeGANv3 models has been released. Highly recommended.🔥
    • 2023-12-10 Added a new AnimeGANv3 model for Portrait to Oil-painting style. Its onnx is available here.
    • 2023-11-23 The code and the manuscript are released. 🦃
    • 2023-10-31 Added three new styles of AnimeGANv3: Portrait to Cute, 8bit and Sketch-0 style. :ghost:
    • 2023-09-18 Added a new AnimeGANv3 model for Face to Kpop style.
    • 2023-01-16 Added a new AnimeGANv3-photo.exe for the inference of AnimeGANv3's onnx model.
    • 2023-01-13 Added a new AnimeGANv3 model for Face to comic style.
    • 2022-12-25 Added the tiny model (2.4MB) of Nordic myth style and USA style 2.0. It can go upto 50 FPS on iphone14 with 512*512 input. :santa:
    • 2022-11-24 Added a new AnimeGANv3 model for Face to Nordic myth style. 🦃
    • 2022-11-06 Added a new AnimeGANv3 model for Face to Disney style V1.0.
    • 2022-10-31 Added a new AnimeGANv3 model for Face to USA cartoon and Disney style V1.0. :jack_o_lantern:
    • 2022-10-07 The USA cartoon Style of AnimeGANv3 is integrated to ProfileProfile with Core ML. Install it by the Apple Store and have a try.
    • 2022-09-26 Official online demo is integrated to Huggingface Spaces with Gradio. Hugging Face Spaces
    • 2022-09-24 Added a new great AnimeGANv3 model for Face to USA cartoon Style.
    • 2022-09-18 Update a new AnimeGANv3 model for Photo to Hayao Style.
    • 2022-08-01 Added a new AnimeGANv3 onnx model (Colab) for Face to Arcane style.
    • 2022-07-13 Added a new AnimeGANv3 onnx model (Colab) for Face to portrait sketch.
    • 2021-12-25 The paper of AnimeGANv3 will be released in 2022. :christmas_tree:

    🎮 Usage

    • Official online demo is released in Hugging Face Spaces.

    • Download this repository and use AnimeGANv3's UI tool and pre-trained *.onnx to turn your photos into anime. :blush:

    • 🛠️ Installation

      1. Clone repo

        git clone https://github.com/TachibanaYoshino/AnimeGANv3.git
        cd AnimeGANv3   
        
      2. Install dependent packages

        pip install -r requirements.txt  
        
      3. Inference with *.onnx

        python deploy/test_by_onnx.py -i inputs/imgs/ -o output/results -m deploy/AnimeGANv3_Hayao_36.onnx  
        
      4. video to anime with *.onnx

        python tools/video2anime.py -i inputs/vid/1.mp4 -o output/results -m deploy/AnimeGANv3_Hayao_36.onnx  
        

    🚀 Landscape Demos

    :fire: Video to anime (Hayao Style)


    :art: Photo to Hayao Style







    :art: Photo to Shinkai Style






    🚀 Portrait Style Demos

    The paper has been completed in 2022. The study of portrait stylization is an extension of the paper.

    :art: Face to USA cartoon style

    https://github.com/user-attachments/assets/9644b1f5-78a4-4dcd-9da0-0186fbf5ab94


    :art: Face to Disney cartoon style

    v1.9v2.0

    :art: Face to Ghibli-c1 style


    :art: Face to Trump style

    v1.9v2.0


    :art: Face to Arcane style

    https://github.com/user-attachments/assets/ab082d32-cc77-4c89-92c1-6a50cfa6a77b


    :art: Portrait to comic style

    https://github.com/user-attachments/assets/3e999a8e-a331-46f6-863c-c01fd50591c8


    :art: Face to Kpop style

    https://github.com/user-attachments/assets/3a59537c-fff2-4c86-8462-d53b07ff596b


    :art: Portrait to Oil-painting style


    :art: Portrait to Cute style

    https://github.com/user-attachments/assets/0b105ee7-8116-4456-931c-ec196200e288


    :art: Portrait to Pixar style

    https://github.com/user-attachments/assets/d9c4e931-3b3c-4b03-9531-63d9e391b4df


    :art: Portrait to Sketch-0 style

    https://github.com/user-attachments/assets/ed3f3511-4583-41d8-aad9-e47fdd2f5c32


    :art: Portrait to 8bit style


    :art: Face to portrait sketch

    Open In Colab

    inputFacepanoramic image

    🔨 Train

    1. Download dataset and pretrained vgg19
    1. vgg19
    2. Hayao dataset
    3. Shinkai dataset
    4. photo dataset
    2. Do edge_smooth
        cd tools && python edge_smooth.py --dataset Hayao --img_size 256
    
    3. Do superPixel
        cd tools && python visual_superPixel_seg_image.py
    
    4. Train
        python train.py --style_dataset Hayao --init_G_epoch 5 --epoch 100
    

    ✒️ Citation

    Consider citing as below if you find this repository helpful to your project:

    @article{Liu2024dtgan,
      title={A Novel Double-Tail Generative Adversarial Network for Fast Photo Animation},
      author={Gang LIU and Xin CHEN and Zhixiang GAO},
      journal={IEICE Transactions on Information and Systems},
      volume={E107.D},
      number={1},
      pages={72-82},
      year={2024},
      doi={10.1587/transinf.2023EDP7061}
    }
    

    :scroll: License

    This repo is made freely available to academic and non-academic entities for non-commercial purposes such as academic research, teaching, scientific publications. Permission is granted to use the AnimeGANv3 given that you agree to my license terms. Regarding the request for commercial use, please contact us via email to help you obtain the authorization letter.

    :e-mail: Author

    Asher Chan [email protected]