Skip to content

Commit b786c2d

Browse files
authored
Merge pull request #333 from pycom/pb-ml-integration
sintaxe fixes on ml documentation
2 parents 454871a + f98b83e commit b786c2d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

content/pybytes/mlintegration/features.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Select the devices and click on the **DEPLOY MODEL** button.
9090

9191
![Model Deployment](/gitbook/assets/pybytes/ml/deploy.png)
9292

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.
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.
9494

9595
* 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.
9696

@@ -102,13 +102,13 @@ from math import sin
102102
import json
103103
import pycom
104104

105-
# This is just a dummy example. In a real application, the input
105+
# This is just a dummy example. In a real application, the input
106106
# data should be collected from the accelerometer.
107107

108108
def new_model(model_str):
109109
"""Instantiate deployed model."""
110110
return pycom.ml_new_model(model_str)
111-
111+
112112

113113
def run_model(window_data):
114114
"""Run model to classify data."""
@@ -119,14 +119,14 @@ def run_model(window_data):
119119
print(' {}: {:.2}%'.format(label, result[index] * 100))
120120

121121
# Read deployed model.
122-
with open('flash/model_definition.json') as file:
122+
with open('/flash/model_definition.json') as file:
123123

124124
# Parse the model_definition.
125125
model_str = file.read()
126126
model_dict = json.loads(model_str)
127127

128128
# Read blocks.
129-
for block in model_dict['model']['blocks']:
129+
for block in model_dict['blocks']:
130130
if block['block_type'] == 'pre_processing_block':
131131
pp_block = block
132132
if block['block_type'] == 'nn_block':

0 commit comments

Comments
 (0)