All Projects → intel-iot-devkit → safety-gear-detector-python

intel-iot-devkit / safety-gear-detector-python

Licence: BSD-3-Clause license
Observe workers as they pass in front of a camera to determine if they have adequate safety protection.

Programming Languages

python
139335 projects - #7 most used programming language
Jupyter Notebook
11667 projects
shell
77523 projects

Projects that are alternatives of or similar to safety-gear-detector-python

motor-defect-detector-python
Predict performance issues with manufacturing equipment motors. Perform local or cloud analytics of the issues found, and then display the data on a user interface to determine when failures might arise.
Stars: ✭ 24 (-55.56%)
Mutual labels:  real-time, intel, inference, edge, image-recognition, pretrained-models, reference-implementation, live-demo, edge-computing, openvino, edge-ai
object-flaw-detector-python
Detect various irregularities of a product as it moves along a conveyor belt.
Stars: ✭ 17 (-68.52%)
Mutual labels:  real-time, intel, inference, edge, image-recognition, pretrained-models, reference-implementation, live-demo, edge-computing, openvino, edge-ai
concurrent-video-analytic-pipeline-optimization-sample-l
Create a concurrent video analysis pipeline featuring multistream face and human pose detection, vehicle attribute detection, and the ability to encode multiple videos to local storage in a single stream.
Stars: ✭ 39 (-27.78%)
Mutual labels:  real-time, intel, inference, edge, image-recognition, pretrained-models, reference-implementation, live-demo, edge-computing, openvino, edge-ai
object-flaw-detector-cpp
Detect various irregularities of a product as it moves along a conveyor belt.
Stars: ✭ 19 (-64.81%)
Mutual labels:  intel, inference, edge, image-recognition, pretrained-models, reference-implementation, live-demo, edge-computing, openvino, edge-ai
object-size-detector-python
Monitor mechanical bolts as they move down a conveyor belt. When a bolt of an irregular size is detected, this solution emits an alert.
Stars: ✭ 26 (-51.85%)
Mutual labels:  intel, inference, edge, image-recognition, pretrained-models, reference-implementation, live-demo, edge-computing, openvino, edge-ai
intruder-detector-python
Build an application that alerts you when someone enters a restricted area. Learn how to use models for multiclass object detection.
Stars: ✭ 16 (-70.37%)
Mutual labels:  intel, inference, edge, image-recognition, pretrained-models, reference-implementation, live-demo, edge-computing, openvino, edge-ai
People Counter Python
Create a smart video application using the Intel Distribution of OpenVINO toolkit. The toolkit uses models and inference to run single-class object detection.
Stars: ✭ 62 (+14.81%)
Mutual labels:  real-time, intel, inference, edge, image-recognition, pretrained-models, edge-computing
gaze-estimation-with-laser-sparking
Deep learning based gaze estimation demo with a fun feature :-)
Stars: ✭ 32 (-40.74%)
Mutual labels:  intel, inference, openvino
Berrynet
Deep learning gateway on Raspberry Pi and other edge devices
Stars: ✭ 1,529 (+2731.48%)
Mutual labels:  edge-computing, openvino, edge-ai
nn-Meter
A DNN inference latency prediction toolkit for accurately modeling and predicting the latency on diverse edge devices.
Stars: ✭ 211 (+290.74%)
Mutual labels:  inference, edge-computing, edge-ai
Fastmot
High-performance multiple object tracking based on YOLO, Deep SORT, and optical flow
Stars: ✭ 284 (+425.93%)
Mutual labels:  real-time, edge-computing
Trt pose
Real-time pose estimation accelerated with NVIDIA TensorRT
Stars: ✭ 525 (+872.22%)
Mutual labels:  real-time, pretrained-models
Xpedite
A non-sampling profiler purpose built to measure and optimize performance of ultra low latency/real time systems
Stars: ✭ 89 (+64.81%)
Mutual labels:  real-time, intel
ekuiper
Lightweight data stream processing engine for IoT edge
Stars: ✭ 975 (+1705.56%)
Mutual labels:  edge, edge-computing
Sod
An Embedded Computer Vision & Machine Learning Library (CPU Optimized & IoT Capable)
Stars: ✭ 1,460 (+2603.7%)
Mutual labels:  real-time, image-recognition
smart-social-distancing
Social Distancing Detector using deep learning and capable to run on edge AI devices such as NVIDIA Jetson, Google Coral, and more.
Stars: ✭ 129 (+138.89%)
Mutual labels:  edge-computing, edge-ai
VideoRecognition-realtime-autotrainer-alerts
State of the art object detection in real-time using YOLOV3 algorithm. Augmented with a process that allows easy training of the classifier as a plug & play solution . Provides alert if an item in an alert list is detected.
Stars: ✭ 36 (-33.33%)
Mutual labels:  real-time, image-recognition
AdvantEDGE
AdvantEDGE, Mobile Edge Emulation Platform
Stars: ✭ 36 (-33.33%)
Mutual labels:  edge, edge-computing
openvino pytorch layers
How to export PyTorch models with unsupported layers to ONNX and then to Intel OpenVINO
Stars: ✭ 17 (-68.52%)
Mutual labels:  intel, openvino
MobileNetV2-PoseEstimation
Tensorflow based Fast Pose estimation. OpenVINO, Tensorflow Lite, NCS, NCS2 + Python.
Stars: ✭ 99 (+83.33%)
Mutual labels:  intel, openvino

