class_docstr: Head of DeformDETR: Deformable DETR: Deformable Transformers for
  End-to-End Object Detection.
  
  Code is modified from the `official github repo
  <https://github.com/fundamentalvision/Deformable-DETR>`_.
  
  More details can be found in the `paper
  <https://arxiv.org/abs/2010.04159>`_ .
  
  Args:
      share_pred_layer (bool): Whether to share parameters for all the
          prediction layers. Defaults to `False`.
      num_pred_layer (int): The number of the prediction layers.
          Defaults to 6.
      as_two_stage (bool, optional): Whether to generate the proposal
          from the outputs of encoder. Defaults to `False`.
code: def __init__(
      self,
      *args,
      share_pred_layer: bool = False,
      num_pred_layer: int = 6,
      as_two_stage: bool = False,
      **kwargs,
  ) -> None:
      self.share_pred_layer = share_pred_layer
      self.num_pred_layer = num_pred_layer
      self.as_two_stage = as_two_stage
  
      super().__init__(*args, **kwargs)
  
imports: import copy
  from typing import Dict, List, Tuple
  import torch
  import torch.nn
  from mmcv.cnn import Linear
  from mmengine.model import bias_init_with_prob, constant_init
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.structures import SampleList
  from mmdet.utils import InstanceList, OptInstanceList
  from ..layers import inverse_sigmoid
  from .detr_head import DETRHead
label_desc: Use image node_id 1 to create a new DeformableDETRHead object from inherited base classes: DETRHead with example: obj = DeformableDETRHead()