Giter VIP home page Giter VIP logo

smpl2bvh's People

Contributors

kosukefukazawa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

smpl2bvh's Issues

Converting the rest pose to A pose & SMPL-X support

Hi! Your script has been immensely helpful for my work. I have two questions:

  1. How can I convert the rest pose from the default T pose to an A pose? (I need to perform this operation in bulk.)
  2. Have you considered adding SMPL-X support to the existing script? Even just including hand gestures would be a great addition.

Thank you for your work!

why is the bvh upside down?

Hi, thank you for the great work! And I want to know why my bvh converted from smpl is upside down? Do you have any solutions?

bvh.mp4

error when try convert!

File "C:\Users\admin\stable-diffusion-webui\smpl2bvh-main\smpl2bvh.py", line 169, in
smpl2bvh(model_path=args.model_path, model_type=args.model_type,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\admin\stable-diffusion-webui\smpl2bvh-main\smpl2bvh.py", line 81, in smpl2bvh
model = smplx.create(model_path=model_path,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\admin\AppData\Local\Programs\Python\Python311\Lib\site-packages\smplx\body_models.py", line 2400, in create
return SMPL(model_path, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\admin\AppData\Local\Programs\Python\Python311\Lib\site-packages\smplx\body_models.py", line 137, in init
data_struct = Struct(**pickle.load(smpl_file,
^^^^^^^^^^^^^^^^^^^^^^
_pickle.UnpicklingError: invalid load key, 'y'.

Hello,

I am having this error... please any help? followed all instructions.

Thank you!!

different skeleton offsets got of repo smpl2bvh and CharacterAnimationTools

Hi, I just found that on SMPL MALE model, the two of your projects got different skeleton offsets. I did not test on other SMPL models. I notice that the two projects use different methods to get the skeleton offsets.
As offsets is critical to reconstruct the real body motion from joint rotations, the offsets difference may influence on the final result motion, would you please tell why the difference happen and which method is more reasonable ? thanks.

below are my results:

by using smpl2bvh

python smpl2bvh.py --model_path models --poses gBR_sBM_cAll_d04_mBR0_ch01.pkl

printing offsets after line I got

offsets:
[[ -0.21736789 -24.078918     2.8583794 ]
 [  5.858135    -8.228004    -1.7664082 ]
 [ -6.030973    -9.051326    -1.3542533 ]
 [  0.4439448   12.440356    -3.8385224 ]
 [  4.345143   -38.646942     0.80370027]
 [ -4.3256626  -38.368793    -0.48430422]
 [  0.4488444   13.795638     2.6820328 ]
 [ -1.4790334  -42.687447    -3.7428    ]
 [  1.9055545  -42.004562    -3.4561672 ]
 [ -0.22645919   5.603239     0.2855044 ]
 [  4.105436    -6.0286045   12.204244  ]
 [ -3.4839869   -6.2105536   13.03233   ]
 [ -1.3390183   21.163553    -3.3467577 ]
 [  7.1702466   11.399969    -1.889817  ]
 [ -8.295364    11.247234    -2.3707385 ]
 [  1.011321     8.893734     5.040986  ]
 [ 12.29214      4.520509    -1.9046001 ]
 [-11.32283      4.685326    -0.8472071 ]
 [ 25.533188    -1.5649021   -2.294649  ]
 [-26.01275     -1.4369264   -3.1268728 ]
 [ 26.570929     1.2698084   -0.73747337]
 [-26.910835     0.67937076  -0.60267633]
 [  8.669054    -1.0636002   -1.5594293 ]
 [ -8.87537     -0.86515695  -1.0107077 ]]

by using CharacterAnimationTools,

from anim import aistpp
anim: Animation = aistpp.load(
    aistpp_motion_path="gBR_sBM_cAll_d04_mBR0_ch01.pkl",
    smpl_path="models/smpl/SMPL_MALE.pkl"
)

printing offsets after line I got

offsets:
[[ -0.23178788 -25.67627446   3.04799966]
 [  6.24675465  -8.77383675  -1.88358908]
 [ -6.43105802  -9.65177882  -1.44409215]
 [  0.47339571  13.26562856  -4.09316365]
 [  4.6333931  -41.21072346   0.85701646]
 [ -4.61262024 -40.91411303  -0.51643223]
 [  0.47861966  14.71082034   2.85995446]
 [ -1.57715034 -45.51925651  -3.99109087]
 [  2.03196604 -44.79107482  -3.68544373]
 [ -0.24148185   5.97494929   0.30444463]
 [  4.37778461  -6.42852221  13.01385252]
 [ -3.71510957  -6.62255471  13.89687284]
 [ -1.42784683  22.56750892  -3.56877643]
 [  7.64591048  12.15622499  -2.01518469]
 [ -8.84566645  11.9933573   -2.52800977]
 [  1.07841059   9.48373246   5.37539715]
 [ 13.10757937   4.8203929   -2.03094816]
 [-12.07396959   4.99614436  -0.90340923]
 [ 27.227021    -1.66871601  -2.44687195]
 [-27.73839557  -1.5322525   -3.33430471]
 [ 28.33359887   1.3540481   -0.78639626]
 [-28.69606067   0.72444051  -0.64265731]
 [  9.24414583  -1.1341604   -1.66287925]
 [ -9.46415423  -0.92254989  -1.07775645]]

bvh2smpl

Thank you for providing this great tool!

I was wondering if there is a way to convert exported BVH back to SMPL.
The npz (only trans and poses) for SMPL is enough since there is no loss and scaling inside the original BVH file.

I have converted my own data set to the BVH skeleton you adopted in this project.
However, I could find a way to back quaternion to axis-angle because you divide axis-angle by its norm for normalization.

Could you give me some pieces of advice for bvh2smpl?

Thank you!

The reason using reimplemented Euler to Quaternion instead of using scipy

Hi KosukeFukazawa, great work, it helps me a lot!

I'm quit new to the 3D modeling field, and I'm curios why using the reimplemented approach to convert Euler angles into quaternion (rots = quat.from_axis_angle(rots))? I use scipy's Rotation ( scipy.spatial.transform.Rotation.from_euler().as_quat() ) and yields different result.

And also, in the following code, why convert Euler angles to quaternion and then convert back to Euler angles, instead of directly convert raw Euler angles to degree?

`
# to quaternion
rots = quat.from_axis_angle(rots)

order = "zyx"
pos = offsets[None].repeat(len(rots), axis=0)
positions = pos.copy()
positions[:,0] += trans * 100
rotations = np.degrees(quat.to_euler(rots, order=order))

`

Thanks!

rest pose and actions poses are rotated 180°

Thank you very much for your work, it is very helpful to me!Great work!
But now I have encountered a problem. After the data I saved was converted, the static posture and dynamic action were rotated 180°(as shown in the picture, and I provided the Bvh file(use the txt)). I was very confused and wanted to ask how to modify the code to save the normal action.
I would be grateful if you could help!! Thank you!

image
image
test.txt

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.