SegFormer

SegFormer

★ 3.8 🔖 1200 saves 💰 Free GitHub

SegFormer is NVIDIA’s official PyTorch implementation of the SegFormer semantic segmentation model, a simple and efficient transformer-based architecture that became a standard baseline in computer vision. SegFormer pairs a hierarchical transformer encoder — which produces multi-scale features without positional encodings — with a lightweight all-MLP decoder, achieving strong accuracy on benchmarks such as ADE20K and Cityscapes with far fewer parameters than earlier designs. The repository has around 3,700 stars on GitHub.

Overview

The repo provides the model code, training and evaluation scripts, and pretrained checkpoints for the SegFormer family (B0 through B5), built on the MMSegmentation ecosystem. The encoder, called Mix Transformer (MiT), outputs features at several resolutions like a CNN backbone, while the decoder fuses them using only MLP layers, keeping the design clean and fast. SegFormer is robust to the resolution differences between training and testing that trip up fixed positional-encoding transformers, which makes it practical for real segmentation pipelines. Configuration files for ADE20K, Cityscapes and other datasets are included so results from the paper can be reproduced directly.

Key Features

  • Official implementation of the NeurIPS 2021 SegFormer paper
  • Hierarchical transformer encoder with no positional encoding
  • Lightweight all-MLP decoder for multi-scale feature fusion
  • Pretrained B0–B5 checkpoints for ADE20K and Cityscapes
  • Training and evaluation configs built on MMSegmentation
  • Strong accuracy-to-parameter ratio for semantic segmentation
  • Widely used as a backbone in downstream vision research

💳 Pricing

SegFormer is free and open source for research use from NVIDIA’s NVlabs GitHub organisation. The only cost is the GPU compute for training and inference.

Who Is It For

Computer-vision researchers and engineers who need a proven semantic segmentation model for tasks such as scene understanding, autonomous driving perception or medical imaging, and anyone benchmarking modern segmentation architectures.

🚀 Visit SegFormer Official Site

🚩 Report an issue