python package to process 3d motion tracking data
Project description
mobi_motion_tracking
A python package for 3D motion tracking data processing.
Welcome to mobi_motion_tracking, a Python library designed for processing and analyzing captured motion tracking data. This library provides a set of tools to analyze 3D skeletal data against a gold standard and calculate a similarity metric between them. We provide a labelled output file containing all specified, calculated metrics and metadata for post-processing analysis.
Supported formats & devices
The package currently supports the following formats:
| Format | Manufacturer | Device | Implementation status |
|---|---|---|---|
| XLSX | Microsoft | KINECT | ✅ |
| XLSX | StereoLabs | ZED 2i | ✅ |
Special Note This package works off the assumption that all input participant files are named according to their participant ID containing only digits in the correct format i.e. (0000.xlsx). It is also assummed that each participant file contains 1 or more sheets of data per sequence. The sheets are expected to be named based off the string 'seq' and an integer representing the sequence i.e. ('seq1'). The file names can be any length of digits and there can be an unlimited number of sequences. Sequences will only be processed if indicated in the input list.
It is assumed that any gold file contains the string 'gold' or 'Gold' in its basename.
It is also expected that there are no missing data points prior to running the package.
Processing pipeline implementation
The main processing pipeline of the mobi_motion_tracking module can be described as follows:
- Data loading: Data is loaded per participant, per sequence as a dataframe. If a file is named incorrectly, is not in the right format, or the sequence does not exist for that participant, it is skipped.
- Data preprocessing: The raw subject and gold standard joint data are centered to the hip for every frame. The average lengths of all skeletal segments of the gold standard data are calculated, and the centered subject joint data is normalized to the average gold lengths.
- Metrics Calculation: Calculates specified similarity metrics on the preprocessed data, namely DTW (dynamic Time Warping). DTW is the only possible option at this current developmental stage.
Installation
Install this package via :
pip install mobi_motion_tracking
Or get the newest development version via:
pip install git+https://github.com/childmindresearch/mobi-motion-tracking
Quick start
Using mobi_motion_tracking through the command-line:
Run single files:
mobi_motion_tracking -d /subject/file/path/000.xlsx -g /gold/file/path/gold.xlsx -s "1,2,3" -a "dtw"
Run entire directories:
mobi_motion_tracking -d /subject/file/dir -g /gold/file/path/gold.xlsx -s "1,2,3" -a "dtw"
Using mobi_motion_tracking through a python script or notebook:
Running single files:
from mobi_motion_tracking.core import orchestrator
import pathlib
# Define data file path, gold file path, sequence list, and algorithm
# Support for saving as .ndjson
data_path = pathlib.Path("100.xlsx")
gold_path = pathlib.Path("Gold.xlsx")
sequence = [1, 2, 3]
algorithm = "dtw"
# Run the orchestrator
results = orchestrator.run(
experimental_path=data_path,
gold_path=gold_path,
sequence=sequence,
algorithm=algorithm,
)
# Data available in list of results.
subject1_seq1 = results[0][0]
participant_ID = subject1_seq1["participant_ID"]
sheetname = subject1_seq1["sheetname"]
method = subject1_seq1["method"]
distance = subject1_seq1["distance"]
Running entire directories:
from mobi_motion_tracking.core import orchestrator
import pathlib
# Define data file path, gold file path, sequence list, and algorithm
# Support for saving as .ndjson
data_path = pathlib.Path("")
gold_path = pathlib.Path("Gold.xlsx")
sequence = [1, 2, 3]
algorithm = "dtw"
# Run the orchestrator
results = orchestrator.run(
experimental_path=data_path,
gold_path=gold_path,
sequence=sequence,
algorithm=algorithm,
)
# Data available in list of results.
subject1_seq1 = results[0][0]
participant_ID = subject1_seq1["participant_ID"]
sheetname = subject1_seq1["sheetname"]
method = subject1_seq1["method"]
distance = subject1_seq1["distance"]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mobi_motion_tracking-0.1.3.tar.gz.
File metadata
- Download URL: mobi_motion_tracking-0.1.3.tar.gz
- Upload date:
- Size: 21.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb49075fe142a0b93179c3d2d4738d6db0a6377e6cad8702e24a58103600f5a5
|
|
| MD5 |
3a832bf69b96e6f873a86e99432be745
|
|
| BLAKE2b-256 |
bf59bf748c8d792fd58445f6ad90c84e812ac3b64f8deab49a27e2925cce27d1
|
File details
Details for the file mobi_motion_tracking-0.1.3-py3-none-any.whl.
File metadata
- Download URL: mobi_motion_tracking-0.1.3-py3-none-any.whl
- Upload date:
- Size: 25.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d7759ee10a767cfdb04488d2a4005edf14095ee93443082d6d9aa0dbfe8402c
|
|
| MD5 |
4f67a769f3fd8ec3ea6636477512d23f
|
|
| BLAKE2b-256 |
c07efc33449266ea886d83856df6db9ba243d25bb3078d1364ed5922b3dd4c05
|