NVIDIA
NVIDIA
CitySemSegFormer
Model
NVIDIA
NVIDIA
CitySemSegFormer

Semantic segmentation of persons in an image.

CitySemSegFormer Model Card

Description:

CitySemSegFormer segments classes within an image. This model segments the urban cityscapes into 19 classes which include:

  • road
  • sidewalk
  • building
  • wall
  • fence
  • pole
  • traffic light
  • traffic sign
  • vegetation
  • terrain
  • sky
  • person
  • rider
  • car
  • truck
  • bus
  • train
  • motorcycle
  • bicycle

This model is ready for commercial use.

References:

Citations

Using TAO Pre-trained Models

Model Architecture:

Architecture Type: Transformer
Network Architecture: Segformer

Input:

Input Type(s): Image
Input Format(s): Red, Green, Blue (RGB)
Input Parameters: 3D
Other Properties Related to Input: RGB Fixed Resolution:1024x1024x3 (W x H x C); No minimum bit depth, alpha, or gamma.

Output:

Output Type(s): Semantic Segmentation Mask
Output Format: Segmentation Mask: 2D vector

Software Integration:

Runtime Engine(s):

  • TAO - 5.2
  • DeepStream 6.1 or later

Supported Hardware Architecture(s):

  • Ampere
  • Jetson
  • Hopper
  • Lovelace
  • Pascal
  • Turing
  • Volta

Supported Operating System(s):

  • Linux
  • Linux 4 Tegra

Model Version(s):

  • trainable_mitb5_citysemsegformer_v1.0 - citySemSegformer mitB5 model trainable.
  • deployable_mitb5_citysemsegformer_v2.0 - citySemSegformer mitb5 deployable to Deepstream.
  • trainable_fan_baseHybrid_citysemsegformer_v1.0 - citySemSegformer FAN-Base-Hybrid model trainable.
  • deployable_fan_baseHybrid_citysemsegformer_v1.0 - citySemSegformer FAN-Base-Hybrid deployable to Deepstream.

Training & Evaluation:

Training Dataset:

Data Collection Method by dataset:

  • Automatic/Sensors

Labeling Method by dataset:

  • Human

Properties:
Proprietary dataset of 178,000 images. Most of the training dataset was collected in-house from images from a variety of dashcams and a small seed dataset containing images from traffic cameras in a city in the US. This content was chosen to auto-label urban city classes with segmentation masks.

ObjectDistribution
EnvironmentImagesCarsPersonsRoad SignsTwo-Wheelers
Dashcam (5ft height)128,0001.7M720,000354,12754,000
Traffic signal content50,0001.1M5350018400011000
Total178,0002.8M773,500538,12765,000

Evaluation Dataset:

Data Collection Method by dataset:

  • Automatic/Sensors

Labeling Method by dataset:

  • Human

Properties:
300 proprietary images that were hand labeled across a variety of environments.

Methodology and KPI

The KPI for the evaluation data are reported in the table below. Model is evaluated based on Mean Intersection-Over-Union. Mean Intersection-Over-Union (MIOU) is a common evaluation metric for semantic image segmentation, which first computes the IOU for each semantic class and then computes the average over classes.

ModelCitySemSegFormer
ClassesMIOU
road73.6
sidewalk46.88
building69.47
wall50.44
fence65.57
pole61.47
traffic light45.87
traffic sign72.8
vegetation77.4
terrain38.19
sky96.47
person81.78
rider33.07
car90.14
truck33.43
bus95.44
train3.2
motorcycle54.44
bicycle49.52

Inference:

Engine: Tensor(RT)
Test Hardware:

  • Jetson AGX Xavier
  • Xavier NX
  • Orin
  • Orin NX
  • NVIDIA T4
  • Ampere GPU
  • A2
  • A30
  • L4
  • T4
  • DGX H100
  • DGX A100
  • DGX H100
  • L40
  • JAO 64GB
  • Orin NX16GB
  • Orin Nano 8GB

The inference is run on the provided unpruned 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.

BS - Batch Size

MiT-B5 SegFormer

PlatformBSFPS
Jetson Orin Nano11.36
Orin NX 16GB11.9
AGX Orin 64GB14.8
A215.8
T419.4
A30429.3
L4117.8
L40147.3
A100862.2
H1008108

FAN-Base-Hybrid SegFormer

PlatformBSFPS
Jetson Orin Nano11.2
Orin NX 16GB11.78
AGX Orin 64GB14.4
A214.4
T417.3
A30423.7
L4115.7
L40140.9
A100850.4
H100889.5

How to use this model

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.

The model is intended for primarily deploying and doing inference using DeepStream.

Primary use case intended for the model is segmenting urban city classes in a color (RGB) image. The model can be used to segment urban city transport/ setting from photos and videos by using appropriate video or image decoding and pre-processing. Note this model performs semantic segmentation and not instance based segmentation.

Instructions to deploy these models with DeepStream

To create the entire end-to-end video analytics application, deploy these models with DeepStream SDK. DeepStream SDK is a streaming analytics toolkit to accelerate building AI-based video analytics 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:

Download and install DeepStream SDK. The installation instructions for DeepStream are provided in DeepStream development guide. The config files for the purpose-built models are located in:

/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 1 config files and 1 label file. These files are provided in [NVIDIA-AI-IOT](@todo : update).

nvinfer_config.txt - File to configure inference settings for CitySemSegformer
labels.txt - Label file with 19 classes

You can input the onnx model directly to Deepstream. In order to manually convert to TRT engine, follow the example command below:

Key Parameters in nvinfer_config.txt for Deepstream Inference.

# You can either provide the etlt model and key or trt engine obtained by using tao-converter
tlt-model-key=tlt_encode
# tlt-encoded-model=../../path/to/.etlt file
model-engine-file=../../path/to/trt_engine
net-scale-factor=0.01735207357279195
offsets=123.675;116.28;103.53
# Since the model input channel is 3, using RGB color format.
model-color-format=0
labelfile-path=./labels.txt
infer-dims=3;1024;1024
batch-size=1
## 0=FP32, 1=INT8, 2=FP16 mode
network-mode=2
interval=0
gie-unique-id=1
cluster-mode=2
## 0=Detector, 1=Classifier, 2=Semantic Segmentation, 3=Instance Segmentation, 100=Other
network-type=100
output-tensor-meta=1
num-detected-classes=20
segmentation-output-order=1
roi-top-offset=0
roi-bottom-offset=0
detected-min-w=0
detected-min-h=0
detected-max-w=0
detected-max-h=0

Run ds-tao-segmentation:

CitySemSegformer

ds-tao-segmentation -c configs/segformer_tao/nvinfer_config.txt -i file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.mp4

Documentation to deploy with DeepStream is provided in "Deploying to DeepStream" chapter of TAO User Guide.

Technical blogs

Suggested reading

Ethical Considerations:

Training and evaluation dataset is sourced from North America. More inclusive training and evaluation dataset would include content from other parts of the world.

NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their sinternal model team to ensure this model meets requirements for the relevant industry and use case and addresses unforeseen product misuse. For more detailed information on ethical considerations for this model, please see the Model Card++ Promise and the Explainability, Bias, Safety & Security, and Privacy Subcards.

Publisher
NVIDIA
NVIDIA
Latest Versiondeployable_onnx_v1.0
UpdatedNovember 27, 2024 UTC
Compressed Size331.08 MB