element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Shift it! Warehouse Automation Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Shift it! Warehouse Automation Design Challenge
  • More
  • Cancel
Shift it! Warehouse Automation Design Challenge
Forum Object Detection using Edge Impulse and Raspberry Pi
  • News
  • Forum
  • Projects
  • Leaderboard
  • Files
  • Members
  • Mentions
  • More
  • Cancel
  • New
Join Shift it! Warehouse Automation Design Challenge to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 2 replies
  • Subscribers 43 subscribers
  • Views 431 views
  • Users 0 members are here
  • design challenge
  • object detection
  • raspberry pi
  • edge impulse
  • shift it
  • dixon selvan
Related

Object Detection using Edge Impulse and Raspberry Pi

dixonselvan
dixonselvan 5 months ago

Intelligent Extra Arm (IEA) - Logo Intelligent Extra Arm

Edge Impulse and Raspberry Pi

In the last forum discussion, I had completed the initial setup of Raspberry Pi for my project. In this forum discussion, I'll proceed with the setup of Edge Impulse and Raspberry Pi connected to an USB Webcam for Object detection. This will help the Intelligent Extra Arm to detect what objects are resistors, capacitors like that. Let's get started!

Raspberry Pi - Setup

  1. I have run the below commands in Raspberry Pi's terminal.  
    sudo apt update
    curl -sL https://deb.nodesource.com/setup_20.x | sudo bash -
    sudo apt install -y gcc g++ make build-essential nodejs sox gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-base-apps
    sudo npm install edge-impulse-linux -g --unsafe-perm


  2. Next step was to configure the camera module using sudo raspi-config command. Since, I'm using Raspberry Pi running Ubuntu OS and have an USB camera, I'm skipping this part.

  3. Ran the below commands for setting up Edge Impulse using Docker. I didn't had Docker libary installed. So I have installed it at first (skip if required). While running second command, got the following error 'docker: unknown server OS: .'. For this adding sudo in front resolved it.                                                                                                             
    sudo snap install docker
    
    sudo docker run -it --rm --privileged --network=host -v /dev/:/dev/ --env UDEV=1 --device /dev:/dev --entrypoint /bin/bash ubuntu:20.04
    
    apt-get update
    apt-get install wget -y
    wget https://deb.nodesource.com/setup_20.x
    bash setup_20.x
    apt install -y gcc g++ make build-essential nodejs sox gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-base-apps vim v4l-utils usbutils udev
    apt-get install npm -y
    npm install edge-impulse-linux -g --unsafe-perm
    
    /lib/systemd/systemd-udevd --daemon


  4. After running above commands successfully, I ran below command to connect with Edge Impulse project. This asked to enter my Edge Impulse account's email and password. Once successfully logged in, it listed all my projects and I selected a new one created for this project.                                                                                                                                                                                                                                                                                   
    edge-impulse-linux

    Note: I had created a new project in this link - https://studio.edgeimpulse.com/studio/profile/projects?autoredirect=1 after logging in or signing up for an Edge Impulse account, by providing project name and selecting project type and setting.

  5. It then asked to select a microphone and while it was checking for connected webcam, it failed with the following error. Error - Failed to initialize linux tool Error: Cannot find any webcams. I tried a couple of commands for updating/ installing libraries. But the below set of commands seemed to have solved the issue and I was able to connect to the webcam.
    git clone https://gitlab.freedesktop.org/gstreamer/gstreamer.git
    cd gstreamer
    sudo apt install gcc g++ make build-essential nodejs sox gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-base-apps
    sudo npm install edge-impulse-linux -g --unsafe-perm

  6. After auto selection of camera module, then gave a name to the device and the steps required for setup is completed.

I was able to see the Raspberry Pi device successfully added to my Edge Impulse project.

image

Edge Impulse - Testing Data Acquisition

I was able to successfully test Data Acquisition as well. Below is a screenshot of the same. I have also manually created a bounding box and labelled it as a resistor. Since I'll be using object detection to find items in my inventory.

image

Edge Impulse - Training, Testing, and Deploying the model

  1. Data Acquisition - I then sampled a few more pieces of data and made one sample as test data.
    image
  2. Create Impulse - I then created below Impulse with the following steps - resizing the image to 96x96, an image preprocessing block, then added an object detection learning block, output it automatically selected the name of the items (resistor/ capacitor).
    image

  3. Image - Then I generated features using the training data set.
    image

  4. Object Detection - I then trained the model (FOMO (Faster Objects, More Objects) MobileNetV2 0.35) using the default settings. Below screenshot shows the training output and model summary.
    image
  5. Live Classification - Then I did a quick live classification and could see the model was able to find the capacitor but not the resistor. Anyways, I'll be loading more dataset and training the model again. For starters, the flow is working as expected. Below screenshot shows the live classification outcome.
    image

  6. Deployment - Ran the below command in the terminal of Raspberry Pi and below is the outcome of the same.
    edge-impulse-linux-runner

    image
    image

In case of any challenges, you can refer to this official documentation - https://docs.edgeimpulse.com/docs/edge-ai-hardware/cpu/raspberry-pi-4. Stay tuned for more!

  • Sign in to reply
  • Cancel

Top Replies

  • DAB
    DAB 5 months ago +1
    Nice start. I look forward to seeing how this all plays out.
Parents
  • DAB
    DAB 5 months ago

    Nice start.

    I look forward to seeing how this all plays out.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • DAB
    DAB 5 months ago

    Nice start.

    I look forward to seeing how this all plays out.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
Children
  • dixonselvan
    dixonselvan 5 months ago in reply to DAB

    Thanks DAB 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube