yohanshin / WHAM

MIT License
682 stars 74 forks source link

Import PKL to Blender #52

Closed carlosedubarreto closed 8 months ago

carlosedubarreto commented 8 months ago

I saw that there was another issue with the tip to get the code from VIBE, I did some rewrite to that code and put in a blend file to be easier to use.

Just need to install joblib in blender (there is a tab with the installation script) and add the SMPL fbx for male on the same folder as you have the blend file, and put the path to the pkl file.

Hope its useful loading_WHAM_import_SMPL_FINAL.zip

carlosedubarreto commented 8 months ago

I made a video showing the process on google colab and on how to use the blend file.

you can see it in youtube : https://youtu.be/7heJSFGzxAI

or on my patreon site: https://www.patreon.com/posts/wham-in-google-97760199

If you have problems understanding what I'm saying, there is closed caption available.

mrEuler commented 8 months ago

@carlosedubarreto you are fast man! BTW your 4d humans plugin helped a lot, but would be cool, if your plugins would support linux systems :)

carlosedubarreto commented 8 months ago

@mrEuler LOL. Took me more than a week to make it work, I consider that slow 😁 and was able to make it work only because 2 other people helped me.

Oh, about linux, that is complicated, since I do a workaround to make the process use a different python than the blender one, this way I'm sure it wont cause problems to blender versions and the heavy data that is installed is interchangeable iwth other versions of blender inside the user pc.

I could probably do some code for it to work on linux, but, to be honest I hardly have time to code for windows, that is my main system.

To be able to make for linux I would need to work full time on this, something I cannot do or else I'll starve πŸ˜….

So I'm not saying that wont be linux versions, but it will be much more difficult for me to make them.

And thanks for the words 😍

mrEuler commented 8 months ago

@carlosedubarreto No worries, actually I was able to put everything from your plugin and blender inside the docker container and make it working almost everywhere, where CUDA is correct.

AlexMorgand commented 7 months ago

Hey @carlosedubarreto thank you so much for the blend file :)

carlosedubarreto commented 6 months ago

Just the script for the ones that dont have blender import_WHAM_in blender.txt

iamthephd commented 3 months ago

@carlosedubarreto Nice work for the blender script! Do you know how to apply the animation i.e. output from WHAM to Mixamo rig? I tried using changing the bone names, but the animation look weird...

h0han commented 2 months ago

@carlosedubarreto Thank you for your effort! Based on your excellent contribution, I have further worked on the code to convert it into an FBX file format that can be imported into Unity. With this code, you no longer need to manually change the vertical axis in Blender.

pkl2fbx4unity.txt

g8392 commented 4 weeks ago

Just the script for the ones that dont have blender import_WHAM_in blender.txt

Thanks everyone for the effort, I'm trying the scripts but either the original one or the ones you shared here give me this KeyError: 'pose' or if I change the character number sometimes gets to:

    apply_trans_pose_shape(Vector(tran), pose_final, shape, obj,arm_ob, obname, scene, cam_ob, fframe)
  File "/media/ed/FSSD/DATA/GITHUB/VIBE/demo2.py", line 68, in apply_trans_pose_shape
    mrots, bsh = rodrigues2bshapes(pose)
                 ^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/ed/FSSD/DATA/GITHUB/VIBE/demo2.py", line 59, in rodrigues2bshapes
    mat_rots = [Rodrigues(rod_rot) for rod_rot in rod_rots]
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/ed/FSSD/DATA/GITHUB/VIBE/demo2.py", line 59, in <listcomp>
    mat_rots = [Rodrigues(rod_rot) for rod_rot in rod_rots]
                ^^^^^^^^^^^^^^^^^^
  File "/media/ed/FSSD/DATA/GITHUB/VIBE/demo2.py", line 44, in Rodrigues
    mat = np.asarray([[0, -r[2], r[1]],
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (3, 3) + inhomogeneous part.

I've got WHAM working on different videos but can't seem to get the data out.


I've got it working by using a 2.83 blender and numpy 1.21.1, anyone has also extracted the camera pose?

h0han commented 4 weeks ago

Dooray! 메일 λ°œμ†‘ μ‹€νŒ¨ μ•ˆλ‚΄

메일 λ°œμ†‘ μ‹€νŒ¨ μ•ˆλ‚΄

@.***) λ‹˜κ»˜ 보낸 메일이 μ „μ†‘λ˜μ§€ λͺ»ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

      μ‹€νŒ¨ μ‚¬μœ λ₯Ό ν™•μΈν•΄λ³΄μ„Έμš”.

        * λ°›λŠ” μ‚¬λžŒΒ :Β 

@.***)

        * λ°œμ†‘ μ‹œκ°„Β :Β 

2024-09-26T02:09:29

        * 메일 제λͺ©Β :Β 

Re: [yohanshin/WHAM] Import PKL to Blender (Issue #52)

            * μ‹€νŒ¨ μ‚¬μœ Β :Β 

λ°›λŠ” μ‚¬λžŒμ΄ νšŒμ›λ‹˜μ˜ 메일을 μˆ˜μ‹ μ°¨λ‹¨ ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

      이 메일은 λ°œμ‹ μ „μš©μœΌλ‘œ νšŒμ‹ λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.
      더 κΆκΈˆν•˜μ‹  사항은
      ***@***.***
      으둜 λ¬Έμ˜ν•΄ μ£Όμ‹œκΈ° λ°”λžλ‹ˆλ‹€.

    Β© Dooray!.