TensorFlow.js Example Hands-On Guide
[Read More] Come on, three lines of code for image classification.
Author Nick Bourdakos
Compile | Xiaowen
What is TensorFlow.js? What can it do?
In the official page, tensorflow.js is "a javascript library for training and deploying ML models in the browser and node.js".
And what can it do? Follow this article and try it out.
The Demo
Due to the version of WeChat, the demo cannot be loaded, you can move to. https://codesandbox.io/s/o4l6pnlkzz?from-embed
In this demo, we use a deep learning model called "MobileNet". MobileNet is a convolutional neural network, a model structure that excels in image classification.
The Code
Classifying images with MobileNet using tensorflow.js is very simple and requires only 3 lines of code.
mobilenet.load() .then(model => model.classify(myImage)) .then(predictions => // Use predictions)
Final Thoughts
At the time of writing, TensorFlow provides five official patterns that are equally easy to use.
However, if none of these models are enough, you can also create/training your own models.
Link to original article.
https://hackernoon.com/start-using-tensorflow-js-without-leaving-this-article-fb683ac509ed
-END-