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 muscle-driven simulations to estimate kinetics.
More information is available in our paper:
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
Archived code base corresponding to publication: https://zenodo.org/record/7419973
- Install Anaconda
- Open Anaconda prompt
- Create environment (python 3.11 recommended):
conda create -n opencap-processing python=3.11
- Activate environment:
conda activate opencap-processing
- 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. - Clone the repository:
git clone https://github.com/stanfordnmbl/opencap-processing.git
- Navigate to the directory:
cd opencap-processing
- 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 (
.env
file) 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
example.py
for examples of how to run kinematic analyses - Run
example_kinetics.py
for examples of how to generate muscle-driven simulations - Moco
- The Moco folder contains examples for generating muscle-driven simulations using OpenSim Moco.
- Open
batchDownload.ipynb
in Colab and follow the instructions- You do not need to follow the install requirements above.
- Follow the install requirements above
- Open
batchDownload.py
and follow the instructions