Skip to content

GaitSetPy is a Python package for human gait analysis and recognition. This package provides tools and algorithms to process and analyze gait data, enabling researchers and developers to build applications for gait recognition and clinical gait assessment.

License

Notifications You must be signed in to change notification settings

Alohomora-Labs/gaitSetPy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

GaitSetPy ✨

DOI PyPI version Docs CodeRabbit Pull Request Reviews Conda-forge-downloads PyPI - Downloads

GaitSetPy is a Python package for gait analysis and recognition. It provides clean, modern APIs to preprocess, analyze, extract features, classify, and visualize gait data across multiple datasets and modalities.


📚 Table of Contents


Features

  • Gait data preprocessing
  • Feature extraction (generic and dataset-specific)
  • Machine learning and deep learning models for recognition
  • Exploratory data analysis and visualization tools
  • Class-based API with legacy compatibility

Supported Datasets

IMU Sensor Based

  • Daphnet: https://archive.ics.uci.edu/dataset/245/daphnet+freezing+of+gait Supported
  • MobiFall: https://bmi.hmu.gr/the-mobifall-and-mobiact-datasets-2/ In Progress
  • HAR-UP (formerly UPFall): https://sites.google.com/up.edu.mx/har-up/ Supported
  • UrFall: https://fenix.ur.edu.pl/~mkepski/ds/uf.html Supported
  • Activity Net - Arduous: https://www.mad.tf.fau.de/research/activitynet/wearable-multi-sensor-gait-based-daily-activity-data/ In Progress

Pressure/Force Sensor Based

  • PhysioNet Gait in Parkinson's Disease: https://physionet.org/content/gaitpdb/1.0.0/ Completed

Installation

From PyPI:

pip install gaitsetpy

From Conda-Forge:

## add conda-forge
conda config --add channels conda-forge
conda config --set channel_priority strict

conda install gaitsetpy
## or mamba
mamba install gaitsetpy

From source:

git clone https://github.com/Alohomora-Labs/gaitSetPy.git
python setup.py install

Optionally, also install requirements:

pip install -r requirements.txt

Quickstart

import gaitsetpy as gsp

# Daphnet: Load, window, extract features, visualize
loader = gsp.DaphnetLoader()
data, names = loader.load_data("data/daphnet")
windows = loader.create_sliding_windows(data, names, window_size=192, step_size=32)
extractor = gsp.GaitFeatureExtractor()
features = extractor.extract_features(windows[0]['windows'], fs=64)

from gaitsetpy.eda import SensorStatisticsAnalyzer
analyzer = SensorStatisticsAnalyzer()
analyzer.visualize(windows[0]['windows'], features, sensor_name="shank", start_idx=0, end_idx=1000, num_windows=15)

# Train & evaluate a Random Forest
rf = gsp.RandomForestModel(n_estimators=50, random_state=42, max_depth=10)
rf.train(features)
metrics = rf.evaluate(features)
print(metrics.get('accuracy'))

Examples: Notebooks and Scripts

  • Notebooks (examples/notebooks):
    • Daphnet_demo.ipynb, HARUP_demo.ipynb, PhysioNet_demo.ipynb, UrFall_demo.ipynb
    • Open with Jupyter: jupyter notebook examples/notebooks/HARUP_demo.ipynb
  • Scripts (examples/scripts):
    • daphnet_all_models_example.py, harup_example.py, physionet_example.py, urfall_example.py
    • Run via Python: python examples/scripts/harup_example.py

These examples mirror the latest APIs and are maintained alongside code updates.


Usage by Dataset (Code Snippets)

Below are minimal, copy-pasteable examples for each supported dataset.

Daphnet

import gaitsetpy as gsp
loader = gsp.DaphnetLoader()
data, names = loader.load_data("data/daphnet")
windows = loader.create_sliding_windows(data, names, window_size=192, step_size=32)
features = gsp.GaitFeatureExtractor().extract_features(windows[0]['windows'], fs=64)

HAR-UP

import gaitsetpy as gsp
loader = gsp.HARUPLoader()
harup_data, harup_names = loader.load_data("data/harup")
windows = loader.create_sliding_windows(harup_data, harup_names, window_size=100, step_size=50)
# Dataset-specific feature extraction
features_data = loader.extract_features(windows)

UrFall

import gaitsetpy as gsp
loader = gsp.UrFallLoader()
# Load pre-extracted depth-map features
data, names = loader.load_data("data/urfall", data_types=['features'], use_falls=True, use_adls=True)
windows = loader.create_sliding_windows(data, names, window_size=30, step_size=15)
# Filepaths for media modalities
video_paths = loader.get_file_paths("data/urfall", 'video')
depth_paths = loader.get_file_paths("data/urfall", 'depth', sequences=['fall-01'])
print(loader.get_activity_info())
print(loader.get_feature_info())

PhysioNet (VGRF)

import gaitsetpy as gsp
loader = gsp.PhysioNetLoader()
data, names = loader.load_data("data/physionet")
windows = loader.create_sliding_windows(data, names, window_size=600, step_size=100)
features = gsp.PhysioNetFeatureExtractor().extract_features(windows[0]['windows'], fs=100)
labels = loader.get_labels()

MobiFall

import gaitsetpy as gsp
loader = gsp.MobiFallLoader()
# Depending on your local dataset layout
data, names = loader.load_data("data/mobifall")
windows = loader.create_sliding_windows(data, names, window_size=256, step_size=64)
# Use generic gait feature extractor
features = gsp.GaitFeatureExtractor().extract_features(windows[0]['windows'], fs=50)

Arduous

import gaitsetpy as gsp
loader = gsp.ArduousLoader()
# Depending on ActivityNet/Arduous export and local layout
data, names = loader.load_data("data/arduous")
windows = loader.create_sliding_windows(data, names, window_size=256, step_size=64)
features = gsp.GaitFeatureExtractor().extract_features(windows[0]['windows'], fs=50)

Models

  • RandomForestModel (built-in, scikit-learn)
  • Optional deep learning models (LSTM, BiLSTM, CNN, GNN) if PyTorch is installed

Factory access via gaitsetpy.classification.models.get_classification_model(name, **kwargs).


Visualization

  • gaitsetpy.eda.SensorStatisticsAnalyzer
  • Dataset-specific visualizers for exploratory analysis

Documentation

For detailed documentation and API reference, visit the official docs:

  • Docs: https://alohomora-labs.github.io/gaitSetPy/gaitsetpy.html

Contributing

We welcome contributions! Please read our contributing guidelines to get started.


License

This project is licensed under the GNU GPL License. See the LICENSE file for details.


Citation

If you use GaitSetPy in your research, please cite our work using the DOI badge above.


Changelog

  • 0.2.2: README overhaul (ToC, vibrant styling), per-dataset examples, notebooks/scripts documentation, version sync.
  • See GitHub Releases for older entries.

About

GaitSetPy is a Python package for human gait analysis and recognition. This package provides tools and algorithms to process and analyze gait data, enabling researchers and developers to build applications for gait recognition and clinical gait assessment.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 5