PRNet
PRNet copied to clipboard
A problem about the landmarks output
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 Those coordinates are listed in the Data/uv_kpt_ind.txt file.
@wungemach 是说关键点在uv上的位置是固定的吗
@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?
@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]]