Safety Gear Detector

Details
Target OS: Ubuntu* 18.04 LTS
Programming Language: Python* 3.5
Time to Complete: 30-40min

safety-gear-detector

What It Does

This reference implementation is capable of detecting people passing in front of a camera and detecting if the people are wearing safety-jackets and hard-hats. The application counts the number of people who are violating the safety gear standards and the total number of people detected.

Requirements

Hardware

  • 6th to 8th Generation Intel® Core™ processors with Iris® Pro graphics or Intel® HD Graphics

Software

  • Ubuntu* 18.04 LTS
    Note: We recommend using a 4.14+ Linux* kernel with this software. Run the following command to determine the kernel version:

    uname -a
    
  • OpenCL™ Runtime Package

  • Intel® Distribution of OpenVINO™ toolkit 2020 R3 Release

How It Works

The application uses the Inference Engine included in the Intel® Distribution of OpenVINO™ toolkit.

Firstly, a trained neural network detects people in the frame and displays a green colored bounding box over them. For each person detected, the application determines if they are wearing a safety-jacket and hard-hat. If they are not, an alert is registered with the system.

Architectural diagram

Setup

Install Intel® Distribution of OpenVINO™ toolkit

Refer to Install the Intel® Distribution of OpenVINO™ toolkit for Linux* to install and set up the toolkit.

Install the OpenCL™ Runtime Package to run inference on the GPU. It is not mandatory for CPU inference.

Other dependencies

FFmpeg*

FFmpeg is a free and open-source project capable of recording, converting and streaming digital audio and video in various formats. It can be used to do most of our multimedia tasks quickly and easily say, audio compression, audio/video format conversion, extract images from a video and a lot more.

Setup

Get the code

Clone the reference implementation

sudo apt-get update && sudo apt-get install git
git clone https://github.com/intel-iot-devkit/safety-gear-detector-python.git

Install OpenVINO

Refer to Install Intel® Distribution of OpenVINO™ toolkit for Linux* to learn how to install and configure the toolkit.

Install the OpenCL™ Runtime Package to run inference on the GPU, as shown in the instructions below. It is not mandatory for CPU inference.

Which model to use

This application uses the person-detection-retail-0013 Intel® model, that can be downloaded using the model downloader. The model downloader downloads the .xml and .bin files that will be used by the application.

The application also uses the worker_safety_mobilenet model, whose Caffe* model file are provided in the resources/worker-safety-mobilenet directory. These need to be passed through the model optimizer to generate the IR (the .xml and .bin files) that will be used by the application.

To download the models and install the dependencies of the application, run the below command in the safety-gear-detector-cpp-with-worker-safety-model directory:

./setup.sh

The Config File

The resources/config.json contains the path of video that will be used by the application as input.

For example:

{
    "inputs": [
       {
           "video":"path_to_video/video1.mp4",
       }
    ]
}

The path/to/video is the path to an input video file.

Which Input Video to use

The application works with any input video. Sample videos are provided here.

For first-use, we recommend using the Safety_Full_Hat_and_Vest.mp4 video which is present in the resources/ directory.

For example:

{
    "inputs": [
       {
           "video":"sample-videos/Safety_Full_Hat_and_Vest.mp4"
       },
       {
           "video":"sample-videos/Safety_Full_Hat_and_Vest.mp4"
       }
    ]
}

