Safety Helmet Vest Detection application is used to detect the safety helmet and vest present in an image.
The AI model used for the sample application is YOLOV3.
- RZ/V2H Evaluation Board Kit (RZ/V2H EVK)

Prepare the following equipments referring to Getting Started.
Equipment | Details |
---|---|
RZ/V2H EVK | Evaluation Board Kit for RZ/V2H |
USB camera | - |
HDMI monitor | Display the application. |
HDMI cable | Connect HDMI monitor and RZ/V2H Board. |
microSD Card | Used as filesystem. |
USB Hub | Used for connecting USB Mouse and USB Keyboard to the board. |
USB Mouse | Used for HDMI screen control. |
USB Keyboard | Used for terminal input. |
Note: All external devices will be attached to the board and does not require any driver installation (Plug n Play Type).
Connect the hardware as shown below.
When using the keyboard connected to RZ/V2H Evaluation Board, the keyboard layout and language are fixed to English.
Note: User can skip to the next stage (deploy) if they don't want to build the application. All pre-built binaries are provided.
This project expects the user to have completed Getting Started provided by Renesas.
After completion of Getting Started, the user is expected of following conditions.
- The board setup is done.
- SD card is prepared.
- The docker container of
rzv2h_ai_sdk_image
is running on the host machine.
Note: Docker environment is required for building the application.
-
On your host machine, download the repository from the GitHub to the desired location.
- It is recommended to download/clone the repository on the
data
folder which is mounted on therzv2h_ai_sdk_container
docker container as shown below.
cd <path_to_data_folder_on_host>/data git clone https://github.com/Ignitarium-Renesas/rzv_ai_apps.git
Note 1: Please verify the git repository url if error occurs.
Note 2: This command will download whole repository, which include all other applications.
If you have already downloaded the repository of the same version, you may not need to run this command. - It is recommended to download/clone the repository on the
-
Run (or start) the docker container and open the bash terminal on the container.
Here, we use therzv2h_ai_sdk_container
as the name of container, created fromrzv2h_ai_sdk_image
docker image.Note that all the build steps/commands listed below are executed on the docker container bash terminal.
-
Set your clone directory to the environment variable.
export PROJECT_PATH=/drp-ai_tvm/data/rzv_ai_apps
-
Go to the application source code directory.
cd ${PROJECT_PATH}/04_Safety_helmet_vest_detection/src
-
Build the application by following the commands below.
mkdir -p build && cd build cmake -DCMAKE_TOOLCHAIN_FILE=./toolchain/runtime.cmake -DV2H=ON .. make -j$(nproc)
-
The following application file would be genarated in the
${PROJECT_PATH}/04_Safety_helmet_vest_detection/src/build
directory
- safety_helmet_vest_app
For the ease of deployment all the deployables file and folders are provided on the exe_v2h folder.
File | Details |
---|---|
helmet_vest_yolov3 | Model object files for deployment. |
safety_helmet_vest_app | application file. |
-
Follow the steps below to deploy the project on the board.
- Run the commands below to download the
04_Safety_helmet_vest_deploy_tvm-v230.so
from Release v5.00
cd ${PROJECT_PATH}/04_Safety_helmet_vest_detection/exe_v2h/helmet_vest_yolov3 wget https://github.com/Ignitarium-Renesas/rzv_ai_apps/releases/download/v5.00/04_Safety_helmet_vest_deploy_tvm-v230.so
- Rename the
04_Safety_helmet_vest_deploy_tvm-v230.so
todeploy.so
.
mv 04_Safety_helmet_vest_deploy_tvm-v230.so deploy.so
- Copy the following files to the
/home/root/tvm
directory of the rootfs (SD Card) for the board.- All files in exe_v2h directory. (Including
deploy.so
file.) 04_Safety_helmet_vest_detection
application file if you generated the file according to Application File Generation
- All files in exe_v2h directory. (Including
- Check if
libtvm_runtime.so
is there on/usr/lib64
directory of the rootfs (SD card) on the board.
- Run the commands below to download the
-
Folder structure in the rootfs (SD Card) would look like:
├── usr/
│ └── lib64/
│ └── libtvm_runtime.so
└── home/
└── root/
└── tvm/
├── helmet_vest_yolov3/
│ ├── deploy.json
│ ├── deploy.params
│ └── deploy.so
├── labels.txt
└── safety_helmet_vest_app
Note: The directory name could be anything instead of
tvm
. If you copy the wholeexe_v2h
folder on the board. You are not required to rename ittvm
.
- On the board terminal, go to the
tvm
directory of the rootfs.
cd /home/root/tvm
-
Run the application.
- Application with USB camera input
./safety_helmet_vest_app USB
-
To terminate the application, switch the application window to the terminal by using Super(windows key)+ Tab and press ENTER key on the terminal of the board.
- YOLOv3: Darknet
- Dataset:*helmet-safety-vest-detection *Kaggle dataset
Input size: 1x3x416x416
Output1 size: 1x21x13x13
Output2 size: 1x21x26x26
Output3 size: 1x21x52x52
Board | AI inference time |
---|---|
RZ/V2H EVK | Approximately 25ms |
Processing | Details |
---|---|
Pre-processing | Processed by CPU. |
Inference | Processed by DRP-AI and CPU. |
Post-processing | Processed by CPU. |
- For RZ/V2H EVK, this application supports USB camera only with 640x480 resolution.
FHD resolution is supported by e-CAM22_CURZH camera (MIPI).
Please refer to following URL for how to change camera input to MIPI camera.
https://renesas-rz.github.io/rzv_ai_sdk/latest/about-applications.