NVIDIA
NVIDIA
Mask2Former
Model
NVIDIA
NVIDIA
Mask2Former

Binary instance segmentation model trained on COCO data.

TAO Pretrained Mask2former

Model Overview

Description

Masked-attention Mask Transformer or Mask2Former is a segmentation architecture capable of addressing panoptic, instance or semantic image segmentation tasks. The masked attention is essential in efficiently extracting localized features by constraining cross-attention within predicted mask regions.

This model is ready for non-commercial use.

Reference

  • B. Cheng, I. Misra, A.G. Schwing, A. Kirillov, R. Girdhar: Masked-attention Mask Transformer for Universal Image Segmentation

License

License to use these models is covered by the NVIDIA Open Model License. By downloading the model, you accept the terms and conditions of these licenses.

Model Architecture

Architecture Type: The model in this instance is an instance segmentor that takes color (RGB) images as inputs and generates segmentation masks and associated labels as outputs. Network Architecture: The backbone feature extractor of this model is Swin-T model pretrained on ImageNet dataset.

Input

  • Input Type: Image
  • Input Formats: Red, Green, Blue (RGB)
  • Other Properties Related to Input:** Minimum 32 x 32 Resolution required; no alpha channel or bits

Output

  • Output Type: Label, Mask and Score for each detected object in the input image.
  • Output Format: Label and Score: One-Dimensional (1D), Mask: Two Dimensional (2D)
  • Other Properties Related to Output**
    • pred_classes: Batch size x Number of queries
    • pred_masks: Batch size x Number of queries x Height x Width
    • pred_scores: Batch size x Number of queries

How to Use This Model

This model needs to be used with NVIDIA Hardware and Software. For Hardware, the model can run on any NVIDIA GPU with sufficient memory (>12G). This model can only be used with TAO Toolkit.

The primary use case for these models is instance segmentation.

It is intended for training and fine-tune using Train Adapt Optimize (TAO) Toolkit and the users' dataset of object detection. High fidelity models can be trained to new use cases. A Jupyter notebook is available as a part of TAO container and can be used to re-train.

Instructions to Use Pretrained Models with TAO

To use these models as pretrained weights for transfer learning, use the following snippet as a template for the model and train components of the experiment spec file to train a Mask2former model. For more information on the experiment spec file, see the TAO Toolkit User Guide.

model:
  mode: "instance"
  backbone:
    type: "swin"
    swin:
      type: "tiny"
      window_size: 7
      ape: False
      pretrain_img_size: 224
  mask_former:
    num_object_queries: 100
  sem_seg_head:
    norm: "GN"
    num_classes: 1

Software Integration

Runtime Engine:

  • TAO 5.5.0

Supported Hardware Microarchitecture Compatibility:

  • NVIDIA Ampere
  • NVIDIA Blackwell
  • NVIDIA Hopper
  • NVIDIA Lovelace
  • NVIDIA Pascal
  • NVIDIA Turing
  • NVIDIA Volta

[Preferred/Supported] Operating System(s):

  • Linux

Model Versions

  • mask2former_swint_trainable_v1.0 - Pre-trained Mask2former model for finetuning or inference.
  • mask2former_swint_deployable_v1.0 - Pre-trained Mask2former model deployable to deepstream.

Training and Evaluation Datasets

Training Datasets

Link: https://cocodataset.org/

Data Collection Method by dataset: Unknown

Labeling Method by dataset: Human

Properties: The COCO dataset contains 118K training images and corresponding annotation files. The annotation includes bounding boxes and segmentation masks of the 80 thing categories. The categories were mapped to a single category or "object" to train the binary instance segmentation model.

Evaluation Datasets

Link: https://cocodataset.org/

Data Collection Method by dataset: Unknown

Labeling Method by dataset: Human

Properties: The COCO dataset contains 5K validation images and corresponding annotation files. The annotation includes bounding boxes and segmentation masks of the 80 thing categories. The categories were mapped to a single category or "object" to train the binary instance segmentation model.

Performance

Evaluation Data

We test the Mask2former model on the modified COCO 2017 validation dataset.

Methodology and KPI

The KPI for the evaluation data are reported below.

modelPrecisionmIoU
Mask2formerFP160.96

Inference

Engine: Tensor(RT)
Test Hardware:

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

The inference is run on the provided unpruned model at FP16 precision. The inference performance is run using trtexec on Jetson AGX Xavier, Xavier NX, Orin, Orin NX and NVIDIA T4, and Ampere GPUs. 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 vary depending on other bottlenecks in the hardware and software.

PlatformBSFPS
AGX Orin 64GB817.53
Jetson Orin 16GB87.19
Jetson Nano 8GB82.13
T41623.54
A301673.94
A21614.43
L41635.27
L4016104.42
RTX409016122.55
A10016147.11
H10016251.99

Using TAO Pre-trained Models

Technical Blogs

Suggested Reading

Ethical Considerations

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 supporting 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. Please report security vulnerabilities or NVIDIA AI Concerns here.

Publisher
NVIDIA
NVIDIA
Latest Versionmask2former_swint_trainable_v1.0
UpdatedNovember 12, 2024 UTC
Compressed Size543.33 MB