Back to All
Project

Deploy On-device Edge Impulse AI On Rubik Pi 3: Safety Vision PPE Object Detection

This project demonstrates how to deploy an Edge Impulse AI model for real-time Personal Protective Equipment (PPE) object detection directly on the Rubik Pi 3 board. It leverages the Qualcomm® Neural Processing SDK for AI to run efficient on-device inference using a USB camera and a lightweight frontend-backend architecture. Additionally, this project implements a simple pre-trained Qualcomm® AI Hub PPE Detection model to showcase the differences between Edge Impulse and Qualcomm AI Hub.

The system is designed to enhance workplace safety by identifying PPE compliance through computer vision, making it suitable for industrial and construction environments. The project includes a full walkthrough of hardware setup, software configuration, and deployment steps, enabling developers to replicate and extend the solution.

Qualcomm-image

Objective

Through the integration of Edge Impulse and Qualcomm Technologies, this project aims to simplify the deployment of AI models on Qualcomm® hardware using the Rubik Pi 3 platform. By leveraging the Qualcomm Neural Processing SDK for AI along Edge Impulse, developers can run efficient, on-device inference without requiring deep expertise in embedded systems or AI acceleration.

To demonstrate this streamlined workflow, we developed a comprehensive example that guides users through setting up the hardware, configuring the software environment, and deploying a PPE object detection model.

 

Equipment Required Parts List / Tools

Rubik Pi 3 Board

https://rubikpi.ai/

USB Camera

 

Optional: Raspberry Pi Raspberry Pi 5 Active Cooler - Aluminum Heatsink - SC1148

https://a.co/d/aFozNPB

 

Source Code / Source Examples / Application Executable

GitHub Source Code

https://github.com/qualcomm/dragonwing-iot-samples/tree/main/rpi3-edge-impulse-ppe-detection

Edge Impulse Model

https://studio.edgeimpulse.com/public/746098/latest

Qualcomm AI Hub Model

https://aihub.qualcomm.com/iot/models/gear_guard_net

 

Additional Resources

Edge Impulse Documentation

https://docs.edgeimpulse.com/docs

Qualcomm Neural Processing SDK for AI

https://www.qualcomm.com/developer/software/neural-processing-sdk-for-ai

 

System Architecture:

Qualcomm-image

Hardware Setup:

1. Optional: Connect the RPI cooler to the Rubik Pi

  • Warning: Without an RPI cooler, you risk a chance of overheating the board!

2. Plug in the USB camera into one of the USB ports of the Rubik Pi
 

Software Setup:

1. Flash an Ubuntu build onto the Rubik Pi 3 board

2. Connect the Rubik Pi 3 board to internet

3. On the Rubik Pi 3 board, make sure the following packages are installed by running the commands:

4. Make sure to connect your account to the Edge Impulse CLI and select the proper project

5. Clone this GitHub Repository directly on the Rubik Pi 3 board

 

Sequence Diagram:

Qualcomm-image

Above is a sequence diagram showcasing how the websocket requests are passed from the frontend to the backend and inference models back to the frontend.
 

Frontend:

The frontend is implemented with a Vite React.js + Typescript. The frontend acts as a client to the websocket backend.

To run the frontend independently use the following command in the frontend folder: npm run dev -- --host
The webpage will be accessible on the local network IP address of the Rubik Pi at the port 3000 (such as: http://10.0.0.31:3000). The website has an index page, Edge Impulse page (http://10.0.0.31:3000/edge-impulse), and QAI Hub page (http://10.0.0.31:3000/qai-hub).
 

Backend:

The backend consists of a Python websocket server that acts as a proxy to communicate between the Rubik Pi 3's camera, on-device AI models, and frontend.

To run the backend independently use the following command in the backend folder: python3 main.py
The websocket will be accessible on the local network IP address of the Rubik Pi at the port 8765 (such as: ws://10.0.0.31:8765). The webhook has two routes for each on-device model: ws://localhost:8765/edge-impulse and ws://localhost:8765/qai-hub.

There is also the Edge Impulse Linux Runner tool configured to use the Qualcomm Neural Network SDK to run on-device inference via an internal HTTP API server.

To run the edge impulse runner independently use the following command: edge-impulse-linux-runner --enable-camera --force-target runner-linux-aarch64-qnn --force-engine tflite --force-variant int8 --run-http-server 8760
The http server will be accessible on the local network IP address of the Rubik Pi at the port 8760 (such as: http://10.0.0.31:8760).

1. Run the following command in the root directory of the project (the rpi3-edge-impulse-ppe-detection directory): python3 runner.py

  • The runner.py script will automatically install all dependencies and start the demo. More info about the underlying project can be found on the GitHub source code
  • Note: The first time running the runner.py script will take some time to install all the Python and npm project dependencies
  • To stop the project, interrupt the running runner.py script by pressing ctrl + c (causing a keyboard Interrupt exception)

2. Access the hosted webpage via the local network IP address of the Rubik Pi at the port 3000

  • For example: http://10.0.0.31:3000

Visiting the local network IP address of the Rubik Pi at port 3000 will present the home page of the webapp:

Qualcomm-image

Visiting a model subpage will present a live inference feed from the on-device model:

Qualcomm-image

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries ("Qualcomm"). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.

Project Authors
Andrew CollinsDeveloper Intern Qualcomm
Hayden EstlerDigital Strategy Intern Qualcomm
Christian WallSnapdragon Product Intern Qualcomm
Annabelle WangIoT Product Intern Qualcomm
Qualcomm relentlessly innovates to deliver intelligent computing everywhere, helping the world tackle some of its most important challenges. Our leading-edge AI, high performance, low-power computing, and unrivaled connectivity deliver proven solutions that transform major industries. At Qualcomm, we are engineering human progress.

Stay connected

Get the latest Qualcomm and industry information delivered to your inbox.

Subscribe
Manage your subscription

© Qualcomm Technologies, Inc. and/or its affiliated companies.

Snapdragon and Qualcomm branded products are products of Qualcomm Technologies, Inc. and/or its subsidiaries. Qualcomm patented technologies are licensed by Qualcomm Incorporated.

Note: Certain services and materials may require you to accept additional terms and conditions before accessing or using those items.

References to "Qualcomm" may mean Qualcomm Incorporated, or subsidiaries or business units within the Qualcomm corporate structure, as applicable.

Qualcomm Incorporated includes our licensing business, QTL, and the vast majority of our patent portfolio. Qualcomm Technologies, Inc., a subsidiary of Qualcomm Incorporated, operates, along with its subsidiaries, substantially all of our engineering, research and development functions, and substantially all of our products and services businesses, including our QCT semiconductor business.

Materials that are as of a specific date, including but not limited to press releases, presentations, blog posts and webcasts, may have been superseded by subsequent events or disclosures.

Nothing in these materials is an offer to sell or license any of the services or materials referenced herein.