If the user wants to use any other video, it can be used by providing the path in the config.json file.

Using the Camera Stream instead of video

Replace path/to/video with the camera ID in the config.json file, where the ID is taken from the video device (the number X in /dev/videoX).

On Ubuntu, to list all available video devices use the following command:

ls /dev/video*

For example, if the output of above command is /dev/video0, then config.json would be:

  {
     "inputs": [
        {
           "video":"0"
        }
     ]
   }

Setup the Environment

Configure the environment to use the Intel® Distribution of OpenVINO™ toolkit by exporting environment variables:

source /opt/intel/openvino/bin/setupvars.sh

Note: This command needs to be executed only once in the terminal where the application will be executed. If the terminal is closed, the command needs to be executed again.

Run the Application

Change the current directory to the git-cloned application code location on your system:

cd <path_to_the_safety-gear-detector-cpp-with-worker-safety-model_directory>/application

To see a list of the various options:

./safety_gear_detector.py -h

A user can specify what target device to run on by using the device command-line argument -d. If no target device is specified the application will run on the CPU by default. To run with multiple devices use -d MULTI:device1,device2. For example: -d MULTI:CPU,GPU,MYRIAD

Run on the CPU

To run the application using worker_safety_mobilenet model, use the -sm flag followed by the path to the worker_safety_mobilenet.xml file, as follows:

./safety_gear_detector.py -d CPU -m /opt/intel/openvino/deployment_tools/open_model_zoo/tools/downloader/intel/person-detection-retail-0013/FP32/person-detection-retail-0013.xml -sm ../resources/worker-safety-mobilenet/FP32/worker_safety_mobilenet.xml

If the worker_safety_mobilenet model is not provided as command-line argument, the application uses OpenCV to detect safety jacket and hard-hat. To run the application without using worker_safety_mobilenet model:

./safety_gear_detector.py -d CPU -m /opt/intel/openvino/deployment_tools/open_model_zoo/tools/downloader/intel/person-detection-retail-0013/FP32/person-detection-retail-0013.xml

Note: By default, the application runs on async mode. To run the application on sync mode, use -f sync as command-line argument.

Run on the Integrated GPU

  • To run on the integrated Intel GPU with floating point precision 32 (FP32), use the -d GPU command-line argument:

    FP32: FP32 is single-precision floating-point arithmetic uses 32 bits to represent numbers. 8 bits for the magnitude and 23 bits for the precision. For more information, click here

    ./safety_gear_detector.py -d GPU -m /opt/intel/openvino/deployment_tools/open_model_zoo/tools/downloader/intel/person-detection-retail-0013/FP32/person-detection-retail-0013.xml -sm ../resources/worker-safety-mobilenet/FP32/worker_safety_mobilenet.xml
    
  • To run on the integrated Intel® GPU with floating point precision 16 (FP16):

    FP16: FP16 is half-precision floating-point arithmetic uses 16 bits. 5 bits for the magnitude and 10 bits for the precision. For more information, click here

    ./safety_gear_detector.py -d GPU -m /opt/intel/openvino/deployment_tools/open_model_zoo/tools/downloader/intel/person-detection-retail-0013/FP16/person-detection-retail-0013.xml -sm ../resources/worker-safety-mobilenet/FP16/worker_safety_mobilenet.xml
    

Run on the Intel® Neural Compute Stick

To run on the Intel® Neural Compute Stick, use the -d MYRIAD command-line argument:

./safety_gear_detector.py -d MYRIAD -m /opt/intel/openvino/deployment_tools/open_model_zoo/tools/downloader/intel/person-detection-retail-0013/FP16/person-detection-retail-0013.xml -sm ../resources/worker-safety-mobilenet/FP16/worker_safety_mobilenet.xml

Run on the Intel® Movidius™ VPU

To run on the Intel® Movidius™ VPU, use the -d HDDL command-line argument:

./safety_gear_detector.py -m /opt/intel/openvino/deployment_tools/open_model_zoo/tools/downloader/intel/person-detection-retail-0013/FP32/person-detection-retail-0013.xml -sm ../resources/worker-safety-mobilenet/FP16/worker_safety_mobilenet.xml -d HDDL

Note: The Intel® Movidius™ VPU can only run FP16 models. The model that is passed to the application through the -m <path_to_model> command-line argument must be of data type FP16.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].