วันอังคารที่ 10 กันยายน พ.ศ. 2562

People tracking and counting with Raspberry pi 4 and Intel neural compute stick



People tracking and counting with Raspberry pi 4 and Intel neural compute stick

or Pedestrian Tracker


Hardware

 Raspberry pi 4B ( 1GB )
 Intel Neural Compute Stick 2
 32GB SD card

Software

 Raspbien 10 ( buster )
 OpenVINO toolkit 2019 R1
 OpenCV 4.0.0
 Code C/C++
 Model : Person-detection-retail-0013
 Model : Person-reidentification-0031
 Video MP4 768 x 432 12 fps


 


What is Intel Neural Compute Stick and OpenVINO?


Pedestrian Tracker C++ Demo
This demo showcases Pedestrian Tracking scenario: it reads frames from an input video sequence, detects pedestrians in the frames, and builds trajectories of movement of the pedestrians in a frame-by-frame manner. You can use a set of the following pre-trained models with the demo:
  • person-detection-retail-0013, which is the primary detection network for finding pedestrians
  • person-reidentification-retail-0031, which is the network that is executed on top of the results from inference of the first network and makes reidentification of the pedestrians
Source Code



Reference

Install the Intel® Distribution of OpenVINO™ Toolkit for Raspbian* OS

Pretrained Models

Inference Engine Samples 

OpenVINO, OpenCV, and Movidius NCS on the Raspberry Pi



วันพุธที่ 17 กรกฎาคม พ.ศ. 2562

Car Detection with Raspberry pi 4 + Intel Neural Compute Stick

Car Detection with Raspberry pi 4 + Intel Neural Compute Stick

System Requirements
Hardware:
  • Raspberry Pi 4B board or 3B+ 
  • 32GB microSD card
  • One of Intel® Movidius™ Visual Processing Units (VPU):
