Skip to content

AlionSSS/image-generation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image-generation

  • This is an AI project that uses GAN to generate images.
  • models
    • DCGAN
    • ResDCGAN(DCGAN + ResidualBlock)
    • xxx

Environment

Dataset

  • Anime Faces Dataset 128
    1. 请先下载数据集 Anime Faces Dataset 128
    2. 将下载好的文件archive.zip解压至项目的./dataset
    3. 存储路径格式如./dataset/AnimeFaces128/face/*.png

Help Info

  • 命令示例
python main.py help

Model Train

  • 先启动 Visdom Server,见 Run Visdom
  • 命令示例
# Linux
python main.py train \
# --netg-path='checkpoints/GeneratorNet_100.pth' \
# --netd-path='checkpoints/DiscriminatorNet_100.pth' \
--data-path='dataset/AnimeFaces128' \ 
--max-epoch=200 \
--batch-size=256 \
--lr-g=0.002 \
--lr-d=0.0002 \
# 是否使用Visdom,默认为True
--vis=True \
# visdom 环境名称
--visdom-env='image-generation'

Generate Image

  • 命令示例
# Linux
python main.py generate \
--netg-path='checkpoints/GeneratorNet_200.pth' \
--netd-path='checkpoints/DiscriminatorNet_200.pth' \
--gen-img='result.png' \
--gen-num=64
  • 生成图像的结果见--gen-img参数指定的文件,如result.png

Run Visdom

  • 命令示例
# 阻塞启动
python -m visdom.server

# 非阻塞启动
nohup python -m visdom.server &
  • 启动后即可使用Web浏览器访问 http://localhost:8097
  • 在网页选择环境image-generation,通过图表查看训练过程中的pictureerror screenshot-2023-07-02 152247.png

About

This is an AI project that uses GAN to generate images.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages