GithubHelp home page GithubHelp logo

Comments (6)

ascust avatar ascust commented on June 3, 2024

Hi, it seems like adding a depth channel would enable 3D landmark fitting. The current landmark loss only assumes 2d landmark, so you might need to use a 3d landmark detector. Furthermore, for RGB pixel fitting, apart from fitting three color channels, you could also add a depth loss for each vertex projected to the image.

Not sure if I've made myself clear.

from 3dmm-fitting-pytorch.

rlczddl avatar rlczddl commented on June 3, 2024

Thanks for your reply. In fact, what I want is to fit the point-to-point error between bfm 3d face shape and point cloud converted from depth image, not just the depth error between face key points.And now, referring to https://github.com/yuhaoooo/Deep3DFaceReconstruction-Pytorch/blob/7c506b55adee55bb269f73354dd16d5327a7fb04/reconstruction_mesh.py , I have some ideas.

from 3dmm-fitting-pytorch.

rlczddl avatar rlczddl commented on June 3, 2024

Hi, I'm modifying the code to fit bfm to rgbd data. Unfortunately I ran into some problems. In the rigid fitting stage, I use the real camera parameter K from the calibration, and since the scale of the bfm face model is unknown, an additional scale parameter s is optimized. Now the projection equation of the 2d face keypoint is K(sR*p+T), but the optimization result of this step is always wrong. I don't know what went wrong. Do you have any suggestions? Here are some key codes:
image
image
image
image

from 3dmm-fitting-pytorch.

rlczddl avatar rlczddl commented on June 3, 2024

After some debugging, I found that the initial z value on self.camera_pose must be set to an initial value instead of 0, which indicates the distance between the camera and the bfm model, so that the rigid part can be optimized. Why is this?

from 3dmm-fitting-pytorch.

ascust avatar ascust commented on June 3, 2024

I am not really sure what is going on here. In terms of camera_pose z, I remember I set it to (0, 0, 10) and the camera is pointing at the origin (0, 0, -1). The reason for this is that the face mesh is supposed to be at the origin and given a proper focal length we can easily project the whole face on the image plane. If you put the camera at (0, 0, 0), it would be a bit weird because the camera and the mesh target are almost at the same point. Not sure if this is what you are talking about.

from 3dmm-fitting-pytorch.

rlczddl avatar rlczddl commented on June 3, 2024

Thanks for your answer. After several days of debugging, the problem has been solved. Now I use the umeyama algorithm to initialize scale, R, T. After that, I encountered the problem mentioned by the issue facebookresearch/pytorch3d#334 . Finally, I solved the problem by dividing the vertex by a fixed scale factor.

from 3dmm-fitting-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.