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

PULSE-for-chs


项目内容

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

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



效果展示

黄种人脸投射器


矫正对比

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-mUXMnFeW-1599186459018)(./readme_resources/race_yellow.jpg)]

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


单幅输出

在这里插入图片描述


输入(32x32)




输出(1024x1024)


赠品:明星脸投射器

在这里插入图片描述


输入(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!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值