class_docstr: Implementation of `DAB-DETR:
  Dynamic Anchor Boxes are Better Queries for DETR.
  
  <https://arxiv.org/abs/2201.12329>`_.
  
  Code is modified from the `official github repo
  <https://github.com/IDEA-Research/DAB-DETR>`_.
  
  Args:
      with_random_refpoints (bool): Whether to randomly initialize query
          embeddings and not update them during training.
          Defaults to False.
      num_patterns (int): Inspired by Anchor-DETR. Defaults to 0.
class_docstr_tok: ["Implementation","of","`","DAB-DETR",":","Dynamic","Anchor","Boxes","are","Better","Queries","for","DETR",".","<","https",":","\/\/arxiv.org\/abs\/2201.12329",">","`","_",".","Code","is","modified","from","the","`","official","github","repo","<","https",":","\/\/github.com\/IDEA-Research\/DAB-DETR",">","`","_",".","Args",":","with_random_refpoints","(","bool",")",":","Whether","to","randomly","initialize","query","embeddings","and","not","update","them","during","training",".","Defaults","to","False",".","num_patterns","(","int",")",":","Inspired","by","Anchor-DETR",".","Defaults","to","0","."]
code: def __init__(
      self,
      *args,
      with_random_refpoints: bool = False,
      num_patterns: int = 0,
      **kwargs,
  ) -> None:
      self.with_random_refpoints = with_random_refpoints
      assert isinstance(
          num_patterns, int
      ), f"num_patterns should be int but {num_patterns}."
      self.num_patterns = num_patterns
  
      super().__init__(*args, **kwargs)
  
file_path: mmdetection/mmdet/models/detectors/dab_detr.py
imports: from typing import Dict, Tuple
  from mmengine.model import uniform_init
  from torch import Tensor, nn
  from mmdet.registry import MODELS
  from ..layers import SinePositionalEncoding
  from ..layers.transformer import DABDetrTransformerDecoder, DABDetrTransformerEncoder, inverse_sigmoid
  from .detr import DETR
label_desc: Use image node_id 1 to create a new DABDETR object from inherited base classes: DETR with example: obj = DABDETR()