class_docstr: Implementation of `DINO: DETR with Improved DeNoising Anchor Boxes
  for End-to-End Object Detection <https://arxiv.org/abs/2203.03605>`_
  
  Code is modified from the `official github repo
  <https://github.com/IDEA-Research/DINO>`_.
  
  Args:
      dn_cfg (:obj:`ConfigDict` or dict, optional): Config of denoising
          query generator. Defaults to `None`.
class_docstr_tok: ["Implementation","of","`","DINO",":","DETR","with","Improved","DeNoising","Anchor","Boxes","for","End-to-End","Object","Detection","<","https",":","\/\/arxiv.org\/abs\/2203.03605",">","`","_","Code","is","modified","from","the","`","official","github","repo","<","https",":","\/\/github.com\/IDEA-Research\/DINO",">","`","_",".","Args",":","dn_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",",","optional",")",":","Config","of","denoising","query","generator",".","Defaults","to","`","None","`","."]
code: def __init__(
      self, *args, dn_cfg: OptConfigType = None, **kwargs
  ) -> None:
      super().__init__(*args, **kwargs)
      assert self.as_two_stage, "as_two_stage must be True for DINO"
      assert (
          self.with_box_refine
      ), "with_box_refine must be True for DINO"
  
      if dn_cfg is not None:
          assert (
              "num_classes" not in dn_cfg
              and "num_queries" not in dn_cfg
              and "hidden_dim" not in dn_cfg
          ), (
              "The three keyword args `num_classes`, `embed_dims`, and "
              "`num_matching_queries` are set in `detector.__init__()`, "
              "users should not set them in `dn_cfg` config."
          )
          dn_cfg["num_classes"] = self.bbox_head.num_classes
          dn_cfg["embed_dims"] = self.embed_dims
          dn_cfg["num_matching_queries"] = self.num_queries
      self.dn_query_generator = CdnQueryGenerator(**dn_cfg)
  
file_path: mmdetection/mmdet/models/detectors/dino.py
imports: from typing import Dict, Optional, Tuple
  import torch
  from torch import Tensor, nn
  from torch.nn.init import normal_
  from mmdet.registry import MODELS
  from mmdet.structures import OptSampleList
  from mmdet.utils import OptConfigType
  from ..layers import CdnQueryGenerator, DeformableDetrTransformerEncoder, DinoTransformerDecoder, SinePositionalEncoding
  from .deformable_detr import DeformableDETR, MultiScaleDeformableAttention
label_desc: Use image node_id 1 to create a new DINO object from inherited base classes: DeformableDETR with example: obj = DINO()