MIT License

项目介绍

bryandlee/animegan2-pytorch 是一个托管在 GitHub 上的开源项目,主要使用 Jupyter Notebook 编写,采用 MIT License 许可证,目前获得 4.5k 个 Star、635 次 Fork。

仓库全名
bryandlee/animegan2-pytorch
开源许可证
MIT License
Star 数
4.5k
Fork 数
635
未关闭 Issue
38

README 摘要

PyTorch Implementation of AnimeGANv2 Updates 2021-11-07 Thanks to xhlulu, the torch.hub model is now available. See Torch Hub Usage. Basic Usage Inference Torch Hub Usage You can load the model via torch.hub: Currently, the following pretrained shorthands are available: You can also load the face2paint util function: More details about torch.hub is in the torch docs Weight Conversion from the Original Repo…

完整内容见 GitHub 原始 README 或本页 。

常见问题

animegan2-pytorch 用什么语言开发?

主要使用 Jupyter Notebook 编写,采用 MIT License 许可证,目前有 4.5k 个 Star。

animegan2-pytorch 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 animegan2-pytorch 的源码?

可以直接克隆仓库:git clone https://github.com/bryandlee/animegan2-pytorch.git,默认分支为 main;安装与运行步骤见仓库 README。

animegan2-pytorch 最近还在维护吗?

仓库最近一次更新为 2023年1月6日,当前有 38 个未关闭 Issue;Star 数为 4.5k,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

PyTorch implementation of AnimeGANv2

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
5778
价值分
2864
活跃状态
活跃

语言占比

Jupyter Notebook
Python

README

PyTorch Implementation of AnimeGANv2

Updates

Basic Usage

Inference

python test.py --input_dir [image_folder_path] --device [cpu/cuda]

Torch Hub Usage

You can load the model via torch.hub:

import torch
model = torch.hub.load("bryandlee/animegan2-pytorch", "generator").eval()
out = model(img_tensor)  # BCHW tensor

Currently, the following pretrained shorthands are available:

model = torch.hub.load("bryandlee/animegan2-pytorch:main", "generator", pretrained="celeba_distill")
model = torch.hub.load("bryandlee/animegan2-pytorch:main", "generator", pretrained="face_paint_512_v1")
model = torch.hub.load("bryandlee/animegan2-pytorch:main", "generator", pretrained="face_paint_512_v2")
model = torch.hub.load("bryandlee/animegan2-pytorch:main", "generator", pretrained="paprika")

You can also load the face2paint util function:

from PIL import Image

face2paint = torch.hub.load("bryandlee/animegan2-pytorch:main", "face2paint", size=512)

img = Image.open(...).convert("RGB")
out = face2paint(model, img)

More details about torch.hub is in the torch docs

Weight Conversion from the Original Repo (Tensorflow)

  1. Install the original repo’s dependencies: python 3.6, tensorflow 1.15.0-gpu
  2. Install torch >= 1.7.1
  3. Clone the original repo & run
git clone https://github.com/TachibanaYoshino/AnimeGANv2
python convert_weights.py
samples
Results from converted `Paprika` style model (input image, original tensorflow result, pytorch result from left to right)

     

Note: Results from converted weights slightly different due to the bilinear upsample issue

Additional Model Weights

Webtoon Face [ckpt]

samples

Trained on 256x256 face images. Distilled from webtoon face model with L2 + VGG + GAN Loss and CelebA-HQ images.

face_results  

Face Portrait v1 [ckpt]

samples

Trained on 512x512 face images.

Colab

samples

📺

sample

Face Portrait v2 [ckpt]

samples

Trained on 512x512 face images. Compared to v1, 🔻beautify 🔺robustness

Colab

face_portrait_v2_0

face_portrait_v2_1

🦑 🎮 🔥

face_portrait_v2_squid_game

评论

暂无评论