Failed to run gait analysis through Python

New project for OpenCap, which is a new software package to estimate 3D human movement dynamics from smartphone videos. OpenCap strongly relies on OpenSim.
POST REPLY
User avatar
jintao Pan
Posts: 9
Joined: Thu Nov 02, 2023 1:06 am

Failed to run gait analysis through Python

Post by jintao Pan » Thu Apr 04, 2024 2:16 am

Hello,

I am a first-year graduate student who has just studied sports biomechanics. Now I have some questions and I really hope to get your answers.
I tried using "example_gait_analysis.py" to run the local data I recorded via Opencap, but it failed. I changed the local code location, session id ,the number of "n_gait_cycles = -1"and trial name in the "example_gait_analysis.py" code, but the operation failed. Python showed that it could not recognize the gait cycle and other problems. I am not sure whether it was because I changed the wrong things. The run failed.
And I would like to get the gait cycle and other information and process the data I downloaded from opencap through opensim, but I don't find the gait analysis tool in Opensim

It's my great honor to getting your answer.
Thank you!!

Here is the error code issue I'm having:
4.png
4.png (90.3 KiB) Viewed 1977 times
3.jpg
3.jpg (261.01 KiB) Viewed 1977 times
2.jpg
2.jpg (61.51 KiB) Viewed 1977 times
1.jpg
1.jpg (4.75 KiB) Viewed 1977 times

Tags:

User avatar
Antoine Falisse
Posts: 439
Joined: Wed Jan 07, 2015 2:21 am

Re: Failed to run gait analysis through Python

Post by Antoine Falisse » Mon Apr 08, 2024 10:06 am

hi, I just tested and the gait analysis tool does not seem to be working for your trial with data from children. I have opened an issue, and I will look into that within the next few weeks. https://github.com/stanfordnmbl/opencap ... issues/119. I will report back here if I find a solution. Antoine

User avatar
jintao Pan
Posts: 9
Joined: Thu Nov 02, 2023 1:06 am

Re: Failed to run gait analysis through Python

Post by jintao Pan » Wed Apr 10, 2024 12:43 am

Thanks doc
Thank you very much for your reply, looking forward to success

Best
jIntao Pan

User avatar
jintao Pan
Posts: 9
Joined: Thu Nov 02, 2023 1:06 am

Re: Failed to run gait analysis through Python

Post by jintao Pan » Wed Apr 17, 2024 1:39 am

Hi

I attempted to modify the prominence" code in "gait_analysis.py", setting the threshold to "0.2, 0.15, 0.1, 0.05, 0.03, 0.02, 0.01, 0.008, 0.005" and successfully processed several local data. There are still some data that cannot be processed, spikes cannot be detected, and therefore no gait data can be obtained.

I am very much looking forward to your reply.
Best
Jintao Pan
28f7004fb039313c54acfd681044f1c1.png
28f7004fb039313c54acfd681044f1c1.png (335.76 KiB) Viewed 1816 times

User avatar
Antoine Falisse
Posts: 439
Joined: Wed Jan 07, 2015 2:21 am

Re: Failed to run gait analysis through Python

Post by Antoine Falisse » Fri Apr 19, 2024 9:37 am

Hi that sounds good. It is very difficult to find settings that work for all cases. Playing with the settings of the detect_gait_peaks function is probably the way to go: https://github.com/stanfordnmbl/opencap ... 90C13-L703

Best, Antoine

User avatar
jintao Pan
Posts: 9
Joined: Thu Nov 02, 2023 1:06 am

Re: Failed to run gait analysis through Python

Post by jintao Pan » Fri Apr 19, 2024 9:55 am

Hi
There are still a few questions that I can't figure out.
Is the value of prominence based on HS or TO? How is this threshold determined? Is it by calculating the force value? like 1N=1kg m/s2
And how can I change the visualization output to data output in CSV format?
Thank you very much for your reply!

Best
Jintao Pan

User avatar
Antoine Falisse
Posts: 439
Joined: Wed Jan 07, 2015 2:21 am

Re: Failed to run gait analysis through Python

Post by Antoine Falisse » Fri Apr 19, 2024 11:10 am

We are looking at peaks in processed marker data.

> And how can I change the visualization output to data output in CSV format?
There are some python modules to output csv files.

Best, Antoine

User avatar
jintao Pan
Posts: 9
Joined: Thu Nov 02, 2023 1:06 am

Re: Failed to run gait analysis through Python

Post by jintao Pan » Fri Apr 19, 2024 11:14 am

Thanks doc
Thank you very much for your help.I will continue to dig deeper into opencap.

Best
Jintao Pan

User avatar
Antoine Falisse
Posts: 439
Joined: Wed Jan 07, 2015 2:21 am

Re: Failed to run gait analysis through Python

Post by Antoine Falisse » Fri Apr 19, 2024 11:28 am

Sound good.

POST REPLY