code: def __init__(
      self,
      num_classes,
      assigner: Union[ConfigDict, nn.Module],
      deep_supervision=True,
      loss_cls=dict(
          type="FocalLoss",
          use_sigmoid=True,
          alpha=0.25,
          gamma=2.0,
          reduction="sum",
          loss_weight=2.0,
      ),
      loss_bbox=dict(type="L1Loss", reduction="sum", loss_weight=5.0),
      loss_giou=dict(type="GIoULoss", reduction="sum", loss_weight=2.0),
  ):
      super().__init__()
      self.num_classes = num_classes
  
      if isinstance(assigner, nn.Module):
          self.assigner = assigner
      else:
          self.assigner = TASK_UTILS.build(assigner)
  
      self.deep_supervision = deep_supervision
  
      self.loss_cls = MODELS.build(loss_cls)
      self.loss_bbox = MODELS.build(loss_bbox)
      self.loss_giou = MODELS.build(loss_giou)
  
imports: from typing import List, Tuple, Union
  import torch
  import torch.nn
  from mmengine.config import ConfigDict
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import MODELS, TASK_UTILS
  from mmdet.structures.bbox import bbox_cxcywh_to_xyxy, bbox_xyxy_to_cxcywh
  from mmdet.utils import ConfigType
label_desc: Use image node_id 1 to create a new DiffusionDetCriterion object from inherited base classes: nn with example: obj = DiffusionDetCriterion(num_classes, assigner, deep_supervision, loss_cls, loss_bbox, loss_giou)