Skip to content

Advantech-EdgeSync-Containers/Memryx-NPU-Demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Memryx PPE Demo Logo

PPE Demo from MemryX

This demo showcases a Personal Protective Equipment (PPE) detection application using the YOLOv8n model with 512x512 input resolution. The system is designed to predict and classify individuals based on their safety compliance in real-time video streams or images. The model identifies three categories:

  • Safety: The person is wearing both a helmet and a vest.
  • Half-Safety: The person is wearing either a helmet or a vest, but not both.
  • Non-Safety: The person is wearing neither a helmet nor a vest.

By leveraging advanced object detection capabilities, the application helps monitor and enforce safety protocols in industrial or construction environments, ensuring that personnel adhere to required safety standards.

MemryX MX3 Accelerator

  • High-Efficiency AI Inference : Utilizes a unique dataflow architecture with at-memory computing, enabling fast and power-efficient AI model inference.
  • Seamless Integration : Connects to host systems via standard PCIe or USB interfaces, supporting x86, ARM, and RISC-V processors on both Windows and Linux platforms.
  • Full AI Offloading : Handles all AI inference on-chip, requiring the host only for pre- and post-processing, which simplifies software development and deployment.

Requirements

  1. Ensure your host machine is equipped with a MemryX MX3 module.
  2. Follow the installation instructions at MemryX Developer Hub to install the MX3 driver. Verify that the driver is successfully installed on your device before proceeding.
  3. X11 Display Support: Facilitates seamless rendering of model outputs directly to a host display from inside the container environment.
  4. (Optional) USB Camera Access:
    The application can utilize a connected USB camera for live streaming PPE detection. Ensure your camera is plugged in and accessible to the container for real-time video inference.

How to Build Docker Image

About the Docker Image

The provided Docker image is designed for seamless deployment and execution of the PPE detection demo on Ubuntu 24.04 host systems. The container comes pre-installed with all necessary dependencies, including:

  • MemryX Runtime SDK 1.2: Enables efficient interaction with the MemryX MX3 accelerator.
  • Qt Development Tools: Includes qtbase5-dev and qt5-qmake for building and running the graphical user interface.
  • OpenCV Development Libraries: libopencv-dev for image and video processing tasks.
  • CMake: Facilitates building C++ projects within the container.
  • ONNX Runtime v1.18.1: Provides high-performance inference for ONNX models.

This Docker image provides a ready-to-use environment for running the PPE detection application, eliminating the need for manually installing dependencies.

Approach 1: Pull the Docker Image from Harbor Registry

  1. Pull the Docker Image from Harbor Registry
    Use the following command to pull the image:

    docker pull harbor.edgesync.cloud/memryx-npu-demo/memryx@sha256:b661667b07e400f3ca3e54bc6887f7812232ebc25765e74203862f0fb0a0e13e
  2. Tag the Pulled Image
    After pulling, tag the image for easier reference:

    docker tag c8a956486bc0 memryx:demo

Approach 2: Setting Up Docker Images by Downloading a TAR File

  1. Download the Docker Image
    Download the Docker image from this link.

  2. Load a prebuilt Docker image
    Load docker image by using:

    docker load -i memryx_demo.tar

Tip: You can also use the provided script scripts/pull_docker_image.sh to automate the image download, loading, and tagging steps described above.

How to run

  1. Run the PPE detection with video
    Start the container with (or use the provided script scripts/run_ppe_video.sh):

    xhost +local:root
    docker run -t -i --rm\
        --privileged=true\
        --network="host"\
        -e DISPLAY=$DISPLAY\
        -v /tmp/.X11-unix:/tmp/.X11-unix\
        --name test memryx:demo \
        bash -c "cd /home/PPE/build && ./yolov8_ppe"
  2. Run the PPE detection with camera streaming Start the container with (or use the provided script scripts/run_ppe_camera.sh):

    xhost +local:root
    docker run -t -i --rm\
        --privileged=true\
        --network="host"\
        -e DISPLAY=$DISPLAY\
        -v /tmp/.X11-unix:/tmp/.X11-unix\
        --name test memryx:demo \
        bash -c "cd /home/PPE/build && ./yolov8_ppe -c ../configs/YOLOv8n_PPE_usbcam.txt"

Example Inference Result

Below is an example of the PPE detection output. The system highlights detected individuals and classifies their safety compliance in real-time: PPE Detection Example

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages