Metadata-Version: 2.4
Name: gaitkit
Version: 1.4.7
Summary: Universal gait event detection toolkit — 10 methods including BIKE, with C-accelerated backends
Author-email: Frédéric Fer <f.fer@institut-myologie.org>
License-Expression: MIT
Project-URL: Homepage, https://github.com/IDMDataHub/gaitkit
Project-URL: Documentation, https://github.com/IDMDataHub/gaitkit#readme
Project-URL: Repository, https://github.com/IDMDataHub/gaitkit
Project-URL: Issues, https://github.com/IDMDataHub/gaitkit/issues
Project-URL: Changelog, https://github.com/IDMDataHub/gaitkit/blob/master/CHANGELOG.md
Keywords: gait,biomechanics,motion-capture,heel-strike,toe-off,event-detection
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: C
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.23
Requires-Dist: scipy>=1.10
Requires-Dist: pandas>=1.5
Requires-Dist: ezc3d>=1.5
Provides-Extra: onnx
Requires-Dist: onnxruntime>=1.14; extra == "onnx"
Provides-Extra: deep
Requires-Dist: tensorflow>=2.12; extra == "deep"
Requires-Dist: h5py; extra == "deep"
Provides-Extra: viz
Requires-Dist: matplotlib>=3.7; extra == "viz"
Provides-Extra: c3d
Provides-Extra: test
Requires-Dist: pytest>=7.0; extra == "test"
Requires-Dist: coverage>=7.0; extra == "test"
Provides-Extra: all
Requires-Dist: onnxruntime>=1.14; extra == "all"
Requires-Dist: tensorflow>=2.12; extra == "all"
Requires-Dist: h5py; extra == "all"
Requires-Dist: matplotlib>=3.7; extra == "all"
Dynamic: license-file

# gaitkit (Python)

Python package for gait event detection from motion-capture data.

## Install

Current status: PyPI release available (latest stable on PyPI).

Install from local source:

```bash
python -m pip install -e ./python
python -m pip install -e "./python[all]"   # optional extras
```

Once published:

```bash
pip install gaitkit
```

Optional extras:

```bash
pip install "gaitkit[all]"   # onnx + deep + viz
```

## Quick Start

```python
import gaitkit

trial = gaitkit.load_example("healthy")
result = gaitkit.detect(trial, method="bike")
print(result.summary())

# Optional: combine C3D markers with an external angle file
result2 = gaitkit.detect("trial_07.c3d", method="bike", angles="res_angles_t.mat")
```

DeepEvent weights are downloaded automatically on first DeepEvent use and
cached in `~/.cache/gaitkit/`.

## Proprietary JSON I/O (MyoGait-like)

The compatibility API accepts a proprietary JSON payload with
`angles.frames` and can export back a MyoGait-compatible `events` JSON.

```python
import gaitkit

out = gaitkit.detect_events_structured("bike", "myogait_output_no_events.json", fps=100.0)
paths = gaitkit.export_detection(out, "outputs/trial_07", formats=("json", "myogait"))
print(paths)
```

Input fields recognized per frame:
- `frame_idx`
- `hip_L`, `knee_L`, `ankle_L`
- `hip_R`, `knee_R`, `ankle_R`
- `pelvis_tilt`, `trunk_angle`
- optional `landmark_positions`

MyoGait-compatible output file (`*_myogait_events.json`) contains:
- `events.method`
- `events.fps`
- `events.left_hs`, `events.right_hs`, `events.left_to`, `events.right_to`
  as arrays of `{frame, time, confidence}`.

## Project

- Repository: https://github.com/IDMDataHub/gaitkit
- Issue tracker: https://github.com/IDMDataHub/gaitkit/issues
- Reproducibility: https://github.com/IDMDataHub/gaitkit/blob/master/REPRODUCIBILITY.md

## Development testing

```bash
python -m pip install -e ./python
python -m unittest -v
```

## Build distributions

```bash
python -m pip install build
cd python
python -m build
```
