class_docstr: RPNHead in the `Sparse R-CNN <https://arxiv.org/abs/2011.12450>`_ .
  
  Unlike traditional RPNHead, this module does not need FPN input, but just
  decode `init_proposal_bboxes` and expand the first dimension of
  `init_proposal_bboxes` and `init_proposal_features` to the batch_size.
  
  Args:
      num_proposals (int): Number of init_proposals. Defaults to 100.
      proposal_feature_channel (int): Channel number of
          init_proposal_feature. Defaults to 256.
      init_cfg (:obj:`ConfigDict` or dict or list[:obj:`ConfigDict` or             dict]): Initialization config dict. Defaults to None.
class_docstr_tok: ["RPNHead","in","the","`","Sparse","R-CNN","<","https",":","\/\/arxiv.org\/abs\/2011.12450",">","`","_",".","Unlike","traditional","RPNHead",",","this","module","does","not","need","FPN","input",",","but","just","decode","`","init_proposal_bboxes","`","and","expand","the","first","dimension","of","`","init_proposal_bboxes","`","and","`","init_proposal_features","`","to","the","batch_size",".","Args",":","num_proposals","(","int",")",":","Number","of","init_proposals",".","Defaults","to","100.","proposal_feature_channel","(","int",")",":","Channel","number","of","init_proposal_feature",".","Defaults","to","256.","init_cfg","(",":","obj",":","`","ConfigDict","`","or","dict","or","list","[",":","obj",":","`","ConfigDict","`","or","dict","]",")",":","Initialization","config","dict",".","Defaults","to","None","."]
docstr: Perform forward propagation of the head, then calculate loss and
  predictions from the features and data samples.
docstr_tok: ["Perform","forward","propagation","of","the","head",",","then","calculate","loss","and","predictions","from","the","features","and","data","samples","."]
code: def loss_and_predict(
      self, x: List[Tensor], batch_data_samples: SampleList, **kwargs
  ) -> tuple:
      """Perform forward propagation of the head, then calculate loss and
      predictions from the features and data samples."""
      # `**kwargs` is necessary to avoid some potential error.
      predictions = self._decode_init_proposals(
          x=x, batch_data_samples=batch_data_samples
      )
  
      return dict(), predictions
  
file_path: mmdetection/mmdet/models/dense_heads/embedding_rpn_head.py
imports: from typing import List
  import torch
  import torch.nn
  from mmengine.model import BaseModule
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.structures.bbox import bbox_cxcywh_to_xyxy
  from mmdet.structures.det_data_sample import SampleList
  from mmdet.utils import InstanceList, OptConfigType
label_desc: Use image node_id 7 for calling the EmbeddingRPNHead obj's underlying member method code with example usage: obj.loss_and_predict(x, batch_data_samples) and returns: dict,  predictions