Coder Social home page Coder Social logo

Comments (13)

YuDeng avatar YuDeng commented on July 17, 2024 3

Hi, the rotation stores the three Euler angles (in rad) w.r.t to three rotation axis (x,y,z axis). The translation stores the xyz shift (in dm) w.r.t the origin in the world coordinate space. For more details, you can check https://github.com/sicxu/Deep3DFaceRecon_pytorch/blob/master/models/bfm.py

from deep3dfacerecon_pytorch.

YuDeng avatar YuDeng commented on July 17, 2024

Hi, to generate obj file with frontal face, you need to change the predicted pose parameters to zeros.
You can modify the angles and translation here:

angles = coeffs[:, 224: 227]

from deep3dfacerecon_pytorch.

Michaelwhite34 avatar Michaelwhite34 commented on July 17, 2024

Hi, to generate obj file with frontal face, you need to change the predicted pose parameters to zeros.
You can modify the angles and translation here:

angles = coeffs[:, 224: 227]

Thanks for you reply! Do I just need to use "angles = coeffs[0, 0: 0]" ?

from deep3dfacerecon_pytorch.

Michaelwhite34 avatar Michaelwhite34 commented on July 17, 2024

Also,assuming the face is front in the 3d scene,how to output the camera data that is used for the overlay comparison (i.e the camera position rotation and focal length) ? (P.S. sorry for the stupid questions,I am not really familar with all this)

from deep3dfacerecon_pytorch.

YuDeng avatar YuDeng commented on July 17, 2024

You just simply set angles = coeffs[:, 224: 227] *0 would be fine.

In our work we set the camera position at [0,0,10] with a fixed focal length of 1015. And the camera is looking at [0,0,0] which is the origin of the world coordinate. The predicted angles and translation in "coeff" are rotation and shift for the 3d face w.r.t the world coordinate. With the above information, you should be able to render a face image aligned with the input face.

from deep3dfacerecon_pytorch.

Michaelwhite34 avatar Michaelwhite34 commented on July 17, 2024

Thank you ! btw by saying the camera information I mean the "transformed" information (the camera look at the face so it will rotate as the face rotate to front view)..Can I output that information to cmd window ? (I know it can be computed from the face rotation and translation but direct output would be convenient)

from deep3dfacerecon_pytorch.

YuDeng avatar YuDeng commented on July 17, 2024

In our case we do not record the camera extrinsic parameters but only face rotations and translations. So I think you may need to compute it by yourself.

from deep3dfacerecon_pytorch.

Michaelwhite34 avatar Michaelwhite34 commented on July 17, 2024

That's alright,I can do this by camera tracking in blender.Then can I output the translation and rotation of face to cmd window (in a manner that (x,y,z) for translation and another(x,y,z) for rotation)?

from deep3dfacerecon_pytorch.

YuDeng avatar YuDeng commented on July 17, 2024

The default output already contains these information. If you check the test section, the output .mat file contains the "coeffs". If you just want to print them in the cmd window, you can modify the function here:

model.save_coeff(os.path.join(visualizer.img_dir, name.split(os.path.sep)[-1], 'epoch_%s_%06d'%(opt.epoch, 0),img_name+'.mat')) # save predicted coefficients

I'm not sure if this is what you expect.

from deep3dfacerecon_pytorch.

Michaelwhite34 avatar Michaelwhite34 commented on July 17, 2024

What’s the exact meaning of array in rotation and translation ? Do they mean sin value of angle and meter in distance respectively ?

from deep3dfacerecon_pytorch.

Michaelwhite34 avatar Michaelwhite34 commented on July 17, 2024

The default output already contains these information. If you check the test section, the output .mat file contains the "coeffs". If you just want to print them in the cmd window, you can modify the function here:

model.save_coeff(os.path.join(visualizer.img_dir, name.split(os.path.sep)[-1], 'epoch_%s_%06d'%(opt.epoch, 0),img_name+'.mat')) # save predicted coefficients

I'm not sure if this is what you expect.

Could you tell me the exact meaning of the array stored in rotation and translation?

from deep3dfacerecon_pytorch.

Michaelwhite34 avatar Michaelwhite34 commented on July 17, 2024

Hi, the rotation stores the three Euler angles (in rad) w.r.t to three rotation axis (x,y,z axis). The translation stores the xyz shift (in dm) w.r.t the origin in the world coordinate space. For more details, you can check https://github.com/sicxu/Deep3DFaceRecon_pytorch/blob/master/models/bfm.py

I did an experiment about translation and rotation.I have 3 meshes,one disabled rotation(1),one disable translation(2) and one disabled both(3).I try to match them with the given rotation and translation parameter.
Screenshot from 2021-09-22 20-15-49 (left is rotation right is translation)
Screenshot from 2021-09-22 20-15-10 (mesh 1 and mesh 3 coincide with output translation)

Screenshot from 2021-09-22 20-15-29
However mesh 2 and mesh 3 won't even be close with the output rotation(transfer from rad to degree which is *180/pi).I try to align them manually and get the rotation (-5.2,7.63,42.8)(in degree) (not perfect but very close)...Do you know what's going on here ?

from deep3dfacerecon_pytorch.

Michaelwhite34 avatar Michaelwhite34 commented on July 17, 2024

hi,how can I export the original bounding box without resizing to 224*224 ? I want to use that for texture projection.

from deep3dfacerecon_pytorch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.