Implementation of Analyzing and Improving the Image Quality of StyleGAN (StyleGAN 2) in PyTorch

Overview

StyleGAN 2 in PyTorch

Implementation of Analyzing and Improving the Image Quality of StyleGAN (https://arxiv.org/abs/1912.04958) in PyTorch

Notice

I have tried to match official implementation as close as possible, but maybe there are some details I missed. So please use this implementation with care.

Requirements

I have tested on:

  • PyTorch 1.3.1
  • CUDA 10.1/10.2

Usage

First create lmdb datasets:

python prepare_data.py --out LMDB_PATH --n_worker N_WORKER --size SIZE1,SIZE2,SIZE3,... DATASET_PATH

This will convert images to jpeg and pre-resizes it. This implementation does not use progressive growing, but you can create multiple resolution datasets using size arguments with comma separated lists, for the cases that you want to try another resolutions later.

Then you can train model in distributed settings

python -m torch.distributed.launch --nproc_per_node=N_GPU --master_port=PORT train.py --batch BATCH_SIZE LMDB_PATH

train.py supports Weights & Biases logging. If you want to use it, add --wandb arguments to the script.

SWAGAN

This implementation experimentally supports SWAGAN: A Style-based Wavelet-driven Generative Model (https://arxiv.org/abs/2102.06108). You can train SWAGAN by using

python -m torch.distributed.launch --nproc_per_node=N_GPU --master_port=PORT train.py --arch swagan --batch BATCH_SIZE LMDB_PATH

As noted in the paper, SWAGAN trains much faster. (About ~2x at 256px.)

Convert weight from official checkpoints

You need to clone official repositories, (https://github.com/NVlabs/stylegan2) as it is requires for load official checkpoints.

For example, if you cloned repositories in ~/stylegan2 and downloaded stylegan2-ffhq-config-f.pkl, You can convert it like this:

python convert_weight.py --repo ~/stylegan2 stylegan2-ffhq-config-f.pkl

This will create converted stylegan2-ffhq-config-f.pt file.

Generate samples

python generate.py --sample N_FACES --pics N_PICS --ckpt PATH_CHECKPOINT

You should change your size (--size 256 for example) if you train with another dimension.

Project images to latent spaces

python projector.py --ckpt [CHECKPOINT] --size [GENERATOR_OUTPUT_SIZE] FILE1 FILE2 ...

Closed-Form Factorization (https://arxiv.org/abs/2007.06600)

You can use closed_form_factorization.py and apply_factor.py to discover meaningful latent semantic factor or directions in unsupervised manner.

First, you need to extract eigenvectors of weight matrices using closed_form_factorization.py

python closed_form_factorization.py [CHECKPOINT]

This will create factor file that contains eigenvectors. (Default: factor.pt) And you can use apply_factor.py to test the meaning of extracted directions

python apply_factor.py -i [INDEX_OF_EIGENVECTOR] -d [DEGREE_OF_MOVE] -n [NUMBER_OF_SAMPLES] --ckpt [CHECKPOINT] [FACTOR_FILE]

For example,

python apply_factor.py -i 19 -d 5 -n 10 --ckpt [CHECKPOINT] factor.pt

Will generate 10 random samples, and samples generated from latents that moved along 19th eigenvector with size/degree +-5.

Sample of closed form factorization

Pretrained Checkpoints

Link

I have trained the 256px model on FFHQ 550k iterations. I got FID about 4.5. Maybe data preprocessing, resolution, training loop could made this difference, but currently I don't know the exact reason of FID differences.

Samples

Sample with truncation

Sample from FFHQ. At 110,000 iterations. (trained on 3.52M images)

MetFaces sample with non-leaking augmentations

Sample from MetFaces with Non-leaking augmentations. At 150,000 iterations. (trained on 4.8M images)

Samples from converted weights

Sample from FFHQ

Sample from FFHQ (1024px)

Sample from LSUN Church

Sample from LSUN Church (256px)

License

Model details and custom CUDA kernel codes are from official repostiories: https://github.com/NVlabs/stylegan2

Codes for Learned Perceptual Image Patch Similarity, LPIPS came from https://github.com/richzhang/PerceptualSimilarity

To match FID scores more closely to tensorflow official implementations, I have used FID Inception V3 implementations in https://github.com/mseitzer/pytorch-fid

Comments
  • error when running train.py

    error when running train.py

    line 135 in train.py: fake, latent = generator.module([test_in], return_latents=True)

    when run train.py, it seems that "generator.module AttributeError: 'Generator' object has no attribute 'module'". My pytorch is 1.3.1, do you have some idea about that? Thank you so much!

    opened by qingzi02010 19
  • no module named fused error

    no module named fused error

    Hi, I prepared the dataset and run the train.py as you said in the readme but got into a problem regrading the cpp extention.

    Traceback (most recent call last): File "train.py", line 20, in <module> from model import Generator, Discriminator File "/data/llh/projects/stylegan2/model.py", line 11, in <module> from op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d File "/data/llh/projects/stylegan2/op/__init__.py", line 1, in <module> from .fused_act import FusedLeakyReLU, fused_leaky_relu File "/data/llh/projects/stylegan2/op/fused_act.py", line 6, in <module> fused = load('fused', sources=['op/fused_bias_act.cpp', 'op/fused_bias_act_kernel.cu']) File "/home/llh/miniconda3/envs/py3pt11/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 644, in load is_python_module) File "/home/llh/miniconda3/envs/py3pt11/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 824, in _jit_compile return _import_module_from_library(name, build_directory, is_python_module) File "/home/llh/miniconda3/envs/py3pt11/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 967, in _import_module_from_library file, path, description = imp.find_module(module_name, [path]) File "/home/llh/miniconda3/envs/py3pt11/lib/python3.6/imp.py", line 297, in find_module raise ImportError(_ERR_MSG.format(name), name=name) ImportError: No module named 'fused'

    any idea?

    opened by linghai06 17
  • How to load the already compiled C++/cuda extension?

    How to load the already compiled C++/cuda extension?

    First, thank you so much for sharing your gggggggggggggggggggggggggggreat work! (I hate tf so much :()

    I modified the code a little and I'm tring to debug the code in pycharm with a single GPU by switching nn.parallel.DistributedDataParallel to torch.nn.DataParallel. The code goes well if excuted in shell command line and the extension lib are correctly generated, but if I run it in pycharm, I got:

    ''' Traceback (most recent call last): File "/home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1030, in _build_extension_module check=True) File "/home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/lib/python3.6/subprocess.py", line 438, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "/home/xxxxx/xxxxx/stylegan2-pytorch-master/train.py", line 26, in from model import Generator, Discriminator File "/home/xxxxx/xxxxx/stylegan2-pytorch-master/model.py", line 11, in from op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d File "/home/xxxxx/xxxxx/stylegan2-pytorch-master/op/init.py", line 1, in from .fused_act import FusedLeakyReLU, fused_leaky_relu File "/home/xxxxx/xxxxx/stylegan2-pytorch-master/op/fused_act.py", line 6, in fused = load('fused', sources=['op/fused_bias_act.cpp', 'op/fused_bias_act_kernel.cu']) File "/home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 661, in load is_python_module) File "/home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 830, in jit_compile with_cuda=with_cuda) File "/home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 883, in write_ninja_file_and_build build_extension_module(name, build_directory, verbose) File "/home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1043, in build_extension_module raise RuntimeError(message) RuntimeError: Error building extension 'fused': [1/3] /home/xxxxx/share/cuda-10.0 /bin/nvcc -DTORCH_EXTENSION_NAME=fused -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/lib/python3.6/site-packages/torch/include -isystem /home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -isystem /home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/lib/python3.6/site-packages/torch/include/TH -isystem /home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/lib/python3.6/site-packages/torch/include/THC -isystem /home/xxxxx/share/cuda-10.0 /include -isystem /home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS -D__CUDA_NO_HALF_CONVERSIONS -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_75,code=sm_75 --compiler-options '-fPIC' -std=c++11 -c /home/xxxxx/xxxxx/stylegan2-pytorch-master/op/fused_bias_act_kernel.cu -o fused_bias_act_kernel.cuda.o FAILED: fused_bias_act_kernel.cuda.o /home/xxxxx/share/cuda-10.0 /bin/nvcc -DTORCH_EXTENSION_NAME=fused -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/lib/python3.6/site-packages/torch/include -isystem /home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -isystem /home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/lib/python3.6/site-packages/torch/include/TH -isystem /home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/lib/python3.6/site-packages/torch/include/THC -isystem /home/xxxxx/share/cuda-10.0 /include -isystem /home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_75,code=sm_75 --compiler-options '-fPIC' -std=c++11 -c /home/xxxxx/xxxxx/stylegan2-pytorch-master/op/fused_bias_act_kernel.cu -o fused_bias_act_kernel.cuda.o /bin/sh: 1: /home/xxxxx/share/cuda-10.0: Permission denied [2/3] c++ -MMD -MF fused_bias_act.o.d -DTORCH_EXTENSION_NAME=fused -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/lib/python3.6/site-packages/torch/include -isystem /home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -isystem /home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/lib/python3.6/site-packages/torch/include/TH -isystem /home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/lib/python3.6/site-packages/torch/include/THC -isystem /home/xxxxx/share/cuda-10.0 /include -isystem /home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /home/xxxxx/xxxxx/stylegan2-pytorch-master/op/fused_bias_act.cpp -o fused_bias_act.o FAILED: fused_bias_act.o c++ -MMD -MF fused_bias_act.o.d -DTORCH_EXTENSION_NAME=fused -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/lib/python3.6/site-packages/torch/include -isystem /home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -isystem /home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/lib/python3.6/site-packages/torch/include/TH -isystem /home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/lib/python3.6/site-packages/torch/include/THC -isystem /home/xxxxx/share/cuda-10.0 /include -isystem /home/xxxxx/miniconda3/envs/py3.6_tensoflow1.14_n/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /home/xxxxx/xxxxx/stylegan2-pytorch-master/op/fused_bias_act.cpp -o fused_bias_act.o c++: error: /include: No such file or directory ninja: build stopped: subcommand failed. '''

    How can I just load the pre-compiled extension library? Which can skip the permission problem and save a lot of time

    opened by MengXinChengXuYuan 15
  • Multiple GPUs: Illegal Memory Access

    Multiple GPUs: Illegal Memory Access

    Hi, thanks for the great work. This is the same problem as https://github.com/rosinality/stylegan2-pytorch/issues/13. When initializing either the generator or discriminator on cuda:1 while having 2+ GPUs available, an illegal memory access is triggered.

    When using torch.distributed on a multi-gpu machine, this does not occur, since you manually set the cuda device to only one device, so device -1 is always that GPU. However, my CUDA skills are not great and I do not know how this can be solved, but it looks like an easy fix to me.

    opened by caandewiel 14
  • Error on running train.py

    Error on running train.py

    Hello,

    I've been trying to get the training script to run but have been running into some issues. The current issue I'm facing seems to be somewhat similar to another post by cyrilzakka from this week. when running !python -m torch.distributed.launch --nproc_per_node=1 --master_port=1234 /content/stylegan2-pytorch/train.py --batch 5 /content/, however his fix of changing the size of the batch doesn't seem to solve my issue. The bulk of the error message I receive is very similar to their, noting similar lines and faults, however also stating that there is a missing file for the 'op/fused_bias_act.cpp', even though the repo has been cloned. The error is:

    Traceback (most recent call last): File "/content/stylegan2-pytorch/train.py", line 21, in from model import Generator, Discriminator File "/content/stylegan2-pytorch/model.py", line 11, in from op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d File "/content/stylegan2-pytorch/op/init.py", line 1, in from .fused_act import FusedLeakyReLU, fused_leaky_relu File "/content/stylegan2-pytorch/op/fused_act.py", line 6, in fused = load('fused', sources=['op/fused_bias_act.cpp', 'op/fused_bias_act_kernel.cu']) File "/usr/local/lib/python3.6/dist-packages/torch/utils/cpp_extension.py", line 661, in load is_python_module) File "/usr/local/lib/python3.6/dist-packages/torch/utils/cpp_extension.py", line 809, in _jit_compile with_cuda=with_cuda File "/usr/local/lib/python3.6/dist-packages/torch/utils/_cpp_extension_versioner.py", line 44, in bump_version_if_changed hash_value = hash_source_files(hash_value, source_files) File "/usr/local/lib/python3.6/dist-packages/torch/utils/_cpp_extension_versioner.py", line 16, in hash_source_files with open(filename) as file: FileNotFoundError: [Errno 2] No such file or directory: 'op/fused_bias_act.cpp' Traceback (most recent call last): File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.6/dist-packages/torch/distributed/launch.py", line 253, in main() File "/usr/local/lib/python3.6/dist-packages/torch/distributed/launch.py", line 249, in main cmd=cmd) subprocess.CalledProcessError: Command '['/usr/bin/python3', '-u', '/content/stylegan2-pytorch/train.py', '--local_rank=0', '--batch', '5', '/content/']' returned non-zero exit status 1.

    opened by alexpollack 10
  • Takes too long to train - Gets stuck every 4 iterations

    Takes too long to train - Gets stuck every 4 iterations

    So I have a machine with a 2080Ti, I've tried to run the code as instructed at Readme.

    It takes more than 4 seconds per iteration on average (image size is the default 256,I reduced batch size to 4). After each 4 iterations (each running by itself way faster than 1 sec) it's getting "stuck" s eg 1,2,3,4 then something holds it for a long time,then 5,6,7,8 then stuck again etc. What do you think it could be?

    I've created the dataset from the celeba raw images as instructed (with just one size of 256), and then ran python -m torch.distributed.launch train.py --batch 4

    Thanks in advance man :)

    opened by yoniker 9
  • Details of perceptual path regularization

    Details of perceptual path regularization

    Hello, thank you for this amazing repo! I had a couple of questions related to the perceptual path regularization.

    1. Could you give an explanation of the arguments "path_regularize" and "path_batch_shrink" and why they are both set to a default of 2?

    2. Would you mind explaining the purpose of the bolded summing operation on line 227 in train.py?

    weighted_path_loss = args.path_regularize * args.g_reg_every * path_loss if args.path_batch_shrink:      weighted_path_loss += 0 * fake_img[0, 0, 0, 0]

    opened by kylepob 7
  • Training from checkpoint fails when using multiple GPUs

    Training from checkpoint fails when using multiple GPUs

    Hi,

    Thanks for implementing the paper in pytorch. I am having problems training a model starting from a specific checkpoint when using multiple GPUs.

    When using a single GPU I can run train.py using the following command: python -m torch.distributed.launch --nproc_per_node=1 train.py --batch 16 --iter 150000 --ckpt checkpoint/start_ckpt.pt dataset The first sample images look like they are from when I stopped training the network previously.

    When I use 4 GPUs I run into a Cuda out of memory issue, using the command: python -m torch.distributed.launch --nproc_per_node=4 train.py --batch 16 --iter 150000 --ckpt checkpoint/start_ckpt.pt dataset

    I then get the following CUDA: Out of memory error

    load model: checkpoint/start_ckpt.pt load model: checkpoint/start_ckpt.pt load model: checkpoint/start_ckpt.pt Traceback (most recent call last): File "trainoad model: checkpoint/start_ckpt.pt train(args, loader, generator, discriminator, g_optim, d_optim, g_ema, device) File "train.py", line 189, in train real_pred = discriminator(real_img) File "/opt/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in __call__ result = self.forward(*input, **kwargs) File "/opt/anaconda3/lib/python3.7/site-packages/torch/nn/parallel/distributed.py", line 442, in forward output = self.module(*inputs[0], **kwargs[0]) File "/opt/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in __call__ result = self.forward(*input, **kwargs) File "/home/jameswhennessey/stylegan2-pytorch/model.py", line 647, in forward out = self.convs(input) File "/opt/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in __call__ result = self.forward(*input, **kwargs) File "/opt/anaconda3/lib/python3.7/site-packages/torch/nn/modules/container.py", line 92, in forward input = module(input) File "/opt/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in __call__ result = self.forward(*input, **kwargs) File "/home/jameswhennessey/stylegan2-pytorch/model.py", line 598, in forward out = self.conv2(out) File "/opt/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in __call__ result = self.forward(*input, **kwargs) File "/opt/anaconda3/lib/python3.7/site-packages/torch/nn/modules/container.py", line 92, in forward input = module(input) File "/opt/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in __call__ result = self.forward(*input, **kwargs) File "/home/jameswhennessey/stylegan2-pytorch/op/fused_act.py", line 82, in forward return fused_leaky_relu(input, self.bias, self.negative_slope, self.scale) File "/home/jameswhennessey/stylegan2-pytorch/op/fused_act.py", line 86, in fused_leaky_relu return FusedLeakyReLUFunction.apply(input, bias, negative_slope, scale) File "/home/jameswhennessey/stylegan2-pytorch/op/fused_act.py", line 55, in forward out = fused.fused_bias_act(input, bias, empty, 3, 0, negative_slope, scale) File "/home/jameswhennessey/stylegan2-pytorch/op/fused_act.py", line 86, in fused_leaky_relu return FusedLeakyReLUFunction.apply(input, bias, negative_slope, scale) File "/home/jameswhennessey/stylegan2-pytorch/op/fused_act.py", line 55, in forward out = fused.fused_bias_act(input, bias, empty, 3, 0, negative_slope, scale) RuntimeError: CUDA out of memory. Tried to allocate 256.00 MiB (GPU 0; 15.75 GiB total capacity; 8.03 GiB already allocated; 101.38 MiB free; 565.07 MiB cached) (malloc at /opt/conda/conda-bld/pytorch_1573049306803/work/c10/cuda/CUDACachingAllocator.cpp:267) frame #0: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x47 (0x7f397a01f687 in /opt/anaconda3/lib/python3.7/site-packages/torch/lib/libc10.so) ......

    Do you have any suggestions on how to resolve this issue?

    Thanks in advance.

    opened by JWHennessey 7
  • GPU memory useage

    GPU memory useage

    Thanks for your great work about reproducing the StyleGAN and its v2. I am running the styleganv2 code on my 2 GPU (2080ti) workstation. I found if I set the image resolution to 256x256, the maximum batch size I could achieve is 2. Yet, in the official implementation, they list that config-f on 256 resolution only takes 6.4GB GPU memory. I am wondering to know the difference between them, since it seems that I cannot implement 1024 resolution on my workstation (or even larger GPU station). BTW, have you tried how many GPUs could deal with 1024 resolution? Thanks again!

    opened by WANG-Chaoyue 7
  • Non-determinism when already fixing random seeds

    Non-determinism when already fixing random seeds

    Hi, I noticed the model has non-determinism even I fixed the random seed. For example, when I trained it on a rendered chair dataset. The same noise has different image outputs. Pair 1: image image

    Pair 2: image image

    The issue also exists on some natural image datasets, but not obvious as it on this chair dataset. Why could this happen and is there a way to fix it?

    opened by KelestZ 6
  • Get gray output when run the generate.py

    Get gray output when run the generate.py

    Hi, I got some '.pt' file by run the train.py successfully. And the output image is good. But when i want to run the generate.py , i got some just gray image like this : image

    By the way, I changed the code in generat.py beause my gpu1 is used. original: g_ema = Generator( args.size, args.latent, args.n_mlp, channel_multiplier=args.channel_multiplier ).to(device) checkpoint = torch.load(args.ckpt) g_ema.load_state_dict(checkpoint['g_ema'])

    changed: g_ema = Generator( args.size, args.latent, args.n_mlp, channel_multiplier=args.channel_multiplier ).to(device) checkpoint = torch.load(args.ckpt, map_location={'cuda:1':'cuda:2'}) g_ema.load_state_dict(checkpoint['g_ema'])

    opened by kmaeii 6
  •  How to implement the most efficient convolution

    How to implement the most efficient convolution

    hi @rosinality , thank you for your great contribution, the result is amazing, but the huge input/output channels(1024, 512, etc) make the convolution heavy and slow, how could we implement lightweight convolutions to slim the model? thank you.

    Btw, there are some mobile/lightweight open sources, like MobileStyleGAN, anycost-gan, etc, but almost all these approaches are trying to decrease the channels, but unfortunately, this will also decrease the image quality, I just wonder if we could make a super lightweight convolution without decreasing the channels but still maintain similar results with StyleGAN2.

    opened by anguoyang 2
  • ImportError: No module named 'fused'

    ImportError: No module named 'fused'

    A question about "fused", thanks for any help 😭

    • the error when runing the .py is as below:

    image

    • I also tryed the methods promoted in another issue about checking the /tmp/torch_extensions, the error as shown in the screen shot. image
    opened by Blosslzy 1
  • I trained using the tree dataset(300 images)

    I trained using the tree dataset(300 images)

    I trained using the tree dataset. We proceeded with 300 images of trees, but the generation did not go well. I would like to know your experience of training with trees.

    opened by psjun72 0
  • no module named fused

    no module named fused

    cuda 10.2 pytorch 1.4/1.5/1.7.1/1.8.0 I have tried these versions image

    However, there will still be the problem of "no module named fused". Do you have any solutions?

    opened by rchotcocoa 0
Owner
Kim Seonghyeon
no side-effects
Kim Seonghyeon
Cross Quality LFW: A database for Analyzing Cross-Resolution Image Face Recognition in Unconstrained Environments

Cross-Quality Labeled Faces in the Wild (XQLFW) Here, we release the database, evaluation protocol and code for the following paper: Cross Quality LFW

Martin Knoche 10 Dec 12, 2022
[SIGGRAPH'22] StyleGAN-XL: Scaling StyleGAN to Large Diverse Datasets

[Project] [PDF] This repository contains code for our SIGGRAPH'22 paper "StyleGAN-XL: Scaling StyleGAN to Large Diverse Datasets" by Axel Sauer, Katja

null 742 Jan 4, 2023
Implementation of StyleSpace Analysis: Disentangled Controls for StyleGAN Image Generation in PyTorch

StyleSpace Analysis: Disentangled Controls for StyleGAN Image Generation Implementation of StyleSpace Analysis: Disentangled Controls for StyleGAN Ima

Xuanchi Ren 86 Dec 7, 2022
Improving Object Detection by Estimating Bounding Box Quality Accurately

Improving Object Detection by Estimating Bounding Box Quality Accurately Abstrac

null 2 Apr 14, 2022
LQM - Improving Object Detection by Estimating Bounding Box Quality Accurately

Improving Object Detection by Estimating Bounding Box Quality Accurately Abstract Object detection aims to locate and classify object instances in ima

IM Lab., POSTECH 0 Sep 28, 2022
😇A pyTorch implementation of the DeepMoji model: state-of-the-art deep learning model for analyzing sentiment, emotion, sarcasm etc

------ Update September 2018 ------ It's been a year since TorchMoji and DeepMoji were released. We're trying to understand how it's being used such t

Hugging Face 865 Dec 24, 2022
GAN encoders in PyTorch that could match PGGAN, StyleGAN v1/v2, and BigGAN. Code also integrates the implementation of these GANs.

MTV-TSA: Adaptable GAN Encoders for Image Reconstruction via Multi-type Latent Vectors with Two-scale Attentions. This is the official code release fo

owl 37 Dec 24, 2022
Official PyTorch implementation of the paper "Recycling Discriminator: Towards Opinion-Unaware Image Quality Assessment Using Wasserstein GAN", accepted to ACM MM 2021 BNI Track.

RecycleD Official PyTorch implementation of the paper "Recycling Discriminator: Towards Opinion-Unaware Image Quality Assessment Using Wasserstein GAN

Yunan Zhu 23 Nov 5, 2022
Non-Official Pytorch implementation of "Face Identity Disentanglement via Latent Space Mapping" https://arxiv.org/abs/2005.07728 Using StyleGAN2 instead of StyleGAN

Face Identity Disentanglement via Latent Space Mapping - Implement in pytorch with StyleGAN 2 Description Pytorch implementation of the paper Face Ide

Daniel Roich 58 Dec 24, 2022
Segmentation in Style: Unsupervised Semantic Image Segmentation with Stylegan and CLIP

Segmentation in Style: Unsupervised Semantic Image Segmentation with Stylegan and CLIP Abstract: We introduce a method that allows to automatically se

Daniil Pakhomov 134 Dec 19, 2022
StyleSpace Analysis: Disentangled Controls for StyleGAN Image Generation

StyleSpace Analysis: Disentangled Controls for StyleGAN Image Generation Demo video: CVPR 2021 Oral: Single Channel Manipulation: Localized or attribu

Zongze Wu 267 Dec 30, 2022
Unofficial implementation of MUSIQ (Multi-Scale Image Quality Transformer)

MUSIQ: Multi-Scale Image Quality Transformer Unofficial pytorch implementation of the paper "MUSIQ: Multi-Scale Image Quality Transformer" (paper link

null 41 Jan 2, 2023
Official Implementation for "ReStyle: A Residual-Based StyleGAN Encoder via Iterative Refinement" https://arxiv.org/abs/2104.02699

ReStyle: A Residual-Based StyleGAN Encoder via Iterative Refinement Recently, the power of unconditional image synthesis has significantly advanced th

null 967 Jan 4, 2023
Official implementation of "StyleCariGAN: Caricature Generation via StyleGAN Feature Map Modulation" (SIGGRAPH 2021)

StyleCariGAN in PyTorch Official implementation of StyleCariGAN:Caricature Generation via StyleGAN Feature Map Modulation in PyTorch Requirements PyTo

PeterZhouSZ 49 Oct 31, 2022
Official implementation of "StyleCariGAN: Caricature Generation via StyleGAN Feature Map Modulation" (SIGGRAPH 2021)

StyleCariGAN: Caricature Generation via StyleGAN Feature Map Modulation This repository contains the official PyTorch implementation of the following

Wonjong Jang 270 Dec 30, 2022
StyleGAN - Official TensorFlow Implementation

StyleGAN — Official TensorFlow Implementation Picture: These people are not real – they were produced by our generator that allows control over differ

NVIDIA Research Projects 13.1k Jan 9, 2023
A tensorflow/keras implementation of StyleGAN to generate images of new Pokemon.

PokeGAN A tensorflow/keras implementation of StyleGAN to generate images of new Pokemon. Dataset The model has been trained on dataset that includes 8

null 19 Jul 26, 2022
Jittor 64*64 implementation of StyleGAN

StyleGanJittor (Tsinghua university computer graphics course) Overview Jittor 64

Song Shengyu 3 Jan 20, 2022
PyTorch implementation of Progressive Growing of GANs for Improved Quality, Stability, and Variation.

PyTorch implementation of Progressive Growing of GANs for Improved Quality, Stability, and Variation. Warning: the master branch might collapse. To ob

null 559 Dec 14, 2022