Deep3DFaceReconstruction icon indicating copy to clipboard operation
Deep3DFaceReconstruction copied to clipboard

Can I use 68 landmarks instead of 5 landmarks?

Open wuxiaolianggit opened this issue 4 years ago • 13 comments

Can I use 68 landmarks instead of 5 landmarks?

wuxiaolianggit avatar Apr 30 '20 10:04 wuxiaolianggit

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 avatar Apr 30 '20 12:04 KhurramPirov

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

wuxiaolianggit avatar Apr 30 '20 14:04 wuxiaolianggit

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.

KhurramPirov avatar Apr 30 '20 18:04 KhurramPirov

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 avatar May 06 '20 01:05 wuxiaolianggit

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

wuxiaolianggit avatar May 07 '20 12:05 wuxiaolianggit

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 avatar May 25 '20 13:05 KhurramPirov

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.

KhurramPirov avatar May 25 '20 13:05 KhurramPirov

Thank you very much for your reply @KhurramPirov

wuxiaolianggit avatar May 26 '20 01:05 wuxiaolianggit

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

ajclement avatar Jun 16 '20 19:06 ajclement

What are applications of facial landmarks?

alter-sachin avatar Jul 29 '20 13:07 alter-sachin

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

alter-sachin avatar Aug 05 '20 03:08 alter-sachin

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.

HOMGH avatar Oct 05 '20 16:10 HOMGH

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.

RaymondJiangkw avatar Aug 01 '22 13:08 RaymondJiangkw