Image Recognition With TensorFlow On Raspberry Pi
Image Recognition With TensorFlow On Raspberry Pi
by Sarath341
Google TensorFlow is an Open-Source software For more tutorials visit our blog. Get Raspberry Pi
Library for Numerical Computation using data flow from FactoryForward - Approved Reseller in India.
graphs. It is used by Google on its various fields of
Machine Learning and Deep Learning Technologies. Read this tutorial on our blog here.
TensorFlow was originally developed by Google
Brain Team and it is published on the public domain
like GitHub.
Machine Learning and Deep Learning will come under Artificial Intelligence (AI). A Machine Learning will observe
and analyze the available data and improves it results over time.
Example: YouTube Recommended videos feature. It shows related videos that you viewed before. The prediction
is limited to text-based results only. But deep learning can go deeper than this.
The deep learning is almost similar to that, but it collecting various information of an object. It has
makes more accurate decision on its own by many layers of analysis and takes a decision
according to it. To fasten the process, it uses Neural available in an image. Something similar that you can
Network and provides us more exact result that we differentiate an Arduino and Raspberry Pi by its
needed (means better prediction than ML). appearance, size and Colors.
Something like how a human brain thinks and makes
decisions. It is a wide topic and has various applications.
Step 3: Pre-Requisites
The TensorFlow announced official support for Raspberry Pi, from Version 1.9 it will support Raspberry Pi using
pip package installation. We will see how to install it on our Raspberry Pi in this tutorial.
Step 1: Update Your Raspberry Pi and its packages. Automatically Tuned Linear Algebra Software).
Because TensorFlow uses numpy. So, install it using
sudo apt-get update the following command
Step 2: Test that you have latest python version, Step 4: Install TensorFlow using Pip3 install
using this command. command.
TensorFlow has published a model to predict images. Click’ on it. Choose ‘Copy Path(s)’. Then paste it in
You need to download the model first then run it. terminal after the ‘cd’ and press enter. By this way
you can navigate faster without any errors (in case of
Step 1: Run the following command to download the spelling mistake or the file name is changed in new
models. You might need to have git installed. updates).
git clone https://github.com/tensorflow/models.git I used ‘Copy Path(s)’ method so it will include the
exact path on the image (/home/pi).
Step 2: Navigate to imagenet example.
Step 3: Run the example using this command. It will
cd models/tutorials/image/imagenet take about 30 seconds to show the predicted result.
Pro Tip: On the new Raspbian Stretch, you can find python3 classify_image.py
the ‘classify_image.py’ file manually and then ‘Right