Intel® Movidius™ Neural Compute Stick or Intel® Neural Compute Stick 2


    Operating Systems:
    • Raspbian 10 ( Buster )
    • OpenVINO for Raspberry pi ( 2019.1.094 )
    • OpenCV 4.0.0
    • Python 3.7.3

    Machine Learning

    Model : SSD MobileNet V2



    Video Test
    MP4 960x540 Resolution


    Run Code


    Test 1 Raspberry pi 4B  NCS2



    Test 2 Raspberry pi 4B  NCS1



    Test 3 Raspberry pi 3B+  NCS2




    Test 4 Raspberry pi 3B+  NCS1 



    Test Result



    Raspberry Pi 4 vs Raspberry pi 3B+




    Reference

    Install the Intel® Distribution of OpenVINO™ Toolkit for Raspbian* OS

    Pretrained Models

    Inference Engine Samples 

    OpenVINO, OpenCV, and Movidius NCS on the Raspberry Pi


    วันจันทร์ที่ 15 กรกฎาคม พ.ศ. 2562

    Raspberry pi 4 TensorFlow Face Recognition


    Raspberry pi 4 TensorFlow Face Recognition


    Hardware
    Raspberry pi 4B - 1GB , Raspberry pi 3B+
    SD card 32 GB.

    Software
    Raspbien 10 ( buster )
    TensorFlow 1.13.1
    OpenCV 4.0.0
    Python 3.7.3

    Machine Learning 
    Model : Facenet Inception Resnet V1

    Source Code
    FaceRec.  A simple working facial recognition program.
    https://github.com/vudung45/FaceRec 

    Recognition Dataset





    Run Code on Raspberry pi 4 , 3B+ in Image


    Recognise with no dataset


    Run Code on Macbook Pro 2.3 GHz Intel Core i7 ( 2012 )





    Reference

    FaceRec.  A simple working facial recognition program.
    https://github.com/vudung45/FaceRec

    Pretrained models from: https://github.com/davidsandberg/facenet

    Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Networks
    https://kpzhang93.github.io/MTCNN_face_detection_alignment/

    Face recognition with OpenCV, Python, and deep learning
    https://www.pyimagesearch.com/2018/06/18/face-recognition-with-opencv-python-and-deep-learning/

    วันเสาร์ที่ 13 กรกฎาคม พ.ศ. 2562

    Raspberry pi4 Tensorflow object detection

    Raspberry pi 4 TensorFlow Object Detection


    On June 2019 Raspberry pi announce new version of raspberry pi board.
    Now we have a new raspberry pi 4 model B 1GB So try to run TensorFlow object detection and then compare with Raspberry pi3B+ also.



    Install TensorFlow on Raspberry pi4

    Add some dependency

    sudo pip3 install grpcio


    sudo pip3 install h5py

    Then Download tensorFlow
    https://www.piwheels.org/simple/tensorflow/tensorflow-1.13.1-cp37-none-linux_armv7l.whl#sha256=25f4ff027beec1e568baf8e90a07bad59d354560533d6b37318b9efeb70beeb1


    sudo pip3 install tensorflow-1.13.1-cp37-none-linux_armv7l.whl



    Summary Software for test.
    Rasbien 10 ( Buster )
    Python 3.7.3
    OpenCV 4.0.0
    Tensorflow 1.13.1



    Run Tensorflow Object Detection

    Model SSDlite Mobilenet V2
    Video MP4 768x432 12 fps

    run on the same img os in same sd-card.





    Raspberry pi 4 is 2.xx fps .
    Raspberry pi 3 is less than 1 fps.

    So, only Raspberry pi Board is not faster enough for tensorFlow object detection application.
    Then next we use raspberry pi with intel neural compute stick for better performance.

    Raspberry pi 4 vs Raspberry pi3 specification


    My Website

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

    วันจันทร์ที่ 8 เมษายน พ.ศ. 2562

    Raspberry pi OpenVINO with Intel Movidius ( Neural Compute Stick )

    Raspberry pi OpenVINO with Intel Movidius  

    ( Neural Compute Stick )


    What is OpenVINO?

    The Intel® Distribution of OpenVINO™ toolkit quickly deploys applications and solutions that emulate human vision. Based on Convolutional Neural Networks (CNN), the toolkit extends computer vision (CV) workloads across Intel® hardware, maximizing performance. The Intel Distribution of OpenVINO toolkit includes the Intel® Deep Learning Deployment Toolkit (Intel® DLDT).


    OpenVINO™ toolkit, short for Open Visual Inference and Neural network Optimization toolkit, provides developers with improved neural network performance on a variety of Intel® processors and helps them further unlock cost-effective, real-time vision applications.The toolkit enables deep learning inference and easy heterogeneous execution across multiple Intel® platforms (CPU, Intel® Processor Graphics)—providing implementations across cloud architectures to edge devices. This open source distribution provides flexibility and availability to the developer community to innovate deep learning and AI solutions.
    OpenVINO™ toolkit contains:
           •      Deep Learning Deployment Toolkit
           •      Open Model Zoo

    The Intel® Distribution of OpenVINO™ toolkit  is also available with additional, proprietary support for Intel® FPGAs, Intel® Movidius™ Neural Compute Stick, Intel® Gaussian Mixture Model - Neural Network Accelerator (Intel® GMM-GNA) and provides optimized traditional computer vision libraries (OpenCV*, OpenVX*), and media encode/decode functions. To learn more and download this free commercial product, visit: https://software.intel.com/en-us/openvino-toolkit


    What is Intel Movidius ( Neural Compute Stick )?

    The Intel® Movidius™ Neural Compute Stick (NCS) is a tiny fanless deep learning device that you can use to learn AI programming at the edge. NCS is powered by the same low power high performance Intel Movidius Vision Processing Unit (VPU) that can be found in millions of smart security cameras, gesture controlled drones, industrial machine vision equipment, and more.

    more detail
    http://raspberrypi4u.blogspot.com/2018/10/raspberry-pi-movidius-neural-compute-stick.html


    Samples Code Demo

    Face Detection , Object Detection  ( Object Detection C++ Sample SSD )

    Identify faces for a variety of uses, such as observing if passengers are in a vehicle or counting indoor pedestrian traffic. Combine it with a person detector to identify who is coming and going.




      

    Pre-trained Face Detection model

    https://download.01.org/openvinotoolkit/2018_R4/open_model_zoo/face-detection-adas-0001/FP16/face-detection-adas-0001.bin

    https://download.01.org/openvinotoolkit/2018_R4/open_model_zoo/face-detection-adas-0001/FP16/face-detection-adas-0001.xml

    To validate OpenCV* installation, you may try to run OpenCV's deep learning module with Inference Engine backend. Here is a Python* sample, which works with Face Detection model.

    Face Detect Python Code on Github



    Interactive Face Detection C++ Demo








    Age & Gender Recognition

    This neural network-based model provides age and gender estimates with enough accuracy to help you focus your marketing efforts.






    Emotion Recognition

    Identify neutral, happy, sad, surprised, and angry emotions.




    This model shows the position of the head and provides guidance on what caught the subject's attention.



     
    This demo showcases Object Detection task applied for face recognition using sequence of neural networks. Async API can improve overall frame-rate of the application, because rather than wait for inference to complete, the application can continue operating on the host while accelerator is busy. This demo executes four parallel infer requests for the Age/Gender Recognition, Head Pose Estimation, Emotions Recognition, and Facial Landmarks Detection networks that run simultaneously. You can use a set of the following pre-trained models with the demo:
    • face-detection-adas-0001, which is a primary detection network for finding faces
    • age-gender-recognition-retail-0013, which is executed on top of the results of the first model and reports estimated age and gender for each detected face
    • head-pose-estimation-adas-0001, which is executed on top of the results of the first model and reports estimated head pose in Tait-Bryan angles
    • emotions-recognition-retail-0003, which is executed on top of the results of the first model and reports an emotion for each detected face
    • facial-landmarks-35-adas-0002, which is executed on top of the results of the first model and reports normed coordinates of estimated facial landmarks
    For more information about the pre-trained models, refer to the https://github.com/opencv/open_model_zoo/blob/master/intel_models/index.md "Open Model Zoo" repository on GitHub*.

    This code sample showcases vehicle detection, vehicle attributes, and license plate recognition.

    The demo uses OpenCV to display the resulting frame with detections rendered as bounding boxes and text.





      
    This demo showcases Vehicle and License Plate Detection network followed by the Vehicle Attributes Recognition and License Plate Recognition networks applied on top of the detection results. You can use a set of the following pre-trained models with the demo:
    • vehicle-license-plate-detection-barrier-0106, which is a primary detection network to find the vehicles and license plates
    • vehicle-attributes-recognition-barrier-0039, which is executed on top of the results from the first network and reports general vehicle attributes, for example, vehicle type (car/van/bus/track) and color
    • license-plate-recognition-barrier-0001, which is executed on top of the results from the first network and reports a string per recognized license plate
    For more information about the pre-trained models, refer to the https://github.com/opencv/open_model_zoo/blob/master/intel_models/index.md "Open Model Zoo" repository on GitHub*.

    Install OpenVINO on Raspberry Pi

    System Requirements
    Hardware:
    • Raspberry Pi* board with ARMv7-A CPU architecture
    • 32GB microSD card
    • One of Intel® Movidius™ Visual Processing Units (VPU):
    Intel® Movidius™ Neural Compute Stick or Intel® Neural Compute Stick 2

    Operating Systems:
    • Raspbian* Stretch, 32-bit

    Your installation is complete when these are all completed:
    1. Install the Intel® Distribution of OpenVINO™ toolkit.
    2. Set the environment variables.
    3. Add USB rules.
    4. Run the Object Detection Sample and the Face Detection Model (for OpenCV*) to validate your installation.

    Reference

    Install the Intel® Distribution of OpenVINO™ Toolkit for Raspbian* OS

    Pretrained Models
    https://software.intel.com/en-us/openvino-toolkit/documentation/pretrained-models

    Inference Engine Samples 
    http://docs.openvinotoolkit.org/latest/_docs_IE_DG_Samples_Overview.html

    OpenVINO, OpenCV, and Movidius NCS on the Raspberry Pi
    https://www.pyimagesearch.com/2019/04/08/openvino-opencv-and-movidius-ncs-on-the-raspberry-pi/