#
Safety Helmet Detector
Construction sites are dangerous places where accidents can happen at any time. Therefore, it is important to keep workers safe by enforcing safety measures, such as helmet use. However, monitoring worker compliance can be a challenging task. This is where a detection model can come in handy.
In this tutorial, you will build a detection model that can detect whether or not workers on a construction site are wearing helmets.
To create the model, use the publicly available Safety Helmet Detection dataset, which contains 5000 images with bounding box annotations for 3 classes: helmet, person, and head.
#
Adding the dataset
Go to the Owned datasets
and click Add new dataset
. Enter a dataset name, select Personal
dataset type, and click Create
.
The Safety Helmet Detection dataset has been saved in a .zip archive consisting of two folders: annotations and images. You can upload it either as an archive or as a directory. For the purpose of this tutorial, we will use the second option. Click Add directory
.
Once validated, you will see the annotated images in the thumbnails. Click Upload
.
Before uploading, decide what the application should do if the size limit is exceeded. For the purposes of this tutorial select Scale invalid images
.
The uploading task is performed in the background. You can monitor the progress in the Dashboard
or Datasets
view.
#
Creating the model
Go to the Models
section and click Add new model
. Select Detection.
From the Safety Helmet dataset select helmet and head categories.
Skip the merge categories step and click Next
. Enter the name of your model and select the Darknet
framework.
Choose the Configure manually
option. Click Next
.
Change the pretrained model to yolo4-tiny.conv.29
and click Start training
. You can view the training progress in the Dashboard
view, in the Notifications
tab, or in the Models
section.
#
Testing your idea
Once the training is complete, go to the Models
section.
Click on the Safety Helmet Detector model to run it.
Select the NVIDIA MAXWELL architecture. Click the hardware tile to convert.
Once converted, click on the device to connect to it.
Copy the registration code to the clipboard, then click Copy token and go to device
. This will open a new tab in your browser, where you will find a web app that is now using your local Nano device.
Paste your registration code into the Token
field, and create a password. Once registered, the device will change its status to Connected in the Live Testing
section of the OSAI app.
Click on the model tile to download it to the device's local memory. Click on the model again and select the input data required to test the model. Click the Upload File
button. You can upload either a photo or a video. For the purpose of this tutorial, we will use two different video files.
Once your video file has been uploaded, you can decide whether you want to save the results and/or upload images from video to a new or existing dataset. Click Next
to continue.
After the video is processed by the web app, you can view the results.
#
Results
Keep in mind You can always improve the effectiveness of the trained model by subjecting it to a re-training process.