MarilynKeller / SMPL2AddBiomechanics

Enable inputting a SMPL sequence into AddBiomechanics to fit an OpenSim skeleton model to the sequence.
Other
61 stars 2 forks source link

Load .osim in aitviewer #8

Open hykong99 opened 1 month ago

hykong99 commented 1 month ago

Hello, I want to load .osim file in aitviewer. If you modify only the osim file to mine in the command below, there are parts where the mesh is not visible as shown below. How to load my osim file? And why my osim file is going up y-axis?

my command : python3 ../test_scaling/show_ab_results.py --osim_path=/home/hykong99/SKEL/test_scaling/test_scaled.osim --mot_path=/home/hykong99/SKEL/test_scaling/test.mot --smpl_motion_path=/home/hykong99/SKEL/test_scaling/test.npz image

MarilynKeller commented 1 month ago

Hi, your .is I'm file must point to mesh files like tibia.vtp You need to get these meshes, convert them to .ply, rename them tibia.vtp.ply and place them in the geometry folder that is referenced in the aitviewer config file.

MarilynKeller commented 1 month ago

For the y offset, to get the current skeleton sequence, did you input your .osim model in add biomechanics ?

hykong99 commented 1 month ago

No, just my .osim don't get to add biomechanics.

MarilynKeller commented 1 month ago

Then that explains the offset. Your model probably has another root height. I'm surprised you could load the .mot however.

We'll see clearer when you have the visualization fixed.

hykong99 commented 1 month ago

I check the coordinate has the offset. How to fix this problem?(What code do I need to fix?)

image

MarilynKeller commented 1 month ago

If you want your .osim to superimpose with smpl, you need to pass your .osim to add biomechanics and visualize that output.

hykong99 commented 1 month ago

Can't I just use the osim and mot files I have? Because I change the geometry, it loads.

MarilynKeller commented 1 month ago

The aim of the code I release is to let you fit a .osim to a smpl sequence and then visualize both. From what I understand you fit my BSM model to a SMPL sequence but then want to visualize your own .osim model with the .mot you got fitting my model. I don't understand what would be the point of that.

If you explain me what you're trying to do I can tell you weather this is possible or not with my code and how. But right now it's not clear to me.

Short answer to your previous question is no. If your model is different from mine and you don't fit it to smpl, you can not hope that using the .mot for BSM applied to your model to superimpose with Smpl.

hykong99 commented 1 month ago

I want to scale the .osim file directly to the SMPL sequence, and visualize if this was done correctly. I created a SMPL sequence using my .mot file. I scaled the Rajagopal model's .osim file to fit the SMPL sequence I created. Then, I wanted to visualize this using aitviewer. To visualize the Rajagopal model, I changed the Geometry. However, an offset on the y-axis is added as shown in the picture. I have some questions related to this:

Can you visualize the process I described using your code? If not, 2-1. Can you change the bsm model to the Rajagopal model? 2-2. When I use the Rajagopal model from the Add2Biomechanics program, the result seems strange.

In conclusion, I want to use the scaled rajagopal model. If possible, I would like to visualize it in a my scaled way, but if not, rajagopal from AddBiomechanics would also work well.

hykong99 commented 1 month ago

https://github.com/user-attachments/assets/61434f75-991a-4fe7-a41a-0703605c5f28

This video visualizes the results of fitting my SMPL sequence using rajagopal from AddBiomechanics. The pelvis moves too much from side to side and my shoulder angle is weird.

hykong99 commented 1 month ago

Can I get the relationship between SMPL index and rajagopal marker??