SynergyNet icon indicating copy to clipboard operation
SynergyNet copied to clipboard

Face orientation

Open yjhong89 opened this issue 2 years ago • 8 comments

Hi, I am YJHong and thanks for sharing great work!

I checked code measuring landmark alignment (NME, benchmark_alfw2000.py) though, couldn't find any related code for measuring face orientation (pitch/yaw/roll).

Would you let me know how measure face orientation given 3d landmarks ? (or any related code / repo)

  • Have you used cv2.solvePnP function for estimating euler angle ?

yjhong89 avatar Sep 30 '22 05:09 yjhong89

This line https://github.com/choyingw/SynergyNet/blob/d34e4afd6adbb9d5339366e3e74cde709d5895ae/benchmark.py#L183

choyingw avatar Sep 30 '22 06:09 choyingw

3DMM builds posed meshes and 3D landmarks and face orientation are directly from meshes. There is no need to solve a PnP problem.

choyingw avatar Sep 30 '22 06:09 choyingw

@choyingw, thank you!

yjhong89 avatar Sep 30 '22 07:09 yjhong89

How did you make this files ? I downloaded AFLW2000 from here and there is only mat file containing Pose param and pts3d. Is Pose param containing yaw/pitch/roll ?

https://github.com/choyingw/SynergyNet/blob/d34e4afd6adbb9d5339366e3e74cde709d5895ae/benchmark.py#L189

yjhong89 avatar Sep 30 '22 07:09 yjhong89

They're processed by FSA's script https://github.com/shamangary/FSA-Net/blob/master/data/type1/TYY_create_db_type1.py

specifically, pitch = pose_para[0] * 180 / np.pi yaw = pose_para[1] * 180 / np.pi roll = pose_para[2] * 180 / np.pi

choyingw avatar Sep 30 '22 21:09 choyingw

@choyingw Thank you!

yjhong89 avatar Oct 01 '22 13:10 yjhong89

@choyingw Sorry for bothering you agian.

As you mentioned and based on script, I followed this code (https://github.com/shamangary/FSA-Net/blob/master/data/type1/TYY_create_db_type1.py) and remove data which have yaw angles outside the range [-99, 99] This is code snippet.

pose_para = mat_contents["Pose_Para"][0]
pitch = pose_para[0] * 180 / np.pi
yaw = pose_para[1] * 180 / np.pi
roll = pose_para[2] * 180 / np.pi

if np.abs(yaw) < 99:
    cont_labels = np.array([yaw, pitch, roll])
    out_poses.append(cont_labels)
...

But when I counted the number of data which have absolute yaw angle outside 99 degree, there are only 6 samples (in 2000) while 31 samples are noted in your paper (SynergyNet) image

Would you let me know what should I do more for face orientation evaluation ?

  • BTW, do you know how GT pitch/yaw/roll degrees are derived ? (can we believe this is real true degree ?)

Thanks you again.

YJHong.

yjhong89 avatar Oct 04 '22 05:10 yjhong89

When I change the code as below, the number of filtered samples is exactly 31

pose_para = mat_contents["Pose_Para"][0]
pitch = pose_para[0] * 180 / np.pi
yaw = pose_para[1] * 180 / np.pi
roll = pose_para[2] * 180 / np.pi

if np.abs(yaw) > 99 or np.abs(pitch) > 99 or np.abs(roll) > 99 :
    pass
else:
    cont_labels = np.array([yaw, pitch, roll])
    out_poses.append(cont_labels)
...

yjhong89 avatar Oct 04 '22 08:10 yjhong89