CycleGan 动漫人像生成实现(附带源码)

介绍

利用 CycleGan 进行动漫人像生成,模型详解介绍见 Reference [1]

Gitee 源码地址https://gitee.com/futurelqh/deep-learning/tree/master/CycleGANProject-master

在这里插入图片描述

环境配置

配置python

conda create -n face python=3.8

conda activate face

安装torch

pip3 install torch torchvision torchaudio (官网下载 torch)

安装 TensorFlow

pip install tensorflow -i https://pypi.tuna.tsinghua.edu.cn/simple

其他包

pip install visdom -i https://pypi.tuna.tsinghua.edu.cn/simple

pip install tqdm -i https://pypi.tuna.tsinghua.edu.cn/simple

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple face_alignment

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple CMake (注意:CMake 必须在dlib之前安装,否则安装 dlib 会报错)

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple dlib

常见问题

没有 cuda 或者无法正常使用 cuda 可以先改为 cpu 运行
在这里插入图片描述

设置迭代的次数,先设置小一点,看能否成功
在这里插入图片描述

注意这里加载字典参数也需要设置 map_location=‘cpu’
在这里插入图片描述

注意 TensorFlow 不同版本之间的调用存在区别
在这里插入图片描述

Reference

[1] https://blog.csdn.net/dqcfkyqdxym3f8rb0/article/details/106030098 模型介绍

[2] https://blog.csdn.net/iiiiiiimp/article/details/118701276 另一个不错的项目

猜你喜欢

转载自blog.csdn.net/qq_46450354/article/details/129415605#comments_25858883