Training deep models using anime, illustration images.

Overview

StyleGAN3 samples

animeface

deep models for anime images.

Datasets

Models

"code" is indicated when only an official implementation exists.

Generative Adversarial Networks (GANs)

Method paper code
Alias Free GAN (StyleGAN3) arxiv github
Augmented-Self Reference and Dense Semantic Correspondence (SCFT) arxiv -
auxiliary classifier GAN (ACGAN) arxiv -
big GAN (BigGAN) arxiv github
conditional GAN (cGAN) arxiv -
Contrastive Discriminator (ContraD) openreview github
deep convolutional GAN (DCGAN) arxiv -
deep regret analytic GAN (DRAGAN) arxiv github
Enhanced super resolution GAN (ESRGAN) arxiv github
Fourier Features arxiv github
GANILLA arxiv github
generative adversarial networks (GAN) arxiv -
Image-to-image Translation via Hierarchical Style Disentanglement (HiSD) arxiv github
Improved Transformer for High-Resolution GANs (HiT) arxiv -
Hologram(?) GAN (HoloGAN) arxiv github
Position Encoding as Spatial Inductive Bias arxiv github
progressive growing of GANs (PGGAN) arxiv github
pix2ix arxiv github
pix2pix HD arxiv github
single GAN (SinGAN) arxiv github
Spatially-Adaptive Normalization (SPADE) arxiv github
style-based GAN (StyleGAN) arxiv github
style-based GAN 2 (StyleGAN2) arxiv github
Super resolution GAN (SRGAN) arxiv -
Transformer-based GAN (TransGAN) arxiv github
unsupervised GAN with adaptive layer-instance normalization (UGATIT) arxiv github
Wasserstein GAN (WGAN) arxiv -
WGAN with gradient penalty (WGAN_gp) arxiv -
zero-centered gradient penalty arxiv -
simplified zero-centered gradient penality arxiv github

Auto Encoders

Method paper code
Auto Encoder (AE) tronto -
Variational Auto Encoder (VAE) arxiv -

Other

Method paper code
AdaBelief optimizer arxiv github
Adaptive Discriminator Augmentation (ADA) arxiv github
differentiable augmentation (DiffAugment) arxiv github
pixel shuffle arxiv -

Weights

See weights.md

Reference

[1] Gwern Branwen, Anonymous, & The Danbooru Community;
    “Danbooru2019 Portraits: A Large-Scale Anime Head Illustration Dataset”,
    2019-03-12. Web. Accessed 2020/09/17,
    https://www.gwern.net/Crops#danbooru2019-portraits

Author

Tomoya Sawada

