class_docstr: This class defines a encoder-decoder architecture for the task of semantic segmentation. Different segmentation
  heads (e.g., PSPNet and DeepLabv3) can be used
  
  Args:
      opts: command-line arguments
      encoder (BaseImageEncoder): Backbone network (e.g., MobileViT or ResNet)
class_docstr_tok: ["This","class","defines","a","encoder-decoder","architecture","for","the","task","of","semantic","segmentation",".","Different","segmentation","heads","(","e.g.",",","PSPNet","and","DeepLabv3",")","can","be","used","Args",":","opts",":","command-line","arguments","encoder","(","BaseImageEncoder",")",":","Backbone","network","(","e.g.",",","MobileViT","or","ResNet",")"]
code: def __init__(
      self, opts, encoder: BaseImageEncoder, seg_head, *args, **kwargs
  ) -> None:
      super().__init__(opts=opts, encoder=encoder)
  
      # delete layers that are not required in segmentation network
      self.encoder.classifier = None
      use_l5_exp = getattr(opts, "model.segmentation.use_level5_exp")
      if not use_l5_exp:
          self.encoder.conv_1x1_exp = None
  
      self.maybe_seg_norm_layer()
      self.seg_head = seg_head
      self.use_l5_exp = use_l5_exp
      self.set_default_norm_layer()
  
file_path: ml-cvnets/cvnets/models/segmentation/enc_dec.py
imports: import argparse
  from typing import Dict, Optional, Tuple, Union
  from torch import Tensor
  from cvnets.models import MODEL_REGISTRY, BaseAnyNNModel, get_model
  from cvnets.models.classification.base_image_encoder import BaseImageEncoder
  from cvnets.models.segmentation.base_seg import BaseSegmentation, set_model_specific_opts_before_model_building, unset_model_specific_opts_after_model_building
label_desc: Use image node_id 1 to create a new SegEncoderDecoder object from inherited base classes: BaseSegmentation with example: obj = SegEncoderDecoder(opts, encoder, seg_head)