# generators-with-stylegan2 **Repository Path**: sdbobli/generators-with-stylegan2 ## Basic Information - **Project Name**: generators-with-stylegan2 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 2 - **Created**: 2020-03-22 - **Last Updated**: 2022-03-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 基于StyleGAN2的新版人脸生成器 Read English Introduction:Here

  这儿是一批基于StyleGAN2制作的新版人脸生成器,即对于旧版的黄种人脸生成器网红脸生成器明星脸生成器超模脸生成器萌娃脸生成器进行了基于StyleGAN2的重制,使生成效果得到大幅提升。生成器的作用是可提供我们各种样式的人脸素材,供我们在多种场景下应用并有助于节省寻找真人(人脸)的成本,值得注意的是,每张人脸都是不存在于这个世界上的AI虚拟人物,他们独特且永不重复


## 新版的提升与价值何在?   基于StyleGAN2制作的版本消除了图片中水滴斑点和扭曲/损坏现象的出现,使生成的成功率接近100%(可参见下方随机生成的数据集),能被应用于大批量生成任务之中;另外图片的质量进一步提升,清晰度已逼近于官方训练所采用的数据集。我希望,这个项目能为影视、广告、游戏和医美工作者们助力,同时为普通爱好者们赋能。
  此项目已全部免费开源,希望能帮助到有需要的朋友。我现在处于研究生实习阶段,商业合作请不要再联系我,用户们自行使用并承担法律后果即可。模型版权所有为:www.seeprettyface.com ,若对您有帮助欢迎在底部赞助~


# 效果预览 ## 网红脸生成器   ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/wanghong.png)

  ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/example_wanghong.jpg)

  纯随机生成(无筛选)的一万张生成图片数据集:https://pan.baidu.com/s/1AqlNlTY0-tbEORPuKLdkqg 提取码:c7v9

## 明星脸生成器   ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/star.png)

  ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/example_star.jpg)

  纯随机生成(无筛选)的一万张生成图片数据集:https://pan.baidu.com/s/1LabQMFLsKkYK3hLgRCQ-0A 提取码:p43h

## 超模脸生成器   ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/model.png)

  ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/example_model.jpg)

  纯随机生成(无筛选)的一万张生成图片数据集:https://pan.baidu.com/s/1AT4q1JkMvAxWrHMs4Af1wg 提取码:vxf4

## 萌娃脸生成器   ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/kid.png)

  ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/example_kids.jpg)

  纯随机生成(无筛选)的一万张生成图片数据集:https://pan.baidu.com/s/1CQYQFiIdXxCSjJwSUo_tvw 提取码:4bd0

## 黄种人脸生成器   ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/yellow.png)

  ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/example_yellow.jpg)

  纯随机生成(无筛选)的一万张生成图片数据集:https://pan.baidu.com/s/1uC5fQ4UTALA1uU36Cgnnnw 提取码:rqvq

## 混血人脸生成器(非卖)   你知道长得最好看的人脸是什么样吗?我将中国明星脸生成器与世界超模脸生成器按精心调制的比例融合起来,制作出了此混血人脸生成器。此生成器合成的人脸具备独特且卓绝的美学风格(用户的评价是“马夸特面具融入了东方人的韵味”),是我认为目前AI画出的最好看的人脸生成器。然而此生成器已被买断属于非卖品。
  ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/mixed-blood.png)

  ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/example_mixed-blood.jpg)



# 环境配置   · Both Linux and Windows are supported. Linux is recommended for performance and compatibility reasons.
  · 64-bit Python 3.6 installation. We recommend Anaconda3 with numpy 1.14.3 or newer.
  · TensorFlow 1.14 or 1.15 with GPU support. The code does not support TensorFlow 2.0.
  · On Windows, you need to use TensorFlow 1.14 — TensorFlow 1.15 will not work.
  · One or more high-end NVIDIA GPUs, NVIDIA drivers, CUDA 10.0 toolkit and cuDNN 7.5. To reproduce the results reported in the paper, you need an NVIDIA GPU with at least 16 GB of DRAM.
  · Docker users: use the provided Dockerfile to build an image with the required library dependencies.
  - On Windows, the compilation requires Microsoft Visual Studio to be in PATH. We recommend installing Visual Studio Community Edition and adding into PATH using "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat".
  我的测试环境配置为:Win10,1050Ti,CUDA 10.0,CuDNN 7.6.5,tensorflow-gpu 1.14.0,VS2017可完美运行。