Comments
  • H2O Wave

    H2O Wave

    WHAT

    • add system and training visualization using H2O Wave
    • add services in docker-compose.yml which runs the wave server.
    • add Dockerfile for H2O Wave
    • add h2o_wave, psutil in dependencies.
    • add class for visualization.
    enhancement 
    opened by STomoya 2
  • memory format warning when using DiffAugment

    memory format warning when using DiffAugment

    The warning bellow is produced when using Differentiable Augmentation(DiffAugment).

    [W TensorIterator.cpp:924] Warning: Mixed memory format inputs detected while calling the operator. The operator will output channels_last tensor even if some of the inputs are not in channels_last format. (function operator())

    I am guessing this only happens in PyTorch ver1.6.0 or higher. PR#37968@pytorch/pytorch

    DiffAugment is an augmentation method, therefore I believe this will not affect the results much.

    opened by STomoya 2
  • Update Utils

    Update Utils

    WHAT

    • Add more general status holder
    • Add AdaBelief optimizer to gan_utils
    • Update code for exponential moving average
    • Erase older version of fp16 code (not used in any implementations)
    enhancement 
    opened by STomoya 1
  • Add Utils

    Add Utils

    WHAT

    • add noise samplers
    • add device specification func
    • add exponential moving average class
    • add kornia to dependences
    • add kornia version of diffaugment (not perfectly the same).
    • move gan related utils to gan_utils
    • adjust import

    WHY

    enhancement 
    opened by STomoya 1
  • Losses

    Losses

    WHAT

    • add defined loss functions
    • add dragan, simplified 0-center gp

    +alpha

    • ignore .pt files
    • make danbooru portraits dataset importable
    • fix default transform for danbooru portraits dataset
    enhancement 
    opened by STomoya 1
  • Repository Configuration Change

    Repository Configuration Change

    WHAT

    • the implementations are moved to the implementations folder
    • the main.py is rewritten to import from the folder

    WHY

    • the number of implementations are increasing.
    • wanted to make the main.py less informative. (will do this later.)
    enhancement 
    opened by STomoya 1
  • Update PyTorch to 1.11

    Update PyTorch to 1.11

    WHAT

    • Update PyTorch to version 1.11

    TODO

    • [x] Update base image of docker container.
    • ~~[ ] Implement dataset with torchdata.~~ (Might come back later.)
    • [x] Check cpp_extension build (stylegan ops).
    enhancement code 
    opened by STomoya 0
  • [ImgBot] Optimize images

    [ImgBot] Optimize images

    Beep boop. Your images are optimized!

    Your image file size has been reduced by 5% 🎉

    Details

    | File | Before | After | Percent reduction | |:--|:--|:--|:--| | /implementations/Restormer/result/test-randomxdog.jpg | 44.06kb | 40.97kb | 7.03% | | /implementations/Restormer/result/test-constxdog.jpg | 45.49kb | 42.40kb | 6.80% | | /implementations/normalizations/result/198000-lin.jpg | 116.73kb | 109.28kb | 6.38% | | /implementations/normalizations/result/198000-in.jpg | 116.48kb | 109.12kb | 6.32% | | /implementations/normalizations/result/198000-polin.jpg | 116.69kb | 109.32kb | 6.32% | | /implementations/NAFNet/result/95000-glu.jpg | 520.46kb | 488.79kb | 6.08% | | /implementations/NAFNet/result/95000-naf.jpg | 514.82kb | 484.47kb | 5.89% | | /implementations/Restormer/result/178000-randomxdog.jpg | 124.70kb | 117.56kb | 5.73% | | /implementations/Restormer/result/178000-constxdog.jpg | 109.37kb | 103.17kb | 5.68% | | /implementations/APA/result/50000-5k.jpg | 70.74kb | 67.15kb | 5.07% | | /implementations/ADA/result/49000.jpg | 71.66kb | 68.07kb | 5.02% | | /implementations/ConvNeXt/result/75000-resnext.jpg | 65.15kb | 61.89kb | 5.01% | | /implementations/Restormer/result/test-aahq-constxdog.jpg | 108.79kb | 103.40kb | 4.96% | | /docs/stylegan3-samples.jpg | 129.64kb | 123.24kb | 4.93% | | /implementations/Restormer/result/test-aahq-randomxdog.jpg | 113.21kb | 107.73kb | 4.84% | | /implementations/ConvNeXt/result/75000-smallkernel.jpg | 65.15kb | 62.03kb | 4.79% | | /implementations/ConvNeXt/result/75000-convnext.jpg | 67.54kb | 64.34kb | 4.74% | | /implementations/APA/result/149000-noapa-5k.jpg | 66.41kb | 63.31kb | 4.66% | | /implementations/VAN/result/75000.jpg | 62.25kb | 59.45kb | 4.49% | | /implementations/CIPS/result/184000.jpg | 62.87kb | 60.10kb | 4.41% | | /implementations/UGATIT/result/79000-aahq.jpg | 99.90kb | 95.50kb | 4.41% | | /implementations/UGATIT/result/63000-animeface.jpg | 112.28kb | 107.54kb | 4.22% | | /implementations/FastGAN/result/184000.jpg | 536.75kb | 526.11kb | 1.98% | | | | | | | Total : | 3,341.15kb | 3,174.94kb | 4.97% |


    📝 docs | :octocat: repo | 🙋🏾 issues | 🏪 marketplace

    ~Imgbot - Part of Optimole family

    opened by imgbot[bot] 0
  • MiniAccelerate

    MiniAccelerate

    WHAT

    WHY

    • Reduce coding for AMP and device placement.

    Usage

    Original training code.

    device = get_device()
    dataset = Dataset.asloader(...)
    model = Net(...)
    optimizer = optim.Adam(model.parameters())
    amp = True
    scaler = GradScaler() if amp else None
    
    for data in dataset:
        data = data.to(device)
        with autocast(amp):
            output = model(data)
            loss = criterion(output)
    
        if scaler is not None:
            scaler.scale(loss).backward()
            scaler.step(optimizer)
        else:
            loss.backward()
            optimizer.step()
    

    becomes

    # device configuration is optional
    # if device is None: it is automatically set by nnutils.get_device()
    device = get_device()
    dataset = Dataset.asloader(...)
    model = Net(...)
    optimizer = optim.Adam(model.parameters())
    amp = True
    # scaler object is held inside accelerator
    # scaler = GradScaler() if amp else None
    
    # create accelerator object and prepare for training.
    accelerator = MiniAccelerator(amp=amp, device_placement=True, device=device)
    dataset, model, optimizer = accelerator.prepare(
        dataset, model, optimizer)
    
    for data in dataset:
        # device placement is done automatically
        # data = data.to(device)
        with accelerator.autocast():
            output = model(data)
            loss = criterion(output)
    
        # loss scaling is done inside accelerator
        # if scaler is not None:
        #     scaler.scale(loss).backward()
        #     scaler.step(optimizer)
        # else:
        #     loss.backward()
        #     optimizer.step()
    
        # use accelerator.backward(loss) instead of loss.backward()
        accelerator.backward(loss)
        optimizer.step()
    
        # update scaler. can be ignored if amp=False
        accelerator.update()
    

    Modifications

    Not implemented

    • Multi device support
    • TPU support
    • DeepSpeed support

    Changes

    • Calling .update() of GradScaler is done in MiniAccelerator().update().

      Originally this is done inside AcceleratedOptimizer().step(), but when using multiple optimizers, like in GAN, this will call GradScaler().update() multiple times per step.

    Notes

    I will not reimplement existing training codes using MiniAccelerator.

    TODOs

    • [x] add implementation
    • [x] test
    enhancement code 
    opened by STomoya 0
  • [ImgBot] Optimize images

    [ImgBot] Optimize images

    Beep boop. Your images are optimized!

    Your image file size has been reduced by 27% 🎉

    Details

    | File | Before | After | Percent reduction | |:--|:--|:--|:--| | /implementations/FourierFeatures/result/train-seq-ffm.gif | 3,497.15kb | 1,572.89kb | 55.02% | | /implementations/PEinGAN/result/100000.jpg | 22.23kb | 20.91kb | 5.93% | | /implementations/PEinGAN/result/100000-pad.jpg | 22.05kb | 20.76kb | 5.88% | | /implementations/DDPM/result/test.jpg | 30.48kb | 29.04kb | 4.71% | | /implementations/StyleGAN3/result/50000-T.jpg | 63.75kb | 60.78kb | 4.65% | | /implementations/StyleGAN3/result/50000-R.jpg | 61.50kb | 58.81kb | 4.38% | | /implementations/StyleGAN3/result/test-R.gif | 1,930.50kb | 1,882.01kb | 2.51% | | /implementations/StyleGAN3/result/test-T.gif | 1,888.05kb | 1,841.12kb | 2.49% | | | | | | | Total : | 7,515.71kb | 5,486.31kb | 27.00% |


    📝 docs | :octocat: repo | 🙋🏾 issues | 🏪 marketplace

    ~Imgbot - Part of Optimole family

    opened by imgbot[bot] 0
  • Organize Repo

    Organize Repo

    WHAT

    • organize repository.
    • move general and gan_utils from implementations.
    • reimplement dataset, utilities.
    • add utilities.
    • separate thirdparty codes. (e.g. diffaugment, adabelief)
    • add thirdparty codes. (e.g. stylegan2-ada-pytorch ops, ada)
    • use renewed dataset, utilities in implementations.
    • fix/renew implementation codes.

    WHY

    • general and gan_utils are weird to be in implementations folder.
    • add copies of thirdparty license.

    HOW

    • [x] add codes out of implementations folder.
    • [x] update implementations.
    • [x] erase codes not used inside implementations.
    enhancement code 
    opened by STomoya 0
  • ContraD results

    ContraD results

    Could not get good results in ContraD.

    what can be done.

    • Train with more simpler model. (vs StyleGAN2)
    • Further hyper-parameter tuning.
    • Loss function. (taken from original implementation so I believe it's not wrong.)
    enhancement training failed 
    opened by STomoya 0
  • training BigGAN

    training BigGAN

    In the BigGAN paper, they have improved the scores by using bigger batch size and a larger model. I used the batch size of 12, which is the biggest batch size my environment can train...

    Also the model collapsed after about 10 epochs.

    enhancement training failed hardware limitation 
    opened by STomoya 0
Owner
Tomoya Sawada
A student in Japan.
Tomoya Sawada
Little tool in python to watch anime from the terminal (the better way to watch anime)

ani-cli Script working again :), thanks to the fork by Dink4n for the alternative approach to by pass the captcha on gogoanime A cli to browse and wat

