Using TensorFlow.js with pre-trained MobileNet model for image classification on Node.js
Tested:
- Ubuntu 18.04 Intel
- Ubuntu 18.04 Jetson TX2
- Ubuntu 18.04 Jetson Nano
- Raspbian Raspberry Pi4
Notes: https://gist.github.com/bigsnarfdude/b9926795b039f89af10ae482db7ac083
git clone https://github.com/bigsnarfdude/tfjs-node-example.git
npm install
node script.js mobilenet/model.json panda.jpg
classification results: [ { className:
'giant panda, panda, panda bear, coon bear, Ailuropoda melanoleuca',
probability: 0.9993536472320557 },
{ className:
'American Staffordshire terrier, Staffordshire terrier, American pit bull terrier, pit bull terrier',
probability: 0.00012968324881512672 },
{ className: 'Arctic fox, white fox, Alopex lagopus',
probability: 0.00008463481208309531 } ]