วันศุกร์ที่ 2 พฤศจิกายน พ.ศ. 2561

Raspberry pi TensorFlow Object Detection API


Raspberry pi TensorFlow Object Detection API


What is TensorFlow Object Detection API?

Creating accurate machine learning models capable of localizing and identifying multiple objects in a single image remains a core challenge in computer vision. The TensorFlow Object Detection API is an open source framework built on top of TensorFlow that makes it easy to construct, train and deploy object detection models. At Google we’ve certainly found this codebase to be useful for our computer vision needs, and we hope that you will as well.


Why Raspberry Pi?
The raspberry pi is a neat piece of hardware that has captured the hearts of a generation with ~15M devices sold, with hackers building even cooler projects on it. Given the popularity of Deep Learning and the Raspberry Pi Camera we thought it would be nice if we could detect any object using Deep Learning on the Pi.

Steps
Install OpenCV
http://raspberrypi4u.blogspot.com/2018/08/raspberry-pi-install-opencv.html

Install TensorFlow
https://www.tensorflow.org/install/

Install Protobuf
https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md

get the packages needed

sudo apt-get install autoconf automake libtool curl
download the protobuf 
wget https://github.com/google/protobuf/releases/download/v3.5.1/protobuf-all-3.5.1.tar.gz
tar -zxvf protobuf-all-3.5.1.tar.gz
cd protobuf-3.5.1
Configure the build
./configure
Build the package
make -j4
sudo make install
cd python
export LD_LIBRARY_PATH=../src/.libs
python setup
python3 setup.py build --cpp_implementation 
python3 setup.py test --cpp_implementation
sudo python3 setup.py install --cpp_implementation
path commands
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION_VERSION=3
Finally
sudo ldconfig
Test
protoc
Setup TensorFlow Directory 

mkdir tensorflow1
cd tensorflow1
Download the tensorflow repository
git clone --recurse-submodules https://github.com/tensorflow/models.git
we need to modify the PYTHONPATH environment
sudo nano ~/.bashrc
export PYTHONPATH=$PYTHONPATH:/home/pi/tensorflow1/models/research:/home/pi/tensorflow1/models/research/slim



cd /home/pi/tensorflow1/models/research
protoc object_detection/protos/*.proto --python_out=.

cd /home/pi/tensorflow1/models/research/object_detection
Download the SSDLite-MobileNet model
wget http://download.tensorflow.org/models/object_detection/ssdlite_mobilenet_v2_coco_2018_05_09.tar.gz
tar -xzvf ssdlite_mobilenet_v2_coco_2018_05_09.tar.gz

RUN Code

Download the code
wget https://raw.githubusercontent.com/EdjeElectronics/TensorFlow-Object-Detection-on-the-Raspberry-Pi/master/Object_detection_picamera.py
python3 Object_detection_picamera.py --usbcam

if you use picam
python3 Object_detection_picamera.py 

Reference
https://github.com/EdjeElectronics/TensorFlow-Object-Detection-on-the-Raspberry-Pi

https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md



My Website
email : info@softpowergroup.net  ,amphancm@gmail.com  Tel .+6681-6452400

3 ความคิดเห็น:

  1. Esta muy interesante este articulo y todo el blog, me ayudo mucho en todas mis dudas, gracias. quiero compartir tambien una pagina que me ayudo mucho a mi. para conocer mejor las placa raspberry raspberry pi proyectos

    ตอบลบ
  2. Once again a great posts by you
    please tell me how we can make money via forum posting?
    I’m using forum posting to get some extra traffic to my blog via signature links but never think to make money from it ??
    Hope to get more knowledge from you.
    Regards!
    just click here Visit my Site goodnewsagency24"

    ตอบลบ