STDC-Seg segments street scenes in real time

STDC-Seg is a real-time semantic segmentation network built on a Short-Term Dense Concatenate (STDC) backbone, from the CVPR 2021 paper "Rethinking BiSeNet for Real-time Semantic Segmentation". In Supervisely you serve its Cityscapes checkpoints, or an STDC-Seg checkpoint trained elsewhere, to label every pixel of road scenes on a GPU or a CPU.

Poster of the Serve STDC-Seg app: a lightweight semantic segmentation model for real-time inference
Labels
  • Bitmap masks, one per class
Apps
Serve
Source
Paper, GitHub

Apps in the Supervisely Ecosystem

Every model in Supervisely comes as a Supervisely App: a module from the Ecosystem that plugs into the platform and runs on your own GPU, with no code to install. A Serve App puts the model behind the labeling tools, and where the model can be trained, a Train App fits it to your labeled project. All Apps work on the same projects, so you add a model, update it or swap it for another without changing anything else.

One stream instead of two

STDC-Seg comes from "Rethinking BiSeNet for Real-time Semantic Segmentation" by Mingyuan Fan and co-authors, CVPR 2021 (code). BiSeNet, a popular real-time design, adds a second path to keep spatial detail, which costs time, and borrows its backbone from image classification. STDC-Seg drops both.

  • The STDC backbone reduces the size of its feature maps step by step and concatenates them, a module designed for dense prediction rather than classification.
  • A Detail Aggregation module teaches the low-level layers spatial detail in the same single stream, without slowing inference.
  • The decoder fuses those low-level features with the deep ones to predict the class of every pixel.

The paper reports 71.9% mIoU on the Cityscapes test set at 250.4 FPS on an NVIDIA GTX 1080Ti, and 76.8% mIoU at 97.0 FPS on larger inputs.

Four Cityscapes checkpoints

STDC1 and STDC2 are the two backbones (STDCNet813 and STDCNet1446); Seg50 and Seg75 are the two input sizes. All four checkpoints are trained on Cityscapes and output its 19 classes, from road and sidewalk to car, person and bicycle.

ModelBackboneInput (W × H)Cityscapes val mIoUFPS
STDC1-Seg50STDCNet8131024 × 51272.22250.4
STDC1-Seg75STDCNet8131536 × 76874.50126.7
STDC2-Seg50STDCNet14461024 × 51274.24188.6
STDC2-Seg75STDCNet14461536 × 76877.0497.0

Figures from the official repository: mean IoU on the Cityscapes validation set, and speed measured by the authors on an NVIDIA GTX 1080Ti. Seg75 sees finer detail; Seg50 is about twice as fast.

Serving pretrained and external checkpoints

Serve STDC-Seg runs in PyTorch on a GPU or a CPU. Pick a pretrained model, select the device and press Serve; the app then shows the backbone, the input size, the inference settings and the output classes. From there, Apply NN to Images Project labels a whole project, Apply NN to Videos Project labels videos, and NN Image Labeling adds the masks to the open image.

The External Models tab serves an STDC-Seg checkpoint trained outside Supervisely. Put two files in Team Files: the .pth checkpoint and a YAML model configuration. The app tells STDCNet813 from STDCNet1446 by the checkpoint itself and reads the rest from the YAML:

  • NET_INP_WIDTH and NET_INP_HEIGHT: the inference image size.
  • SEG_CATEGORIES: class names mapped to contiguous indices from 0, as many as the checkpoint has output channels.
  • SEG_COLORS: optional class colors; without them the app makes a palette.

STDC-Seg or another semantic segmentation model?

STDC-Seg is serve-only: there is no training app, checkpoints trained in Supervisely are not supported, and ONNX and TensorRT runtimes are not available in the app. It fits when you need fast masks of the Cityscapes classes without training, or already have an STDC-Seg model trained on your own data.

Frequently asked questions.

Can I train STDC-Seg in Supervisely?

No. Serve STDC-Seg deploys the four Cityscapes checkpoints or an STDC-Seg checkpoint trained outside Supervisely, loaded with a YAML file of its classes. To train semantic segmentation on the platform, use MMSegmentation or UNet.

What do STDC1, STDC2, Seg50 and Seg75 mean?

STDC1 and STDC2 are the smaller and the larger backbone, STDCNet813 and STDCNet1446. Seg50 runs on 1024 × 512 inputs and Seg75 on 1536 × 768. The larger backbone and input are more accurate and slower.

Does Serve STDC-Seg run on a CPU?

Yes. The app runs on a GPU or a CPU, in PyTorch.

Train and serve models on your own data.

Label a project in a free account, train a model on it from the browser and deploy it on your own GPU. Or book a demo to run Supervisely on your servers.