class_docstr: Main class for semantic segmentation architectures.
class_docstr_tok: ["Main","class","for","semantic","segmentation","architectures","."]
docstr: Args:
      backbone: a backbone module, must follow detectron2's backbone interface
      sem_seg_head: a module that predicts semantic segmentation from backbone features
      pixel_mean, pixel_std: list or tuple with #channels element, representing
          the per-channel mean and std to be used to normalize the input image
docstr_tok: ["Args",":","backbone",":","a","backbone","module",",","must","follow","detectron2","'s","backbone","interface","sem_seg_head",":","a","module","that","predicts","semantic","segmentation","from","backbone","features","pixel_mean",",","pixel_std",":","list","or","tuple","with","#","channels","element",",","representing","the","per-channel","mean","and","std","to","be","used","to","normalize","the","input","image"]
code: def __init__(
      self,
      *,
      backbone: Backbone,
      sem_seg_head: nn.Module,
      pixel_mean: Tuple[float],
      pixel_std: Tuple[float],
  ):
      """
      Args:
          backbone: a backbone module, must follow detectron2's backbone interface
          sem_seg_head: a module that predicts semantic segmentation from backbone features
          pixel_mean, pixel_std: list or tuple with #channels element, representing
              the per-channel mean and std to be used to normalize the input image
      """
      super().__init__()
      self.backbone = backbone
      self.sem_seg_head = sem_seg_head
      self.register_buffer(
          "pixel_mean", torch.tensor(pixel_mean).view(-1, 1, 1), False
      )
      self.register_buffer(
          "pixel_std", torch.tensor(pixel_std).view(-1, 1, 1), False
      )
  
imports: import numpy
  from typing import Callable, Dict, Optional, Tuple, Union
  import fvcore.nn.weight_init
  import torch
  from torch import nn
  from torch.nn import functional
  from detectron2.config import configurable
  from detectron2.layers import Conv2d, ShapeSpec, get_norm
  from detectron2.structures import ImageList
  from detectron2.utils.registry import Registry
  from ..backbone import Backbone, build_backbone
  from ..postprocessing import sem_seg_postprocess
  from .build import META_ARCH_REGISTRY
label_desc: Use image node_id 1 to create a new SemanticSegmentor object from inherited base classes: nn with example: obj = SemanticSegmentor()