PeopleSegNet Model Card
The model described in this card detects one or more “person” objects within an image and returns a box around each object, as well as a segmentation mask for each object.
This model is based on MaskRCNN with ResNet50 as its feature extractor. MaskRCNN is a widely adopted two-stage architecture, which uses Region Proposal Network (RPN) to generate object proposals and various prediction heads to predict object categories, refine bounding boxes and generate instance masks.
The training algorithm optimizes the network to minimize the mask, localization and confidence loss for the objects.
PeopleSegNet v2.1 model was trained on a proprietary dataset with more than 5 million objects for person class. The training dataset consists of a mix of camera heights, crowd-density, and field-of view (FOV). Approximately half of the training data consisted of images captured in an indoor office environment. For this case, the camera is typically set up at approximately 10 feet height, 45-degree angle and has close field-of-view. This content was chosen to improve accuracy of the models for convenience-store retail analytics use-case.
|10ft Indoor (Office close FOV)
Training Data Ground-truth Labeling Guidelines
The training dataset is created by labeling ground-truth bounding-boxes and categories by human labellers. Following guidelines were used while labelling the training data for NVIDIA PeopleSegNet model. If you are looking to re-train with your own dataset, please follow the guideline below for highest accuracy.
PeopleSegNet project labelling guidelines:
All objects that fall under one of the three classes (person, face, bag) in the image and are larger than the smallest bounding-box limit for the corresponding class (height >= 10px OR width >= 10px @1920x1080) are labeled with the appropriate class label.
If a person is carrying an object please mark the bounding-box to include the carried object as long as it doesn’t affect the silhouette of the person. For example, exclude a rolling bag if they are pulling it behind them and are distinctly visible as separate object. But include a backpack, purse etc. that do not alter the silhouette of the pedestrian significantly.
Occlusion: For partially occluded objects that do not belong a person class and are visible approximately 60% or are marked as visible objects with bounding box around visible part of the object. These objects are marked as partially occluded. Objects under 60% visibility are not annotated.
Occlusion for person class: If an occluded person’s head and shoulders are visible and the visible height is approximately 20% or more, then these objects are marked by the bounding box around the visible part of the person object. If the head and shoulders are not visible please follow the Occlusion guidelines in item 3 above.
Truncation: For an object other than a person that is at the edge of the frame with visibility of 60% or more visible are marked with the truncation flag for the object.
Truncation for person class: If a truncated person’s head and shoulders are visible and the visible height is approximately 20% or more mark the bounding box around the visible part of the person object. If the head and shoulders are not visible please follow the Truncation guidelines in item 5 above.
Each frame is not required to have an object.
The inference performance of PeopleSegNet v2.1 model was measured against 42000 proprietary images across a variety of environments. The frames are high resolution images 1920x1080 pixels resized to 960x576 pixels before passing to the PeopleSegNet model.
Methodology and KPI
The true positives, false positives, false negatives are calculated using intersection-over-union (IOU) criterion greater than 0.5. The KPI for the evaluation data are reported in the table below. Model is evaluated based on precision, recall and accuracy.
The inference is run on the provided pruned models at INT8 precision. On the Jetson Nano FP16 precision is used. The inference performance is run using
trtexec on Jetson Nano, AGX Xavier, Xavier NX and NVIDIA T4 GPU. The Jetson devices are running at Max-N configuration for maximum GPU frequency. The performance shown here is the inference only performance. The end-to-end performance with streaming video data might slightly vary depending on other bottlenecks in the hardware and software.
These models need to be used with NVIDIA Hardware and Software. For Hardware, the models can run on any NVIDIA GPU including NVIDIA Jetson devices. These models can only be used with Train Adapt Optimize (TAO) Toolkit, DeepStream SDK or TensorRT.
Primary use case intended for the model is detecting and segmenting people in a color (RGB) image. The model can be used to detect and segment people from photos and videos by using appropriate video or image decoding and pre-processing.
The model is intended for training using Transfer Learning Toolkit with the user's own dataset or using it as it is. This can provide high fidelity models that are adapted to the use case. The Jupyter notebook available as a part of TLT container can be used to re-train.
The model is encrypted and will only operate with the following key:
- Model load key:
Please make sure to use this as the key for all TAO commands that require a model load key.
Color Images of resolution 960 X 576 X 3
Category label (person), bounding-box coordinates and segmentation mask for each detected person in the input image.
Instructions to use unpruned model with TAO
In order, to use these models as a pretrained weights for transfer learning, please use the snippet below as template for the
maskrcnn_config component of the experiment spec file to train a MaskRCNN model. For more information on the experiment spec file, please refer to the TAO Toolkit User Guide.
# Region Proposal Network
# Proposal layer.
# Faster-RCNN heads.
bbox_reg_weights: "(10., 10., 5., 5.)"
# Mask-RCNN heads.
# model architecture
aspect_ratios: "[(1.0, 1.0), (1.4, 0.7), (0.7, 1.4)]"
# localization loss
Instructions to deploy these models with DeepStream
To create the entire end-to-end video analytic application, deploy these models with DeepStream SDK. DeepStream SDK is a streaming analytic toolkit to accelerate building AI-based video analytic applications. DeepStream supports direct integration of these models into the deepstream sample app.
To deploy these models with DeepStream 6.1, please follow the instructions below:
/opt/nvidia/deepstream is the default DeepStream installation directory. This path will be different if you are installing in a different directory.
You will need 2 config files and 1 label file. These files are provided in NVIDIA-AI-IOT.
deepstream_app_source1_peoplesegnet.txt - Main config file for DeepStream app
pgie_peopleSegNetv2_tao_config.txt - File to configure inference settings
peopleSegNet_labels.txt - Label file with 1 class
Key Parameters in
network-type=3 ## 3 is for instance segmentation network
deepstream-app -c deepstream_app_source1_peoplesegnet.txt
Documentation to deploy with DeepStream is provided in "Deploying to DeepStream" chapter of TAO User Guide.
Very Small Objects
NVIDIA PeopleSegNet model were trained to detect objects larger than 10x10 pixels. Therefore it may not be able to detect objects that are smaller than 10x10 pixels.
When objects are occluded or truncated such that less than 20% of the object is visible, they may not be detected by the PeopleSegNet model. For people class objects, the model will detect occluded people as long as head and shoulders are visible. However if the person’s head and/or shoulders are not visible, the object might not be detected unless more than 60% of the person is visible.
Dark-lighting, Monochrome or Infrared Camera Images
The PeopleSegNet model were trained on RGB images in good lighting conditions. Therefore, images captured in dark lighting conditions or a monochrome image or IR camera image may not provide good detection results.
Warped and Blurry Images
The PeopleSegNet models were not trained on fish-eye lense cameras or moving cameras. Therefore, the models may not perform well for warped images and images that have motion-induced or other blur.
Face and Bag class
Although bag and face class are included in the model, the accuracy of these classes will be much lower than people class. Some re-training will be required on these classes to improve accuracy.
- trainable_v2.1 - ResNet50 based pre-trained model.
- deployable_v2.0.2 - ResNet50 based model deployable to deepstream.
- K. He, G. Gkioxari, P. Dollar, and R. Girshick. Mask RCNN. In ICCV, 2017. 1, 2, 4
- Get TAO Container
- Get other Purpose-built models from NGC model registry:
- Train like a ‘pro’ without being an AI expert using TAO AutoML
- Create Custom AI models using NVIDIA TAO Toolkit with Azure Machine Learning
- Developing and Deploying AI-powered Robots with NVIDIA Isaac Sim and NVIDIA TAO
- Learn endless ways to adapt and supercharge your AI workflows with TAO - Whitepaper
- Customize Action Recognition with TAO and deploy with DeepStream
- Read the 2 part blog on training and optimizing 2D body pose estimation model with TAO - Part 1 | Part 2
- Learn how to train real-time License plate detection and recognition app with TAO and DeepStream.
- Model accuracy is extremely important, learn how you can achieve state of the art accuracy for classification and object detection models using TAO
- More information on about TAO Toolkit and pre-trained models can be found at the NVIDIA Developer Zone: https://developer.nvidia.com/tao-toolkit
- Read the TAO User Guide guide and release notes.
- If you have any questions or feedback, please refer to the discussions on TAO Toolkit Developer Forums
- Deploy your model on the edge using DeepStream. Learn more about DeepStream SDK https://developer.nvidia.com/deepstream-sdk
License to use these models is covered by the Model EULA. By downloading the unpruned or pruned version of the model, you accept the terms and conditions of these licenses.
Training and evaluation dataset mostly consists of North American content. An ideal training and evaluation dataset would additionally include content from other geographies.
NVIDIA’s platforms and application frameworks enable developers to build a wide array of AI applications. Consider potential algorithmic bias when choosing or creating the models being deployed. Work with the model’s developer to ensure that it meets the requirements for the relevant industry and use case; that the necessary instruction and documentation are provided to understand error rates, confidence intervals, and results; and that the model is being used under the conditions and in the manner intended.