Can platform.io run tensorflowjs-converter a python and linux command line package?
Small machine learning models can easily be made using browser Javascript and tensorflowJS. I am an expert at that.
Microprocessors can load TFLITE models for machine learning analysis using Platform.io and lots of other methods like edgeimpulse.com. I am also an expert at that but it is so easy anyone could do it.
But typically we have to load a python module called tensorflowjs-converter to convert a tensorflowJS model into a keras model and then into a TFLITE model.
Can all of this be done with platform.io? Can it run a python or linux command once the converter is installed?
The actual commands are almost exactly the same each time.
The install commands are:
pip install tf-nightly
pip install tensorflowjs
pip install netron
also check that xxd has been installed with
xxd -h
``
Convert tensorflowjs to keras, then to TFLITE then to a c header file with xxd. Then view it with netron.
tensorflowjs_converter --input_format=tfjs_layers_model --output_format=keras_saved_model ./model.json ./
tflite_convert --keras_model_file ./ --output_file ./model.tflite
xxd -i model.tflite model.h
netron model.tflite