谷歌“史上最强GAN”,现在有了PyTorch预训练版,可直接玩耍 | 代码( 三 )

1git clone https://github.com/huggingface/pytorch-pretrained-BigGAN.git

2cd pytorch-pretrained-BigGAN

3pip install -r full_requirements.txt

128×128模型,有5040多万参数;256×256模型,有5590多万参数;512×512模型,有5620多万参数。三个模型,大小都在200~Mb。

安装之后,正式开始食用:

1import torch

2from pytorch_pretrained_biggan import (BigGAN, one_hot_from_names, truncated_noise_sample,

3 save_as_images, display_in_terminal)

4

5# OPTIONAL: if you want to have more information on what's happening, activate the logger as follows

6import logging

7logging.basicConfig(level=logging.INFO)

推荐阅读