This repository enables the post-processing of human movement kinematics collected using OpenCap. You can run kinematic analyses, download multiple sessions using scripting, and run simulations to estimate kinetics. Building on the original OpenCap processing repository, this codebase implements the hybrid machine learning–simulation pipeline described in Miller et al., improving estimation of ground reaction forces, joint moments, and joint contact forces.
More information is available in our preprint on biorxiv
Miller EY, Tan T, Falisse A, Uhlrich SD, 2025. Integrating Machine Learning with Musculoskeletal Simulation Improves OpenCap Video-Based Dynamics Estimation
Uhlrich SD*, Falisse A*, Kidzinski L*, Ko M, Chaudhari AS, Hicks JL, Delp SL, 2022. OpenCap: Human movement dynamics from smartphone videos. PLoS Comput Biol 19(10): e1011462. https://doi.org/10.1371/journal.pcbi.1011462. *contributed equally
- Install Anaconda
- Open Anaconda prompt
- Create environment (python 3.11 recommended):
conda create -n opencap-processing-grf python=3.11 - Activate environment:
conda activate opencap-processing-grf - Install OpenSim:
conda install -c opensim-org opensim=4.5=py311np123- Test that OpenSim was successfully installed:
- Start python:
python - Import OpenSim:
import opensim- If you don't get any error message at this point, you should be good to go.
- You can also double check which version you installed :
opensim.GetVersion() - Exit python:
quit()
- Start python:
- Visit this webpage for more details about the OpenSim conda package.
- Test that OpenSim was successfully installed:
- (Optional): Install an IDE such as Spyder:
conda install spyder - Clone the repository to your machine:
- Navigate to the directory where you want to download the code: eg.
cd Documents. Make sure there are no spaces in this path. - Install git if you have not already:
conda install -c conda-forge git - Clone the repository:
git clone https://github.com/utahmobl/opencap-processing-grf.git - Navigate to the directory:
cd opencap-processing-grf
- Navigate to the directory where you want to download the code: eg.
- Install required packages:
python -m pip install -r requirements.txt - Run
python createAuthenticationEnvFile.py- An environment variable (
.envfile) will be saved after authenticating.
- An environment variable (
- Windows only: Install Visual Studio
- The Community variant is sufficient and is free for everyone.
- During the installation, select the workload Desktop Development with C++.
- The code was tested with the 2017, 2019, and 2022 Community editions.
- Linux only: Install OpenBLAS libraries
sudo apt-get install libopenblas-base
- Run
batchDownload_ForGRFTrack.pyfor example of how to download data and predict GRFs/COPs - Run
example_walking_opensimAD_GRF.pyin the Example_GRFTrack folder for an example of how to generate hybrid simulations
