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.
- Features
- Supported Datasets
- Installation
- Quickstart
- Examples: Notebooks and Scripts
- Usage by Dataset (Code Snippets)
- Models
- Visualization
- Documentation
- Contributing
- License
- Citation
- Changelog
- 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
- Daphnet:
https://archive.ics.uci.edu/dataset/245/daphnet+freezing+of+gait - MobiFall:
https://bmi.hmu.gr/the-mobifall-and-mobiact-datasets-2/ - HAR-UP (formerly UPFall):
https://sites.google.com/up.edu.mx/har-up/ - UrFall:
https://fenix.ur.edu.pl/~mkepski/ds/uf.html - Activity Net - Arduous:
https://www.mad.tf.fau.de/research/activitynet/wearable-multi-sensor-gait-based-daily-activity-data/
From PyPI:
pip install gaitsetpyFrom Conda-Forge:
## add conda-forge
conda config --add channels conda-forge
conda config --set channel_priority strict
conda install gaitsetpy
## or mamba
mamba install gaitsetpyFrom source:
git clone https://github.com/Alohomora-Labs/gaitSetPy.git
python setup.py installOptionally, also install requirements:
pip install -r requirements.txtimport 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'))- 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.
Below are minimal, copy-pasteable examples for each supported dataset.
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)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)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())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()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)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)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).
gaitsetpy.eda.SensorStatisticsAnalyzer- Dataset-specific visualizers for exploratory analysis
For detailed documentation and API reference, visit the official docs:
- Docs:
https://alohomora-labs.github.io/gaitSetPy/gaitsetpy.html
We welcome contributions! Please read our contributing guidelines to get started.
This project is licensed under the GNU GPL License. See the LICENSE file for details.
If you use GaitSetPy in your research, please cite our work using the DOI badge above.
- 0.2.2: README overhaul (ToC, vibrant styling), per-dataset examples, notebooks/scripts documentation, version sync.
- See GitHub Releases for older entries.