lobe / web-bootstrap

Bootstrap your Lobe machine learning model with our web starter project.
https://lobe.ai
MIT License
73 stars 32 forks source link

Question around padding #26

Open sabatale opened 2 years ago

sabatale commented 2 years ago

Great project and lots of good ideas! I'm testing lobe within a Chrome extension but can't seem to make it work. I was wondering if you had any guideline specifically for extension with tfjs?

My code is working only up to @tensorflow/tfjs ^1.7.4 for some reason and the official Google example also uses a very old release: https://github.com/tensorflow/tfjs-examples/blob/master/chrome-extension/src/background.js. I'm using the same settings as the example file generated during the Lobe export (scalar 255, center crop, resize).

Unfortunately the predictions are wrong. They are very accurate when tested locally with Lobe but do not seem to work at all within the extension (all confidence levels seem to be the same, no matter the image). I had to replace the RVhQTElDSVQ= padding with U0FNRQ== as well (not supported in 1.7.4) - could that be the reason?