<img src="./_static/logo/combined_logo_with_text.png" width="700">

[![Documentation Status](https://readthedocs.org/projects/gaitmap-bench/badge/?version=latest)](https://gaitmap-bench.readthedocs.io/en/latest/?badge=latest)

# gaitmap-challenges & gaitmap-bench 

Reproducible benchmarks for IMU-based gait analysis.

This project is part of the gaitmap ecosystem.
[Learn more](https://gaitmap.readthedocs.io/en/latest/source/user_guide/gaitmap_ecosystem.html)

## gaitmap-challenges
<img src="./docs/_static/logo/challenges_logo_with_text.png" height="75">


You have developed an algorithm for gait analysis using foot-mounted IMUs? Then you can use gaitmap-challenges to 
quickly validate your algorithm using multiple different benchmark challenges.

1. Install gaitmap-challenges

   ```
   pip install gaitmap-challenges
   ```

2. Check the [list of available challenges](https://gaitmap-bench.readthedocs.io/en/latest/challenges/index.html)
3. Head over to the [`gaitmap_datasets` repository](https://github.com/mad-lab-fau/gaitmap-datasets#datasets) and 
   download the datasets you need.
4. Learn you to wrap your algorithm into a `tpcp.Pipeline` and run a challenge: [Guide](https://gaitmap-bench.readthedocs.io/en/latest/guides/running_challenges.html)
5. Inspect the results: TODO Link

Other things you can do with gaitmap-challenges:

- [Create your own challenge](https://gaitmap-challenges.readthedocs.io/en/latest/creating_challenges.html)

## gaitmap-bench
<img src="./docs/_static/logo/bench_logo_with_text.png" height="90">

### Viewing the results

You want to see how good existing algorithms perform in the gaitmap-challenges benchmarks?
This repo contains reproducible scripts and results to create baseline results for the gaitmap algorithms and hopefully
also for other algorithms in the future.

Find an overview over the results on the 
[documentation page](https://gaitmap-bench.readthedocs.io/en/latest/challenges/index.html).
(PS: You can download each result page as a Jupyter notebook to [play around with the results yourself](TODO GUIDE).)

To go deeper, you can find the raw results in the 
[`results` folder](https://github.com/mad-lab-fau/gaitmap-bench/tree/main/results)
and the code that generated the results in the 
[`entries` folder](https://github.com/mad-lab-fau/gaitmap-bench/tree/main/entries/gaitmap_algos)

### Adding new results

You think you can do better? Learn how to add your own algorithms to the gaitmap-bench repository 
[using this guide](https://gaitmap-bench.readthedocs.io/en/latest/guides/add_new_entry.html).

On that note, you should probably also check out our guides on:

- Ensuring reproducibility: TODO Link
- Local development: TODO Link
- Multi-processing: TODO Link

## Repo Structure

### Folders

This repo is quite complicated and has multiple sub-projects:

- top-level: The top-level folder contains general info files and the config for a "meta" Poetry project that can install all sub-projects at once for development.
- `gaitmap-challenges`: The `gaitma-challenges` package. The subfolder contains a full python package structure managed by Poetry
- `gaitmap-bench`: The `gaitmap-bench` package. The subfolder contains a full python package structure managed by Poetry
- `entries`: Contains the reproducible scripts that were used to create the benchmark results. Each group of algorithm is managed as its own project as well
- `results`: Contains the raw results of the benchmarks as json and csv files managed by categories.
- `docs`: The documentation for both packages and the challenge results.
- `gaitmap-paper`: Some source files to generate the plots in the gaitmap paper.

### Python Environments

Learn more about how to handle this during development in [this guide](https://gaitmap-bench.readthedocs.io/en/latest/guides/dev_setup.html).