microsoft / Deep3DFaceReconstruction

Accurate 3D Face Reconstruction with Weakly-Supervised Learning: From Single Image to Image Set (CVPRW 2019)
MIT License
2.2k stars 445 forks source link

Can I use 68 landmarks instead of 5 landmarks? #73

Open wuxiaolianggit opened 4 years ago

wuxiaolianggit commented 4 years ago

Can I use 68 landmarks instead of 5 landmarks?

KhurramPirov commented 4 years ago

Can I use 68 landmarks instead of 5 landmarks?

I think yes. In load_img.py insert your own landmarks loading with correct indices, from 68 you need [left_eyex, left_eyey, right_eye, nose_x, nose_y, left_mouth_x,..,right_mouth_x]. But in preprocess_img.py you don't need all until you will write your own function for getting translation and scaling parameters: # calculate translation and scale factors using 5 facial landmarks and standard landmarks of a 3D face t,s = POS(lm.transpose(),lm3D.transpose())

wuxiaolianggit commented 4 years ago

Thank you for your reply,Do you think it's better to have 5 or 68?

KhurramPirov commented 4 years ago

Thank you for your reply,Do you think it's better to have 5 or 68?

Depends on your applications, I have not dived deeply into even POS functions, but for most cases(except closed eyes) everything works well! The only thing I don't understand is mesh_renderer and the possibility to convert all functions into saved_model and use in tf20.

wuxiaolianggit commented 4 years ago

Thank you for your reply. Most of the performances are very good, but I don't think the expression on the mouth is particularly good. Have you found this problem? @ @KhurramPirov

wuxiaolianggit commented 4 years ago

How i can use 3D landmarks instead of 5 landmarks? @@KhurramPirov

KhurramPirov commented 4 years ago

Thank you for your reply. Most of the performances are very good, but I don't think the expression on the mouth is particularly good. Have you found this problem? @ @KhurramPirov

yeah, they stated this issue, you can tune the net better if you have rather diverse facial expressions 3d dataset

KhurramPirov commented 4 years ago

How i can use 3D landmarks instead of 5 landmarks? @@KhurramPirov

If you have 3d landmarks, just take only x, y components and reshape to the [5, 2] format again.

wuxiaolianggit commented 4 years ago

Thank you very much for your reply @KhurramPirov

ajclement commented 4 years ago

@KhurramPirov Did you use face alignment (recommended)? how did you choose they eye point? an average?

alter-sachin commented 4 years ago

What are applications of facial landmarks?

alter-sachin commented 4 years ago

I mean to ask can I use these landmarks to animate the face object ?

HOMGH commented 4 years ago

Can I use 68 landmarks instead of 5 landmarks?

I think yes. In load_img.py insert your own landmarks loading with correct indices, from 68 you need [left_eyex, left_eyey, right_eye, nose_x, nose_y, left_mouth_x,..,right_mouth_x]. But in preprocess_img.py you don't need all until you will write your own function for getting translation and scaling parameters: # calculate translation and scale factors using 5 facial landmarks and standard landmarks of a 3D face t,s = POS(lm.transpose(),lm3D.transpose())

@KhurramPirov , @wuxiaolianggit Hi, Do you know how can we extract 5 landmarks from 68 landmarks? For example for the AFLW3D dataset we have 68 landmarks, but I need 5 landmarks as the input of Preprocess function. Any advice? Thanks.

RaymondJiangkw commented 2 years ago

Can I use 68 landmarks instead of 5 landmarks?

I think yes. In load_img.py insert your own landmarks loading with correct indices, from 68 you need [left_eyex, left_eyey, right_eye, nose_x, nose_y, left_mouth_x,..,right_mouth_x]. But in preprocess_img.py you don't need all until you will write your own function for getting translation and scaling parameters: # calculate translation and scale factors using 5 facial landmarks and standard landmarks of a 3D face t,s = POS(lm.transpose(),lm3D.transpose())

@KhurramPirov , @wuxiaolianggit Hi, Do you know how can we extract 5 landmarks from 68 landmarks? For example for the AFLW3D dataset we have 68 landmarks, but I need 5 landmarks as the input of Preprocess function. Any advice? Thanks.

Hi,

I know it has been late. However, I think the function at this https://github.com/microsoft/DiscoFaceGAN/blob/master/preprocess/preprocess_utils.py?plain=1#L165-L175 might be useful. It is an utility function written by the same author of Deep3DRecon but for his another work "DisCoFaceGAN". Its function is exactly to calculate 5 facial landmarks using 68 landmarks.