Readme.md 1.76 KB
Newer Older
Pontus Andersson's avatar
Pontus Andersson committed
1
# WASP AS 1 Assigment: Activity Recognition, by Frida Heskebeck, Matthias Mayr, Momina Rizwan and Pontus Andersson
pandersson's avatar
pandersson committed
2 3

Our activity recognition is based on thresholds.
Pontus Andersson's avatar
Pontus Andersson committed
4
The approach is to use the mean of the x, y and z accelerometer data.
pandersson's avatar
pandersson committed
5 6 7 8 9 10 11 12 13
Over a time interval of two seconds, we look at the difference of the max and min values of the mean.
If the differences is lower than a set threshold, the person is predicted to be standing still.
If the difference is greater than the still treshold but smaller than a set running threshold, the person is predicted to be walking.
Otherwise, the person is predicted to be running.

This repository contains three scripts used to perform activity recognition and data visualization.
The data is stored in the `data` directory. To include your own data, add a subfolder to `data` named Data_YourData.
We assume the scripts are called from the as1-activity-recognition folder.

Pontus Andersson's avatar
Pontus Andersson committed
14
* `src/data_visualization.py` allows you to visualize data. Usage: `python src/data_visualization.py Name DataType`,
pandersson's avatar
pandersson committed
15 16 17
where `Name` is the name of the person whose data you wish to show, and `DataType` is either `ACC` or `GYR` for accelerometer and
gyro data, respectively. Red bars are used to separate the data files.

Pontus Andersson's avatar
Pontus Andersson committed
18
* `src/get_data.py` is a helper function for `src/activity_recognition.py`. It collects the data used in the latter script.
pandersson's avatar
pandersson committed
19

Pontus Andersson's avatar
Pontus Andersson committed
20 21
* `src/activity_recognition.py` allows you to do activity recognition. Usage: `python src/activity_recognition.py Name PresentationMode`,
where `Name` is as in `src/data_visualization.py` and `PresentationMode` is either `Text` or `ConfusionMatrix`, with
pandersson's avatar
pandersson committed
22 23
`Text` yielding console output of each prediction and corresponding ground truth, and `ConfusionMatrix` yielding a confusion matrix.
For both options, we print the accuracy in the console.