After collecting data for a specific class in a separate file, add a class column to the dataset with a constant integer representing that class.
Additionally, ensure that the sensor reading columns are properly named.
- Open the CSV in VS Code, Excel, LibreOffice, or Python.
- Add a
classcolumn. -
Name sensor reading columns as follows:
acc_xacc_yacc_zgyro_xgyro_ygyro_z
-
Label each row according to your gestures.
For example:
acc_x,acc_y,acc_z,gyro_x,gyro_y,gyro_z,class 0.1,0.0,9.8,0.02,0.01,0.00,0 -0.2,0.5,9.7,0.04,0.05,0.02,0 -0.3,0.6,9.7,0.05,0.06,0.03,0Where
0is theIDLEgesture.acc_x,acc_y,acc_z,gyro_x,gyro_y,gyro_z,class 0.2,0.0,9.8,0.02,0.01,0.08,1 -0.14,0.5,9.7,0.04,0.05,0.01,1 -0.3,0.6,9.7,3.05,0.09,0.03,1Where
1is theUNKNOWNgesture. -
Proceed with labeling all 8 gesture classes:
- Swipe right:
2 - Swipe left:
3 - Double knock:
4 - Double thumb tap:
5 - Rotation clockwise:
6 - Rotation counter-clockwise:
7
Note
Classes must start from
0. For example, if you are training a model to predictswipe,rotate,tap, encode them as0,1,2. Save the encoding dictionary for future reference. - Swipe right: