写在前面
- 工作中遇到,简单整理,博文为
DAD-3DHeads
特征点标记、姿态评估、头部 3D 对齐 Demo - 理解不足小伙伴帮忙指正
不被喜欢的姑娘喜欢,是一件很伤心的事情,可天没有塌下来,该怎么活,还得怎么活。 ——烽火戏诸侯《剑来》
环境安装
克隆项目
https://github.com/PinataFarms/DAD-3DHeads.git
模型文件,如果没有科学上网,需要提前下载,放到家目录下: C:\Users\liruilong\.dad_checkpoints
dad_3dheads.trcd
: https://media.pinatafarm.com/public/research/dad-3dheads/dad_3dheads.trcd
创建虚拟环境
(base) C:\Users\liruilong\Documents\GitHub>cd DAD-3DHeads_Demo
(base) C:\Users\liruilong\Documents\GitHub\DAD-3DHeads_Demo>conda create --name DAD-3DHeads python=3.8
(base) C:\Users\liruilong\Documents\GitHub\DAD-3DHeads_Demo>conda activate DAD-3DHeads
(DAD-3DHeads) C:\Users\liruilong\Documents\GitHub\DAD-3DHeads_Demo>pip install -r requirements.txt -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
Looking in indexes: http://pypi.douban.com/simple/
运行 Demo 测试
68 个特征点标记
(DAD-3DHeads) C:\Users\liruilong\Documents\GitHub\DAD-3DHeads_Demo> python demo.py images\\demo_heads\\1.jpeg outputs 68_landmarks
面部曲面标记
(DAD-3DHeads) C:\Users\liruilong\Documents\GitHub\DAD-3DHeads_Demo> python demo.py images/demo_heads/1.jpeg outputs face_mesh
头部3D曲面标记
python demo.py images/demo_heads/1.jpeg outputs head_mesh
姿态评估
python demo.py images/demo_heads/1.jpeg outputs pose
其他的所有 Demo
python demo.py <path/to/input/image.png> <path/to/output/folder> <type_of_output>
# Visualize 68 2D face landmarks
python demo.py images/demo_heads/1.jpeg outputs 68_landmarks
# Visualize 191 2D face landmarks
python demo.py images/demo_heads/1.jpeg outputs 191_landmarks
# Visualize 445 2D face landmarks
python demo.py images/demo_heads/1.jpeg outputs 445_landmarks
# Visualize face mesh
python demo.py images/demo_heads/1.jpeg outputs face_mesh
# Visualize head mesh
python demo.py images/demo_heads/1.jpeg outputs head_mesh
# Visualize head pose
python demo.py images/demo_heads/1.jpeg outputs pose
# Get 3D mesh .obj file
python demo.py images/demo_heads/1.jpeg outputs 3d_mesh
# Get flame parameters .json file
python demo.py images/demo_heads/1.jpeg outputs flame_params
标签:DAD,python,3DHeads,py,jpeg,Demo,demo From: https://blog.51cto.com/liruilong/6509617