The WearableSensorDataGenerator
is a tool to upgrade the very useful benchmark proposed by Artur et al. in the work *Human Activity Recognition Based on Wearable Sensor Data: A Standardization of the State-of-the-Art * (GitHub repository) to a format that enables the use of Keras data generator.
Currently, each dataset of the benchmark is available in a .npz file. A drawback of this, however, is that we have to move the entire dataset to memory, which in some cases can prevent the use. To cope with that, we created a simple script that extracts the samples to a folder and creates files to maintain information regarding the sample labels and the division of each cross-validation fold (this information is important to ensure the maintenance of the standardization proposed by Artur). We also provide the data generator class that uses our extracted data e feeds the train_on_batch() or the fit.predict() Keras's functions, as well as an example of its usage.
- Scikit-learn
- Scipy
- Keras (Recommended version 2.2.0)
- Tensorflow (Recommended version 1.5.0)
- Python 3
- Clone this repository
- Run
For example
python npz_to_fold.py -i <your/input/folder/> -o <your/output/folder/> -d <dataset1_name dataset2_name>
python npz_to_fold.py -i Z:/Datasets/ -o Z:/NewDatasets/ -d UTD-MHAD1_1s UTD-MHAD2_1s WHARF
- And, enjoy it!
Please refer to example.py.
See LICENSE.
Please cite our paper in your publications if it helps your research.
@article{Jordao:2018,
author = {Artur Jordao,
Antonio Carlos Nazare,
Jessica Sena and
William Robson Schwartz},
title = {Human Activity Recognition Based on Wearable Sensor Data: A Standardization of the State-of-the-Art},
journal = {arXiv},
year = {2018},
eprint = {1806.05226},
}