carlosedubarreto / b3d_mocap_import

addon for blender to import mocap data from tools like easymocap, frankmocap and Vibe
106 stars 14 forks source link

Error when trying generating .pkl files from EasyMocap #14

Closed FrankSpalteholz closed 3 years ago

FrankSpalteholz commented 3 years ago

Dear Carlos,

I've tried to follow your guidelines on how to properly render out .pkl-files from EasyMocap, therefor i was replacing the 2 files like you've mentioned. After running a batch-file i got this error:

Traceback (most recent call last): File "apps/demo/mv1p.py", line 113, in mv1pmf_smpl(dataset, args) File "apps/demo/mv1p.py", line 72, in mv1pmf_smpl weight_shape=weight_shape, weight_pose=weight_pose) File "/media/frankfurt/Walhalla/Ubuntu/dev/EasyMocap/easymocap/pipeline/basic.py", line 58, in smpl_from_keypoints3d2d params_init = body_model.init_params(nFrames=1) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 576, in getattr type(self).name, name)) AttributeError: 'SMPLlayer' object has no attribute 'init_params'

For rendering i'm using the following command: (which is quite likely wrong but maybe you can help me how to set the parameters correct) ... one more note: I'm running the out-of-the box-easymocap example and i'm aiming for body and hands as outputs (you already told me that you've implemented body and hands within your great Blender-addon)

EasyMocap-run-command: python3 apps/demo/mv1p.py ${data} --out ${out}/smplx --vis_det --vis_repro --undis --sub_vis 1 7 13 19 --body bodyhandface --model smplx --gender male --vis_smpl

Thank you so much!

Edit: also tried this one with the same error: python3 apps/demo/mv1p.py ${data} --out ${out}/b3d --vis_det --vis_repro --undis --sub_vis 1 7 13 19 --body bodyhand --model smplh --gender male --vis_smpl

carlosedubarreto commented 3 years ago

Hi Frank,

I'll try to get the updated version of easymocap today to see what is needed for you to make it work without those file changes. (that looks like it is not working anymore)

carlosedubarreto commented 3 years ago

links to the new version 0.722 that made possible to use the oficial way to bring full body and fingers to blender

https://www.patreon.com/posts/52642711 https://gumroad.com/l/mocap_import https://github.com/carlosedubarreto/b3d_mocap_import

to get this data, you should update to the latest version of easymocap (it was updated a couple of hours ago, and the developer added something that was missing)

and use this option --write_smpl_full

for example, this code should make a new folder called SMPL_FULL with the data (json files) to be imported using mocap import

python apps/demo/mv1p.py 0_input/sample --out 1_output/sample/smplx --vis_det --vis_repro --undis --sub_vis 1 7 13 19 --body bodyhandface --model smplx --gender male --vis_smpl --write_smpl_full

FrankSpalteholz commented 3 years ago

Will test it asap and will let you know. Thank you so much Carlos.

FrankSpalteholz commented 3 years ago

So alright: i guess we are coming closer towards awesomeness: Here is my progress so far:

  1. Exported smpl_full from latest EasyMocap-version

    • here is a example of the first json-file json0000_smpl_full
  2. Mocap Plug (v 0.0.722 was loading successfully)

    • but then i have 2 options (at least i think)

(24 points got imported into the scene though .. but without animation)

what did i wrong?

carlosedubarreto commented 3 years ago

the option 2.1 you can use to import the data in the keypoints3d folder (or a name similar to that) the option 2.2 you have to use a SMPLx fbx model that you can have it using the SMPLX addon for blender.

You use the addon to generate the character (male, female or neutral) then export it to FBX.

This model you should use when importing the files in SMPL_FULL

FrankSpalteholz commented 3 years ago

It WORKS!!! Man thank you so much for your patience with me. It's like always when you do things at the first time. After getting it it looks so simple and obvious. I couldn't get option 2.1 running though but this hint regarding option 2.2 and using the smplx-blender-addon is what i wanted anyways. I made some mistakes on the EasyMocap-export too since i was using wrong flags i guess (using smplh instead of smplx and bodyhand instead of bodyhandface) Anyways ... Thank you VERY much again Carlos!

carlosedubarreto commented 3 years ago

Thats great.. Hope you are able to do many cool things.

This week I'll start creating animations to my project, so, I'll start to put into practice all the work I've done with mocap_import. So, probably in few weeks I might notice some room for improvement on the addon, to help us creating cool animations easily

FrankSpalteholz commented 3 years ago

I hope so. I'm used to use Maya for 14 years now working as 3D-generalist but in Blender i still feel like a noob. Last question. One killer-feature of those smplx-model is the integrated correction-shapes for all body-parts. I'm totally familiar with this technically. I also found the Shape-Keys (it is called in blender - in maya its called corrective blend-shapes) Anyways. They are animated when i import the EasyMocap-smpl-full-data. So can i assume that the corrective-shape feature had been implemented in your add-on too? (this seems to be a redundant question but i'm just double checking here)

So since i'm more familiar with calibration i've realized that i could propably speed-up this whole extrensic-generation-process when using Aruco-markers instead of purely OpenCV. Therefore someone would only shoot one single image from each cam and getting global position and rotation. This is what i will do next and maybe i can contribute some helpful tools too so that your time wasn't just helping a kid getting his toy run :D ...

carlosedubarreto commented 3 years ago

To be honest, i used the script that already existed for easymocap, and dont know enough to answer your question.

I did a very fast development, because I was just making the existing script to work on the addon. Maybe they are implemented. The code to import is complicated and I still dont understand it fully. All this first pass was made in the less time possible so it could be tested, and starting from that, it will be slowly corrected or implemented in the addon.

But there is a important thing to add.

I dont want to make the addon so dependent on SMPL/SMPLX because it cant be used commercially for free. This was another reason for me not to dive deep on it now.

I plan to try to create a fully opensource SMPL alternative, and by them, I'll probably know better about the corrective shape stuff.

carlosedubarreto commented 3 years ago

and about the calibration, anything to make it better/less horrible, would be appreciated LOL.. As this is by far the hardest part of the process. And thanks for sharing your knowledge, the name "Aruco-markers", can be helpfull for me to reserach about it, as I never heard of it 😅

But I wont research now, I'll probably spend some weeks animating and seeing what can be improved on the addon first.

Thanks a lot!!!

FrankSpalteholz commented 3 years ago

"To be honest, i used the script that already existed for easymocap, and dont know enough to answer your question." <- so its a nice accident then :D ... anyway ... yeah when i did a first successful calibration I will definitely get back to you with code and some insides. So talk soon i hope.