PRNet icon indicating copy to clipboard operation
PRNet copied to clipboard

A problem about the landmarks output

Open yyssmm opened this issue 5 years ago • 4 comments

Hello, thank you for sharing your code. But I have a question, how to get the coordinates of the 68 key-points on 2D input images? Thank you!

yyssmm avatar Sep 04 '18 10:09 yyssmm

@yyssmm Those coordinates are listed in the Data/uv_kpt_ind.txt file.

wungemach avatar Sep 27 '18 15:09 wungemach

@wungemach 是说关键点在uv上的位置是固定的吗

Joll123 avatar Nov 02 '18 03:11 Joll123

@wungemach To my understanding, the final output of PRNet is the U-V position map which includes 3-D coordinate of vertex corresponding to face model. How can 2-D landmarks be obtained through the position map?

DanielMao2015 avatar Sep 04 '19 04:09 DanielMao2015

@wungemach To my understanding, the final output of PRNet is the U-V position map which includes 3-D coordinate of vertex corresponding to face model. How can 2-D landmarks be obtained through the position map?

The generated U-V position is (256,256,3),the fix postion in './Data/uv-data/uv_kpt_ind.txt' directly defines the face keypoints in texture image. And, the 3D/2D landmarks for the input image can be obtained from the third dimension U-V position, that is

pos = prnet.forward()
idx = np.loadtxt('uv_kpt_ind.txt')
2D_kps = pos[idx[:,1],idx[:,0],:-1]
3D_kps = pos[idx[:,1],idx[:,0]]

1165048017 avatar Jan 07 '20 07:01 1165048017