You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Once you have the model deployed on the devices, it can be used for furthers applications like movement detection and so on.
93
+
* Once the model is deployed on the device, it can be called from python code to classify new gestures using the data collected from the accelerometer sensor.
94
94
95
-
* This file is going to be used by the device firmware, and once generated it should not be changed by the user. Any changes can cause features to malfunction.
95
+
*The path to the deployed model is: `/flash/model_definition.json`. This file is going to be used by the device firmware, and once generated it should not be changed by the user. Any changes can cause features to malfunction.
96
96
97
+
* The pycom module provides two functions for model interaction: `pycom.ml_new_model()` and `pycom.ml_run_model()`. Below is a very simple example:
98
+
99
+
```python
100
+
import json
101
+
import pycom
102
+
103
+
# A window which contains a gesture. Should be a list with 126 * 3 = 378 entries. This is because, in model_definition.json, the window_size_ms = 2000, sampling_frequency=62.5, so: 62.5*2 + 1 = 126 samples in a window.
104
+
# The data is in the next format: acc_x, acc_y, acc_z, acc_x, ...
105
+
# This is just an example. In a real application, this data should be collected from the accelerometer.
0 commit comments