One of the largest obstacles for beginners getting experience with artificial intelligence and machine learning can honestly be the setup.
I’m not going to lie, there are still plenty of days that completely slip away, just trying to get Python, TensorFlow and my GPU to cooperate. Does this make me question my abilities as a competent software engineer? Yes, yes it does.
What does that mean for us? We can try it out right from this Medium article!
In this demo we are using a deep learning model called “MobileNet”. MobileNet is a type of Convolution Neural Network, a model architecture that is good at image classification.
Note: To learn more about what artificial intelligence actually sees, check out my other article.
Using TensorFlow.js to classify an image with MobileNet is as easy as 3 lines of code:
.then(model => model.classify(myImage))
.then(predictions => // Use predictions)
At the time of writing this post TensorFlow provides 5 official models, that are just as easy to use:
mobilenet: Classify images with labels from the ImageNet database.
posenet: Realtime pose detection. Blog post here.
coco-ssd: Object detection based on the TensorFlow object detection API.
speech-commands: Classify 1 second audio snippets from the speech commands dataset.
knn-classifier: Create a custom k-nearest neighbors classifier. Can be used for transfer learning.
However, if none of these models suffice, you can also create/train your own, but that’s for another article.
For fun, I challenge you to look at the PoseNet documentation and try to match the results of the cover photo. But, if you get stuck here’s the code and demo:
If you found this article helpful, it would mean a lot if you gave it some applause👏 and shared to help others find it! And feel free to leave a comment below.