docstr: Initialize CSE loss from configuration options
  
  Args:
      cfg (CfgNode): configuration options
docstr_tok: ["Initialize","CSE","loss","from","configuration","options","Args",":","cfg","(","CfgNode",")",":","configuration","options"]
code: def __init__(self, cfg: CfgNode):
      """
      Initialize CSE loss from configuration options
  
      Args:
          cfg (CfgNode): configuration options
      """
      self.w_segm = cfg.MODEL.ROI_DENSEPOSE_HEAD.INDEX_WEIGHTS
      self.w_embed = cfg.MODEL.ROI_DENSEPOSE_HEAD.CSE.EMBED_LOSS_WEIGHT
      self.segm_loss = MaskOrSegmentationLoss(cfg)
      self.embed_loss = DensePoseCseLoss.create_embed_loss(cfg)
      self.do_shape2shape = (
          cfg.MODEL.ROI_DENSEPOSE_HEAD.CSE.SHAPE_TO_SHAPE_CYCLE_LOSS.ENABLED
      )
      if self.do_shape2shape:
          self.w_shape2shape = (
              cfg.MODEL.ROI_DENSEPOSE_HEAD.CSE.SHAPE_TO_SHAPE_CYCLE_LOSS.WEIGHT
          )
          self.shape2shape_loss = ShapeToShapeCycleLoss(cfg)
      self.do_pix2shape = (
          cfg.MODEL.ROI_DENSEPOSE_HEAD.CSE.PIX_TO_SHAPE_CYCLE_LOSS.ENABLED
      )
      if self.do_pix2shape:
          self.w_pix2shape = (
              cfg.MODEL.ROI_DENSEPOSE_HEAD.CSE.PIX_TO_SHAPE_CYCLE_LOSS.WEIGHT
          )
          self.pix2shape_loss = PixToShapeCycleLoss(cfg)
  
file_path: detectron2/projects/DensePose/densepose/modeling/losses/cse.py
imports: from typing import Any, List
  from torch import nn
  from detectron2.config import CfgNode
  from detectron2.structures import Instances
  from .cycle_pix2shape import PixToShapeCycleLoss
  from .cycle_shape2shape import ShapeToShapeCycleLoss
  from .embed import EmbeddingLoss
  from .embed_utils import CseAnnotationsAccumulator
  from .mask_or_segm import MaskOrSegmentationLoss
  from .registry import DENSEPOSE_LOSS_REGISTRY
  from .soft_embed import SoftEmbeddingLoss
  from .utils import BilinearInterpolationHelper, LossDict, extract_packed_annotations_from_matches
label_desc: Use image node_id 1 to create a new DensePoseCseLoss object  with example: obj = DensePoseCseLoss(cfg)