20210513:人脸识别-face3d: Python tools for processing 3D face

Github地址:https://github.com/YadiraF/face3d

示例:

3dmmpython 2_3dmm.py

left: random example generated by 3dmm

right: fitting face with 3dmm using 68 key points

transform. python 3_transform.py
left:

fix camera position & use orthographic projection. (often used in reconstruction)

then transform face object: scale, change pitch angle, change yaw angle, change roll angle

right:

fix obj position & use perspective projection(fovy=30). (simulating real views)

then move camera position and rotate camera: from far to near, down & up, left & right, rotate camera

lightpython 4_light.py

single point light: from left to right, from up to down, from near to far

image map python 6_image_map.py

render different attributes in image pixels.

: depth, pncc, uv coordinates

uv map python 7_uv_map.py

render different attributes in uv coordinates.

: colors(texture map), position(2d facial image & corresponding position map)

Prerequisite

  • Python 2 or Python 3

  • 需要以下依赖包

    • numpy
    • skimage (for reading&writing image)
    • scipy (for loading mat)
    • matplotlib (for show)
    • Cython (for compiling c++ file)

Usage

1.克隆该项目

git clone https://github.com/YadiraF/face3d
cd face3d

2.如果使用C++版本,则需要编译,如果使用numpy版本,可跳过该步

注意:需要修改以下文件

 mesh_core.cpp (line 349)

    ofstream obj_file(filename);

变为以下:

    ofstream obj_file(filename.c_str());

然后编译:

cd face3d/mesh/cython
python setup.py build_ext -i 

3.准备BFM数据(如果不使用3dmm,则可以忽略该步)

链接:https://github.com/YadiraF/face3d/blob/master/examples/Data/BFM/readme.md

4.运行examples.[默认使用cython版本,可以把mesh修改为mesh_numpy,来运行numpy版本]

cd examples
python 1_pipeline.py 

原作者注释:

对于希望继续研究3D面孔的初学者,我强烈建议您首先按照顺序运行示例,然后查看mesh_numpy中的代码并阅读每个文件开头的注释。 希望这可以帮助!

此外,我是计算机图形学的新手,因此,如果您能指出我的一些错误表达,将不胜感激。 谢谢!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

微风❤水墨

你的鼓励是我最大的动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值