Harshith 4.5k Dec 31, 2022
Generating Anime Images by Implementing Deep Convolutional Generative Adversarial Networks paper

AnimeGAN - Deep Convolutional Generative Adverserial Network PyTorch implementation of DCGAN introduced in the paper: Unsupervised Representation Lear

Rohit Kukreja 23 Jul 21, 2022
An image base contains 490 images for learning (400 cars and 90 boats), and another 21 images for testingAn image base contains 490 images for learning (400 cars and 90 boats), and another 21 images for testing

SVM Données Une base d’images contient 490 images pour l’apprentissage (400 voitures et 90 bateaux), et encore 21 images pour fait des tests. Prétrait

Achraf Rahouti 3 Nov 30, 2021
For holding anime-related object classification and detection models

Animesion An end-to-end framework for anime-related object classification, detection, segmentation, and other models. Update: 01/22/2020. Due to time-

Edwin Arkel Rios 72 Nov 30, 2022
Learning recognition/segmentation models without end-to-end training. 40%-60% less GPU memory footprint. Same training time. Better performance.

InfoPro-Pytorch The Information Propagation algorithm for training deep networks with local supervision. (ICLR 2021) Revisiting Locally Supervised Lea

null 78 Dec 27, 2022
[Open Source]. The improved version of AnimeGAN. Landscape photos/videos to anime

