HACC2018 / ohia.ai

MIT License
4 stars 1 forks source link

Add a TensorFlow.js model to do inference #43

Closed mrbarbasa closed 6 years ago

mrbarbasa commented 6 years ago

Got TensorFlow.js to run on Node and make predictions based on the 1000 classes of ImageNet. Sample output when you run node server/model.js (be sure to npm install first, have Node v10.12.0, and have Python v2.7.x):

Identification Results: [ { className: 'brain coral', probability: 0.3537396490573883 },
  { className: 'coral fungus', probability: 0.1802905946969986 },
  { className: 'starfish, sea star',
    probability: 0.14114698767662048 } ]

See this blog post if you'd like to learn more: http://jamesthom.as/blog/2018/08/07/machine-learning-in-node-dot-js-with-tensorflow-dot-js/

It's not yet robust and does not work on the ohia picture (in /server/images). I'm continuing to work off of this to generalize it and tie it to the frontend. Also, I'd like to try running an equivalent version in the browser for comparison. -- EDIT: Going with server, no time for trying it out on the browser.