I have an Express Node.js application, but I want to run a machine learning python codw with a following command.
I already find some online solutions to run python machine learning code.With this stackoverflow link How to call a Python function from Node.js
But with this solution I just run run a python code.
var spawn = require("child_process").spawn;
var process = spawn('python', ["./my_script.py"]);
process.stdout.on('data', function (data) {
res.send(data.toString());
})
With this code I just run a code python hello.py
.But I want to run a code with following commands python test.py --model dataset/test.model --image s.jpg