Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output format / BVH Writer / 3D rendering tool #6

Closed
j-min opened this issue Jul 4, 2019 · 4 comments
Closed

Output format / BVH Writer / 3D rendering tool #6

j-min opened this issue Jul 4, 2019 · 4 comments

Comments

@j-min
Copy link

j-min commented Jul 4, 2019

After running run_pipelines.sh, I got results in body_3d_frontal_tracking directory as below.

Screenshot from 2019-07-04 14-21-46

According to writeFrameParam, this seems like parameters for Adam.
I found c++ scripts (BVHWriter.cpp and BVHWriter.h) for writing skeletons in BVH format. However, these scripts do not seem to be used in this project.
Is there a way that I can get motion captures in BVH or any format that can be used in 3D rendering tools (ex. Blender)?

@xiangdonglai
Copy link
Collaborator

You can try to use our BVHWriter code, but this is not guaranteed as it is not a core part of our work. An example is

// 'g_total_model' is an object of Adam model
BVHWriter bvhwriter(g_total_model.m_parent);
// 'J0_vec' is the T-pose skeleton, 'ts' and 'poses' are vectors of global translation and pose parameters for different time steps.
bvhwriter.parseInput(J0_vec, ts, poses);
bvhwriter.writeBVH(std::string("temp.bvh"), 1.0/30);

@j-min
Copy link
Author

j-min commented Jul 9, 2019

Could you please elaborate more in detail what g_total_model.m_parent, J0_vec, ts and poses are?
How can we find these values in code and paper?
Can these be read from output file so that we can run this script as standalone?
If not, where should we put the example code in run_fitting.cpp?

g_total_model.m_parent seems to be initialized here.
Is this just an initialization constant for Adam model for any skeleton in any time step?

What does 'J0_vec is the T-pose skeleton' mean? Where can we obtain value for J0_vec?

Does ts correspond to this, and poses correspond to this?

@xiangdonglai
Copy link
Collaborator

g_total_model is initialized after calling

    // initialize total model
    LoadTotalModelFromObj(g_total_model, std::string("model/mesh_nofeet.obj"));
    LoadModelColorFromObj(g_total_model, std::string("model/nofeetmesh_byTomas_bottom.obj"));  // contain the color information
    LoadTotalDataFromJson(g_total_model, std::string("model/adam_v1_plus2.json"), std::string("model/adam_blendshapes_348_delta_norm.json"), std::string("model/correspondences_nofeet.txt"));
    LoadCocoplusRegressor(g_total_model, std::string("model/regressor_0n1_root.json"));

J0_vec is the zero-pose skeleton for the BVH file, it is compute here.

You are right about ts and poses. You need vectors of both of them that contain the results for every frame. To be simple, you can create another executable where you initialize the model, read in the produced result files and call BVHWriter.

@xiangdonglai
Copy link
Collaborator

If you are still interested in exporting our estimated motion to BVH, we've provided an example in C++ that uses our BVH exporter.

Please checkout 'FitAdam/bvh.cpp'. After recompiling the C++ project, you can 'cd FitAdam/' and run './build/bvh'; it will generate an 'output.bvh' file containing the first 10 frames of the dancing sequence (assuming you have already generated our estimation result).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants