cleardusk / 3DDFA

The PyTorch improved version of TPAMI 2017 paper: Face Alignment in Full Pose Range: A 3D Total Solution.
MIT License
3.61k stars 653 forks source link

C++ #141

Closed ammarali32 closed 4 years ago

ammarali32 commented 4 years ago

Hello i want to ask you about the possibility to run this model in c++ the requirements or if you have a c++ , java version. thanks in advance

cleardusk commented 4 years ago

You may use c++ port of pytorch to run it. Someone did it, but I did not.

ammarali32 commented 4 years ago

thanks, Do you know him or how I can contact him?

antithing commented 4 years ago

@ammarali32 Hi! Did you manage to run this code in c++ ? Thanks!

ammarali32 commented 4 years ago

@antithing Not actually because the model is locked i tried to convert it to PB frozen model to use OpencvDNN to read it but unfortunately, it doesn't work fine as well for ONNX so right now I am working on something else.

cleardusk commented 4 years ago

Welcome for any contributions of C++ or other ports : )

ammarali32 commented 4 years ago

I would like to write a c++ inference could you please provide your model in TensorFlow inference i already did it for PRNet.

ammarali32 commented 4 years ago

I am implementing your code in c++ could you please clarify this point for me? vertex = p @ (u_base + w_shp_base @ alpha_shp + w_exp_base @ alpha_exp).reshape(3, -1, order='F') + offset

ammarali32 commented 4 years ago

Please clarify the usage of @ operation here also the whitening pkl file is for metadata how it designed or its architecture to be able to read it using c++

lexuszhi1990 commented 4 years ago

Please clarify the usage of @ operation here also the whitening pkl file is for metadata how it designed or its architecture to be able to read it using c++

https://github.com/cleardusk/3DDFA/issues/27

lucasjinreal commented 2 years ago

@ammarali32 how's your c++ implementation goes? Any progress can be shared?

ammarali32 commented 2 years ago

@jinfagang https://github.com/cleardusk/3DDFA/tree/master/c%2B%2B

lucasjinreal commented 2 years ago

@ammarali32 thanks, does this also portable for 3DDFA v2 version?

ammarali32 commented 2 years ago

@jinfagang Yes but you need to change the STD and MEAN values. Also, the detector on 3DDFA v2 is Faceboxes Authors already provided the ONNX model but you need to specify the input shape to be fixed in the architecture to work on OpenCV otherwise you need to build ONNX runtime on c++ or PyTorch

lucasjinreal commented 2 years ago

@ammarali32 I have switched detector part to SCRFD and have a workable python demo already. Just curious on TFFDA part if I can using your code directly, that would be very nice.