盧俊吉
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Openvino with NCS2 ON Raspi-4 ref. The PDF made by 梁藝鐘 ref. https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Can-t-get-through-OpenVINO-installation-on-RBPi-NCS2/m-p/1327705 ref. https://www.intel.com/content/www/us/en/support/articles/000057005/boards-and-kits.html All the commands below should be run at the Command Line If the command has "jl" in it, change to the user you're currently using. e.g.. you're using "pi" as user, then change "jl" to "pi" # Setting up ### Check the user at the same groups as the "pi" user ref. [2) Add the new user to the same groups as the "pi" user. This command will do that.](https://forums.raspberrypi.com/viewtopic.php?t=169079) or just use **pi** to login ### Software up to date ``` sudo apt update && sudo apt upgrade -y ``` ### (opt) Using wired network the network will be more stable while downloading, but wifi is also acceptable # Install CMack 3.14.4 Back to root ``` cd ~/ ``` Download CMack ``` wget https://github.com/Kitware/CMake/releases/download/v3.14.4/cmake-3.14.4.tar.gz ``` Unzip CMack file ``` tar xvzf cmake-3.14.4.tar.gz ``` Go to CMack file ``` cd ~/cmake-3.14.4 ``` Run ./bootstrap, will take a while ``` ./bootstrap ``` Success: ![](https://hackmd.io/_uploads/BJjLe4GM6.png) Then run make, also take a long long time ``` make -j4 ``` Success: ![](https://hackmd.io/_uploads/rJY77NGz6.png) this one Should be quick ``` sudo make install ``` Success: ![](https://hackmd.io/_uploads/HJ4HXEfzT.png) # Install OpenCV back to root ``` cd ~/ ``` install packages ``` sudo apt install git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libatlas-base-dev python3-scipy ``` download opencv ``` git clone --depth 1 --branch 4.5.2-openvino https://github.com/opencv/opencv.git ``` go to opencv && create new file && go to new file ``` cd opencv && mkdir build && cd build ``` ``` cmake –DCMAKE_BUILD_TYPE=Release –DCMAKE_INSTALL_PREFIX=/usr/local .. ``` Take a really long time ``` make -j4 ``` Success: ![](https://hackmd.io/_uploads/BJluqWHGMT.png) ``` sudo make install ``` Success: ![](https://hackmd.io/_uploads/B1LnWHzMp.png) # Install OpenVINO ``` cd ~/ ``` ``` git clone --depth 1 --branch releases/2021/4 https://github.com/openvinotoolkit/openvino.git ``` ``` cd ~/openvino ``` (optional) under openvino file, this command can check the version of openvino, and it should be 2021/4 ``` git branch ``` take a while ``` git submodule update --init --recursive ``` ``` sh ./install_build_dependencies.sh ``` setup path ``` export OpenCV_DIR=/usr/local/lib/cmake/opencv4 ``` Success: ![](https://hackmd.io/_uploads/SkHcQrfGp.png) ``` cd ~/openvino/inference-engine/ie_bridges/python/ ``` ``` pip3 install -r requirements.txt ``` if using unstable network, it may fail with incorrect hash value, like the img below ![](https://hackmd.io/_uploads/B1AJ4Hzfa.png) run the command below solve my problem, which reinstall without cache the previous file (which is already wrong hash value) ref: https://stackoverflow.com/questions/71435874/pip-these-packages-do-mot-match-the-hashes-from-the-requirements-file ``` pip install --no-cache-dir -r requirements.txt ``` Success: ![](https://hackmd.io/_uploads/Hk74SBGf6.png) ``` sudo apt install libusb-1.0-0-dev ``` ``` sudo apt-get install cython3 ``` # Build OpenVINO ``` cd ~/openvino && mkdir build && cd build ``` ``` git config --global user.name "abc" && git config --global user.email "abc@example.com" ``` ## Important, this command can be vary due to the user ### Change "/home/{user}/openvino_dist" to the user you're using. ### e.g.. i'm using "jl" user so change to /home/jl/openvino_dist, like the img and code below ### so if you'r using "pi" as user, change to /home/pi/openvino_dist ![](https://hackmd.io/_uploads/SyxIDBMGp.png) ``` cmake -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/home/jl/openvino_dist \ -DENABLE_MKL_DNN=OFF \ -DENABLE_CLDNN=OFF \ -DENABLE_GNA=OFF \ -DENABLE_SSE42=OFF \ -DTHREADING=SEQ \ -DENABLE_OPENCV=OFF \ -DNGRAPH_PYTHON_BUILD_ENABLE=ON \ -DNGRAPH_ONNX_IMPORT_ENABLE=ON \ -DENABLE_PYTHON=ON \ -DPYTHON_EXECUTABLE=$(which python3.7) \ -DPYTHON_LIBRARY=/usr/lib/arm-linux-gnueabihf/libpython3.7m.so \ -DPYTHON_INCLUDE_DIR=/usr/include/python3.7 \ -DCMAKE_CXX_FLAGS="-Wno-psabi -latomic" .. ``` ``` make -j4 ``` ![](https://hackmd.io/_uploads/HkIFp5Xf6.jpg) Success: ![](https://hackmd.io/_uploads/rJzGjIzz6.png) ``` sudo make install ``` Success: ![](https://hackmd.io/_uploads/ry_4jUGza.png) # Testing, Now need to plug NCS2 in usb3 port (the blue one) ``` cd ~/openvino/bin/armv7l/Release ``` this command check whether u plug the NCS2 to Raspi and whether the system can read the NCS2 ``` ./object_detection_sample_ssd -h ``` Success: if the "Available target devices:" is not showing MYRIAD, then the system doesn't read the NCS2 ![](https://hackmd.io/_uploads/SkgsjIzzT.png) ``` cd ~/Downloads ``` Now, that's download the demo ``` wget https://download.01.org/opencv/2021/openvinotoolkit/2021.2/open_model_zoo/models_bin/3/person-vehicle-bike-detection-crossroad-0078/FP16/person-vehicle-bike-detection-crossroad-0078.bin ``` ``` wget https://download.01.org/opencv/2021/openvinotoolkit/2021.2/open_model_zoo/models_bin/3/person-vehicle-bike-detection-crossroad-0078/FP16/person-vehicle-bike-detection-crossroad-0078.xml ``` this command download the img which is for model to detect the person at the "Download" file ``` wget https://cdn.pixabay.com/photo/2018/07/06/00/33/person-3519503_960_720.jpg -O walk.jpg ``` ![](https://hackmd.io/_uploads/HyianLfzT.png) This may be unnecessary if you have already added the user to the 'users' group, but it's harmless to execute again ``` sudo usermod -a -G users "$(whoami)" ``` Setup the enrivment and install NCS rule ## Important, the two commands below can be vary due to the user ### you should change "jl" to the user you're using. e.g.. u'r using pi as user then the command should be like: "source /home/**pi**/openvino_dist/bin/setupvars.sh" and "sh /home/**pi**/openvino_dist/install_dependencies/install_NCS_udev_rules.sh" ``` source /home/jl/openvino_dist/bin/setupvars.sh ``` ``` sh /home/jl/openvino_dist/install_dependencies/install_NCS_udev_rules.sh ``` ![](https://hackmd.io/_uploads/SJhArwMzp.png) Go to the file where model exist ``` cd ~/openvino/bin/armv7l/Release ``` Execute the model to detect the person from wald.jpg ``` ./object_detection_sample_ssd -i ~/Downloads/walk.jpg -m ~/Downloads/person-vehicle-bike-detection-crossroad-0078.xml -d MYRIAD ``` The 'out_0.bmp' is the result. Open it, and you can see the image below, which means this time the victory is on your side. Congratulation ![](https://hackmd.io/_uploads/Hyg-TUGMT.png) ![](https://hackmd.io/_uploads/ryHhh8zfp.png) --- ## Additional The command above "source /home/jl/openvino_dist/bin/setupvars.sh" should be execute everytime u open command line, if u want to use NCS2 The command below can automaticaly execute "source /home/jl/openvino_dist/bin/setupvars.sh" eyerytime u open command line ``` echo "source /home/jl/openvino_dist/bin/setupvars.sh" >> ~/.bashrc ``` Therefore, u can directly execute the model after open the command line, like the img below ![](https://hackmd.io/_uploads/S17UaLGM6.png)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully