- Open
/index.html
on a local server or run it through the p5.js Web Editor: https://editor.p5js.org/Nikify/sketches/yXA5qmePw. - Allow access to webcam.
- Verify that PoseNet has successfully loaded (success message will be logged in the terminal).
- Enter the label/name of an exercise and press
Collect data
.- Stand in front of the webcam and perpare to perform exercise.
- When the initial countdown (5 seconds) has finished, start performing the exercise. PoseNet data is now being collected.
- When the second countdown (3 seconds) has finished, data collection stops.
- If you wish to collect more exercise data, repeat step 4.1 - 4-3.
- Export your data as JSON by pressing
Export data
.
The time required to collect exercise data can be changed in /sketch.js
by modifying the constant collectingTimeMs
:
const collectingTimeMs = 3000; //time period for collecting data points (in ms)
The interval with which exercise data is collected can also be changed in /sketch.js
by modifying the constant collectingIntervalMs
:
const collectingIntervalMs = 200; //interval between collection of data points (in ms)
- Install Python and NymPy
- Run
python convert.py {your/path/data.json}
- The converted NumPy data is as in
/data.npy
- Add support for labels in NumPy
- The labels entered during data collection are included in the exported JSON file. However, the JSON to NumPy converter currently ignores labels.