【seeprettyface.com】开源源码:PULSE-for-chs

PULSE-for-chs


项目内容

  在做人脸超分任务的时候,发现PULSE的结果不是很接地气,超分的结果经常变成欧美人的样貌。这个Github提供的模型对生成脸域做了黄种人限制,使得超分的结果都是黄种人。另外附赠了一个明星脸域的生成器(纯属好玩)。

  Github link: https://github.com/a312863063/PULSE-for-chs 。



效果展示

黄种人脸投射器


矫正对比

第1行:输入;第2行:PULSE输出;第3行:黄种人投射器输出。


单幅输出

在这里插入图片描述


输入(32x32)




输出(1024x1024)


赠品:明星脸投射器

【seeprettyface.com】开源源码:PULSE-for-chs_第1张图片


输入(32x32)




输出(1024x1024)
(虽然和真实明星的人脸有一定差距,但这不失为解决特定领域人脸超分任务的一种思路)


Usage

The main file of interest for applying PULSE is run.py. A full list of arguments with descriptions can be found in that file; here we describe those relevant to getting started.

Prereqs

You will need to install cmake first (required for dlib, which is used for face alignment). Currently the code only works with CUDA installed (and therefore requires an appropriate GPU) and has been tested on Linux and Windows. For the full set of required Python packages, create a Conda environment from the provided YAML, e.g.

conda create -f pulse.yml 

or (Anaconda on Windows):

conda env create -n pulse -f pulse.yml
conda activate pulse

In some environments (e.g. on Windows), you may have to edit the pulse.yml to remove the version specific hash on each dependency and remove any dependency that still throws an error after running conda env create...(such as readline)

dependencies
  - blas=1.0=mkl
  ...

to

dependencies
  - blas=1.0
 ...

Finally, you will need some pretrained weight files in ./cache/.The download address is in the .txt file in the ./cache/ folder.

Data

By default, input data for run.py should be placed in ./input/ (though this can be modified). However, this assumes faces have already been aligned and downscaled. If you have data that is not already in this form, place it in realpics and run align_face.py which will automatically do this for you. (Again, all directories can be changed by command line arguments if more convenient.) You will at this stage pic a downscaling factor.

Note that if your data begins at a low resolution already, downscaling it further will retain very little information. In this case, you may wish to bicubically upsample (usually, to 1024x1024) and allow align_face.py to downscale for you.

Applying PULSE

Once your data is appropriately formatted, all you need to do is

python run.py

Enjoy!

你可能感兴趣的:(PULSE)