Hello,
I want to analyse pictures coming from a webcam.
Application has two parts:
- Nodejs app which manages the model & the classifier, and is interfaced with…
- WebBrowser js app which drives the camera, and provides captured images to Nodejs app.
If I succeed to analyse all pictures got from Internet (cars, bikes, peoples), I fails to analyse pictures coming from my webcam app. Error is :
“Input to reshape is a tensor with 200704 values, but the requested shape requires a multiple of 150528”
Here is extract of my code:
const _mobilenet = require('@tensorflow-models/mobilenet');
var_myNet = await _mobilenet.load();
...
// "buffer" is coming from webcam and provided to nodejs app:
_fs.writeFileSync( './data.png', buffer);
// data.png is valid and can be displayed with any image tools
let buffer = _fs.readFileSync( './data.png');
let image = _tfnode.node.decodeImage( buffer);
let predictions = await _myNet.classify( img);
==> error message
(I have saved and load “buffer” on/from file for my tests, but I think I can use buffer directly in _tfnode.node.decodeImage(). The result is the same in both scenarii).
How to solve this issue ?
Best regards