patrikhuber / eos

A lightweight 3D Morphable Face Model library in modern C++
Apache License 2.0
1.89k stars 596 forks source link

How to generate face image .pts file? #319

Closed leiBill closed 3 years ago

leiBill commented 3 years ago

I download your code . I use your python demo . But I don't know how to change a face image to a .pts file. So I can't run it 。。。 Would you like giving me a favor? Thank you first!

patrikhuber commented 3 years ago

Hi,

If you search through the issues (make sure to include the closed ones), you'll find plenty of advice and explanations of the pts files.

Thanks a lot.

ericzli commented 3 years ago

I search through the pts issues and got "how to generate face image .pts file": use dlib face_landmark_detection_ex tool

Memo: 下载eos源码,编译运行example(需事先装好opencv2和boost),这个没什么问题; 将example中的照片换了,发现跑不通,原因是还需要准备一个pts文件,从issue看,估计都卡在这个pts文件了; 这个pts其实就是脸部轮廓的68个点,其实pts本身就是文本文件,打开就能看明白,重点是怎么“输入一张照片,输出pts文件”; 方法是下载dlib,在windows下编译example并运行face_landmark_detection_ex工具(由于该工具依赖GUI,所以在linux下默认不编译,但去掉GUI也不难),发现它只打印出68个点的前2个,所以改成打印所有点就好,然后坐标值在原基础上再除以2(受摘星摘月启发),打印格式参考pts文件。