[Open Source]. The improved version of AnimeGAN. Landscape photos/videos to anime

CC 4.4k Dec 27, 2022
StyleGAN2 Webtoon / Anime Style Toonify

StyleGAN2 Webtoon / Anime Style Toonify Korea Webtoon or Japanese Anime Character Stylegan2 base high Quality 1024x1024 / 512x512 Generate and Transfe

null 121 Dec 21, 2022
A simple PyTorch Implementation of Generative Adversarial Networks, focusing on anime face drawing.

AnimeGAN A simple PyTorch Implementation of Generative Adversarial Networks, focusing on anime face drawing. Randomly Generated Images The images are

Jie Lei 雷杰 1.2k Jan 3, 2023
Variational autoencoder for anime face reconstruction

VAE animeface Variational autoencoder for anime face reconstruction Introduction This repository is an exploratory example to train a variational auto

Minzhe Zhang 2 Dec 11, 2021
My usage of Real-ESRGAN to upscale anime, some test and results in the test_img folder

anime upscaler My usage of Real-ESRGAN to upscale anime, I hope to use this on a proper GPU cuz doing this on CPU is completely shit ?? , I even tried

Shangar Muhunthan 29 Jan 7, 2023
Real-CUGAN - Real Cascade U-Nets for Anime Image Super Resolution

Real Cascade U-Nets for Anime Image Super Resolution 中文 | English ?? Real-CUGAN

tarsin 111 Dec 28, 2022
Script that receives an Image (original) and a set of images to be used as "pixels" in reconstruction of the Original image using the set of images as "pixels"

picinpics Script that receives an Image (original) and a set of images to be used as "pixels" in reconstruction of the Original image using the set of

RodrigoCMoraes 1 Oct 24, 2021
Deep learning models for change detection of remote sensing images

Change Detection Models (Remote Sensing) Python library with Neural Networks for Change Detection based on PyTorch. ⚡ ⚡ ⚡ I am trying to build this pr

Kaiyu Li 176 Dec 24, 2022
Code for pre-training CharacterBERT models (as well as BERT models).

Pre-training CharacterBERT (and BERT) This is a repository for pre-training BERT and CharacterBERT. DISCLAIMER: The code was largely adapted from an o

Hicham EL BOUKKOURI 31 Dec 5, 2022
StackRec: Efficient Training of Very Deep Sequential Recommender Models by Iterative Stacking

StackRec: Efficient Training of Very Deep Sequential Recommender Models by Iterative Stacking Datasets You can download datasets that have been pre-pr

null 25 May 29, 2022
We present a framework for training multi-modal deep learning models on unlabelled video data by forcing the network to learn invariances to transformations applied to both the audio and video streams.

Multi-Modal Self-Supervision using GDT and StiCa This is an official pytorch implementation of papers: Multi-modal Self-Supervision from Generalized D

Facebook Research 42 Dec 9, 2022
NVIDIA Merlin is an open source library providing end-to-end GPU-accelerated recommender systems, from feature engineering and preprocessing to training deep learning models and running inference in production.

NVIDIA Merlin NVIDIA Merlin is an open source library designed to accelerate recommender systems on NVIDIA’s GPUs. It enables data scientists, machine

null 419 Jan 3, 2023
Uni-Fold: Training your own deep protein-folding models

Uni-Fold: Training your own deep protein-folding models. This package provides an implementation of a trainable, Transformer-based deep protein foldin

DP Technology 187 Jan 4, 2023