0% found this document useful (0 votes)
118 views4 pages

Image Recognition With TensorFlow On Raspberry Pi

Uploaded by

Richard Kunkel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
118 views4 pages

Image Recognition With TensorFlow On Raspberry Pi

Uploaded by

Richard Kunkel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

instructables

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.

Step 1: Machine Learning

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.

Image Recognition With TensorFlow on Raspberry Pi: Page 1


Step 2: Deep Learning

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.

Example: Object detection. It detects what is

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.

Python 3.4 (recommended)


Raspberry Pi
Power Supply
Raspbian 9 (Stretch)

Step 4: Update Your Raspberry Pi and Its Packages

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

sudo apt-get upgrade sudo apt install libatlas-base-dev

Step 2: Test that you have latest python version, Step 4: Install TensorFlow using Pip3 install
using this command. command.

python3 –-version pip3 install tensorflow

It is recommended to have at least Python 3.4. Now TensorFlow is installed.

Step 3: We need to install libatlas library (ATLAS -

Image Recognition With TensorFlow on Raspberry Pi: Page 2


Step 5: Predicting an Image Using Imagenet Model Example:

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

Step 6: Custom Image Prediction

You can also download an image from the internet or --


use your own image shot on your camera for image_file=/home/pi/Downloads/TensorImageTest1.j
predictions. For better results use less memory pg
images.
You can try out other examples too. But you need to
To use custom images, use the following way. I have install necessary packages before execution. We will
the image file at the location cover some interesting TensorFlow topics in the
‘/home/pi/Downloads/TensorImageTest1.jpg’. Just upcoming tutorials.
replace this with your file location and name. Use
‘Copy Path(s)’ for easier navigation. Check out our FactoryForward blog for more tutorials
on Arduino, Raspberry Pi, microBit,etc.
python3 classify_image.py
Shop at FactoryForward - Approved Raspberry Pi

Image Recognition With TensorFlow on Raspberry Pi: Page 3


Image Recognition With TensorFlow on Raspberry Pi: Page 4

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy