Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
jinhaibo d7260549ed | 1 year ago | |
---|---|---|
samples | 1 year ago | |
weights | 1 year ago | |
.gitignore | 1 year ago | |
LICENSE | 1 year ago | |
README.md | 1 year ago | |
colab_demo.ipynb | 1 year ago | |
convert_weights.py | 1 year ago | |
demo.ipynb | 1 year ago | |
hubconf.py | 1 year ago | |
model.py | 1 year ago | |
requirements.txt | 1 year ago | |
test.py | 1 year ago |
Updates
2021-10-17
Add weights for FacePortraitV2.
2021-11-07
Thanks to ak92501, a web demo is integrated to Huggingface Spaces with Gradio.
2021-11-07
Thanks to xhlulu, the torch.hub
model is now available. See Torch Hub Usage.
Inference
python test.py --input_dir [image_folder_path] --device [cpu/cuda]
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
git clone https://github.com/TachibanaYoshino/AnimeGANv2
python convert_weights.py
Note: Results from converted weights slightly different due to the bilinear upsample issue
Webtoon Face [ckpt]
Trained on 256x256 face images. Distilled from webtoon face model with L2 + VGG + GAN Loss and CelebA-HQ images.
Face Portrait v1 [ckpt]
Face Portrait v2 [ckpt]
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》