choyingw / SynergyNet

3DV 2021: Synergy between 3DMM and 3D Landmarks for Accurate 3D Facial Geometry
MIT License
380 stars 57 forks source link

Face orientation #23

Open yjhong89 opened 2 years ago

yjhong89 commented 2 years ago

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)

choyingw commented 2 years ago

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

choyingw commented 2 years ago

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

yjhong89 commented 2 years ago

@choyingw, thank you!

yjhong89 commented 2 years ago

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

choyingw commented 2 years ago

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

yjhong89 commented 2 years ago

@choyingw Thank you!

yjhong89 commented 2 years ago

@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 ?

Thanks you again.

YJHong.

yjhong89 commented 2 years ago

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)
...