แสดงบทความที่มีป้ายกำกับ raspberry pi openvino แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ raspberry pi openvino แสดงบทความทั้งหมด

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

Raspberry pi 4B Object Detection with Intel Neural Compute Stick and OpenVINO

Raspberry pi Object Detection with Intel Neural Compute Stick and OpenVINO

This project showcases Object Detection on edge device.

We use Raspberry pi 4B board with Intel NCS ( Neural Compute Stick ) and OpenVINO Library and Source code from Intel AI.

 

Hardware

·     Raspberry Pi Board (4B )
·     Intel Neural Compute Stick 2
·     SD Card 32GB
·     5V DC. 2A Power Supply

Software

·     OS Raspbien 10 ( Buster )
·     Python 3.7.3
·     OpenVINO Toolkit 2019.R3
·     OpenCV 4.0.0

Machine Learning Object Detection Model : Mobilenet SSD V2

Run Python Code ( Async Mode )

Async API usage can improve overall frame-rate of the application, because rather than wait for inference to complete, the app can continue doing things on the host, while accelerator is busy.

This and other performance implications and tips for the Async API are covered in the Optimization Guide.

Other demo objectives are:

  • Video as input support via OpenCV*

  • Visualization of the resulting bounding boxes and text labels (from the .labels file) or class number (if no file is provided)



Video Test   : 960x540 pixels

Total frame  : 301 frames

Total Inference time   : 12.44 sec

Average performance : 24.20 fps

Run Python Code ( Sync Mode )





Video Test   : 960x540 pixels

Total frame  : 301 frames

Total Inference time   : 24.96 sec

Average performance : 12.06 fps


OpenVINO Toolkit

Now We try to use OpenVINO 2020.3 compare with OpenVINO 2019 R3.

OpenVINO 2020.3 frame rate is a little bit lower than OpenVINO 2019 R3.



Comparison

Async vs Sync Mode














This is my experiment may something was wrong.









YouTube Video

Raspberry pi Object Detection with Intel Neural Compute Stick and OpenVINO ( 2020.3 )

Compare Raspberry pi Object Detection Intel NCS ( Async vs. Sync mode )

Raspberry pi Object Detection with Intel Neural Compute Stick ( Sync mode )

Raspberry pi Object Detection with Intel Neural Compute Stick ( Async mode )

Compare Raspberry pi Object Detection ( TensorFlow vs. TensorFlow-lite ) 

Raspberry pi Object Detection with TensorFlow-lite ( INT8 )

Raspberry pi Object Detection with TensorFlow ( FP32 )

Reference

Raspberry pi OpenVINO with Intel Movidius ( Neural Compute Stick )

 

Install OpenVINO™ toolkit for Raspbian* OS

https://docs.openvino.ai/latest/openvino_docs_install_guides_installing_openvino_raspbian.html

Object Detection Python* Demo

https://docs.openvino.ai/latest/omz_demos_object_detection_demo_python.html

Model ( SSD MobileNet )


https://docs.openvino.ai/latest/omz_models_model_ssd_mobilenet_v1_coco.html


https://docs.openvino.ai/latest/omz_models_model_ssdlite_mobilenet_v2.html



OpenVINO Optimization


https://docs.openvino.ai/latest/openvino_docs_optimization_guide_dldt_optimization_guide.html



Adun Nantakaew อดุลย์ นันทะแก้ว 081-6452400
LINE : adunnan

    

วันจันทร์ที่ 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/