## Windows下常见问题 :Could not find MSVC/GCC/CLANG installation on this computer如何解决?   在安装VS2017/VS2019时一定要将‘使用C++的桌面开发’选上(如下图所示) ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/SMVC_solution/solution1.png)   装好之后进入C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/ 目录下会有一个版本号的文件夹,将版本替换为dnnlib/tflib/custom_ops.py 29行的对应版本号(那是我安装的版本),如下图所示。 ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/SMVC_solution/solution2.png) # 运行步骤   1.在networks文件夹中按照txt地址下载对应模型,放在该位置
  2.在main.py中选择对应的模型和生成数量,并运行main.py



# 赠品:基于StyleGAN2的属性编辑器   基于StyleGAN2的属性编辑器(edit_photo.py)包含了与旧版属性编辑器基本相同的内容,含有21种可调整的方向,可实现简单的人脸属性编辑。此属性编辑器适用于此项目的所有生成器(即黄种人、网红脸、明星脸、超模脸、萌娃脸和混血脸)以及官方生成器。

## 调整样例
下述样例均采用黄种人脸生成器。
## 1.调整笑容 ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/edit_photo/change_smile.jpg)


## 2.调整年龄 ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/edit_photo/change_age.jpg)


## 3.调整水平角度 ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/edit_photo/change_horizontal.jpg)


## 4.调整竖直角度 ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/edit_photo/change_vertical.jpg)


## 5.调整性别 ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/edit_photo/change_gender.jpg)


## 6.调整颜值 ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/edit_photo/change_beauty.jpg)


## 7.调整脸型 ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/edit_photo/change_face_shape.jpg)


## 8.调整眼睛开合 ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/edit_photo/change_eyes_open.jpg)


## 9.调整是否佩戴眼镜 ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/edit_photo/change_glasses.jpg)


## 10.增添/减弱一些生气的情绪 ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/edit_photo/change_emotion_angry.jpg)


## 11.增添/减弱一些厌恶的情绪 ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/edit_photo/change_emotion_disgust.jpg)


## 12.增添/减弱一些害怕的情绪 ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/edit_photo/change_emotion_fear.jpg)


## 13.增添/减弱一些开心的情绪 ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/edit_photo/change_emotion_happy.jpg)


## 14.增添/减弱一些沮丧的情绪 ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/edit_photo/change_emotion_sad.jpg)


## 15.增添/减弱一些惊讶的情绪 ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/edit_photo/change_emotion_surprise.jpg)


## 16.增添/减弱一些平静的情绪 ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/edit_photo/change_emotion_easy.jpg)


## 17.调整脸的宽度 ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/edit_photo/change_width.jpg)


## 18调整脸的高度 ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/edit_photo/change_height.jpg)


## 19.调整向黑种人衍变 ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/edit_photo/change_race_black.jpg)


## 20.调整向黄种人衍变 ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/edit_photo/change_race_yellow.jpg)


## 21.调整向白种人衍变 ![Image text](https://github.com/a312863063/generators-with-stylegan2/blob/master/examples/edit_photo/change_race_white.jpg)




## 更多尝试:合成会说话的人脸视频   推荐Few Shot Vid-to-vid(点此跳转)方法(效果如下图所示)。


![Image text](https://github.com/NVlabs/few-shot-vid2vid/raw/master/imgs/mona_lisa.gif)



# 了解技术原理 & 获取训练集:[点此进入](http://www.seeprettyface.com/) ![Image text](https://github.com/a312863063/seeprettyface/blob/master/EP001-01.png)


## 小小的赞助~

Sample

若对您有帮助可给予小小的赞助~