A Python package for gait analysis using sensor data.
Project description
GaitSetPy
GaitSetPy is a Python package for 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.
Features
- Gait data preprocessing
- Feature extraction
- Gait recognition algorithms
- Visualization tools
Supported Datasets
IMU Sensor Based
-
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/
-
Activity Net - Arduous : https://www.mad.tf.fau.de/research/activitynet/wearable-multi-sensor-gait-based-daily-activity-data/
Pressure Sensor Based
- Physionet Gait in Parkinson's Disease: https://physionet.org/content/gaitpdb/1.0.0/
Installation
From PyPI:
pip 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
Usage
Daphnet Dataset (class-based API)
import gaitsetpy as gsp
# Load dataset via class-based loader
loader = gsp.DaphnetLoader()
data, names = loader.load_data("data/daphnet")
# Create sliding windows and extract features
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)
# Optional: visualize using analyzer
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
)
HAR-UP Dataset (class-based API)
import gaitsetpy as gsp
# Load HAR-UP data via class-based loader
loader = gsp.HARUPLoader()
harup_data, harup_names = loader.load_data("data/harup")
# Create sliding windows
window_size = 100 # 1 second at 100Hz
step_size = 50 # 0.5 second overlap
windows = loader.create_sliding_windows(harup_data, harup_names, window_size, step_size)
# Extract features using dataset-specific method or feature extractor
features_data = loader.extract_features(windows)
# Train and evaluate a Random Forest (class-based)
rf_model = gsp.RandomForestModel(n_estimators=50, random_state=42, max_depth=10)
rf_model.train(features_data if isinstance(features_data, list) else features)
metrics = rf_model.evaluate(features_data if isinstance(features_data, list) else features)
print(metrics.get('accuracy'))
# Load a saved model (optional)
rf_model.load_model("gaitsetpy/classification/weights/random_forest_model_40_10.pkl")
UrFall Dataset (class-based API)
import gaitsetpy as gsp
# Load UrFall data via class-based loader
loader = gsp.UrFallLoader()
# Load pre-extracted features (default)
data, names = loader.load_data("data/urfall", data_types=['features'])
# Or load specific data types
data, names = loader.load_data("data/urfall",
data_types=['features', 'accelerometer'],
use_falls=True,
use_adls=True)
# Load only fall sequences
fall_data, fall_names = loader.load_data("data/urfall",
data_types=['features'],
use_falls=True,
use_adls=False)
# Create sliding windows from features
window_size = 30 # 30 frames at 30Hz = 1 second
step_size = 15 # 0.5 second overlap
windows = loader.create_sliding_windows(data, names, window_size, step_size)
# Get file paths for image/video data
video_paths = loader.get_file_paths("data/urfall", 'video')
depth_paths = loader.get_file_paths("data/urfall", 'depth', sequences=['fall-01'])
# Display dataset information
print(loader.get_activity_info())
print(loader.get_feature_info())
UrFall Dataset Features:
- 30 fall sequences and 20 ADL (Activities of Daily Living) sequences
- Multiple data modalities: depth images, RGB images, accelerometer, synchronization, video
- Pre-extracted features from depth maps (11 features per frame)
- Configurable data type loading
- Front camera (cam0) data
- Labels: -1 (standing/walking), 0 (falling - transient), 1 (lying on ground)
Documentation
For detailed documentation and API reference, please visit the official documentation.
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 more details.
Contact
For any questions or inquiries, please contact us at jayeeta.chakrabortyfcs@kiit.ac.in or aharshit123456@gmail.com.
Project details
Release history Release notifications | RSS feed
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 gaitsetpy-0.2.1.tar.gz.
File metadata
- Download URL: gaitsetpy-0.2.1.tar.gz
- Upload date:
- Size: 5.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31bd0116ff73e0d488b5b2d754ff685c38854d2233d77bfa5b0f5bb4523ce995
|
|
| MD5 |
e266a1b34874a23b30ed45273ac80bda
|
|
| BLAKE2b-256 |
53d38ca5f9df4f722b1c8b5e38a5da8d6b94c91ebe160be656e3a29c3972ea5d
|
Provenance
The following attestation bundles were made for gaitsetpy-0.2.1.tar.gz:
Publisher:
pypi.yml on Alohomora-Labs/gaitSetPy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gaitsetpy-0.2.1.tar.gz -
Subject digest:
31bd0116ff73e0d488b5b2d754ff685c38854d2233d77bfa5b0f5bb4523ce995 - Sigstore transparency entry: 574605920
- Sigstore integration time:
-
Permalink:
Alohomora-Labs/gaitSetPy@b02b549a902e3408b59e27a6d59d813ded4636b3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Alohomora-Labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@b02b549a902e3408b59e27a6d59d813ded4636b3 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file gaitsetpy-0.2.1-py3-none-any.whl.
File metadata
- Download URL: gaitsetpy-0.2.1-py3-none-any.whl
- Upload date:
- Size: 4.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3499f18cc570b2a08eb2b562c32bd44563070940353c9158b48622cd827b9b72
|
|
| MD5 |
937a84df7c167ca81c12b109ce9f0b69
|
|
| BLAKE2b-256 |
48e7ff1109a59422a1883736e23cb4ffc190fd9120d168a09a5ee3eb1d1f7480
|
Provenance
The following attestation bundles were made for gaitsetpy-0.2.1-py3-none-any.whl:
Publisher:
pypi.yml on Alohomora-Labs/gaitSetPy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gaitsetpy-0.2.1-py3-none-any.whl -
Subject digest:
3499f18cc570b2a08eb2b562c32bd44563070940353c9158b48622cd827b9b72 - Sigstore transparency entry: 574605981
- Sigstore integration time:
-
Permalink:
Alohomora-Labs/gaitSetPy@b02b549a902e3408b59e27a6d59d813ded4636b3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Alohomora-Labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@b02b549a902e3408b59e27a6d59d813ded4636b3 -
Trigger Event:
workflow_dispatch
-
Statement type: