我正在使用python-shell运行一个python脚本,该脚本对一个图像进行分类,并返回yes/no(如果该图像是我想要的或不是)。你知道吗
你知道吗节点.js代码:
app.get('/classify', function(req, res) {
var options = {
mode: 'text',
pythonOptions: ['-u'],
scriptPath: 'src/',
args: ['--image', '../../images/image.png', 'classifer.xml']
};
PythonShell.run('classify_images.py', options, function(err, results) {
if (err) throw err;
// results is an array consisting of messages collected during execution
console.log('results: %j', results);
});
res.send('classify');
});
如果我以python脚本的形式运行该命令,它可以正常工作,但是当我运行它时节点.js,它给了我所有的否定
python命令(在src中)是:
python classify_images.py --image ../../images/image.png classifer.xml
显然,我没有把正确的文件路径-它的工作之后。你知道吗
相关问题 更多 >
编程相关推荐