class_docstr: Extract RoI features from a single level feature map.
  
  If there are multiple input feature levels, each RoI is mapped to a level
  according to its scale. The mapping rule is proposed in
  `FPN <https://arxiv.org/abs/1612.03144>`_.
  
  Args:
      roi_layer (:obj:`ConfigDict` or dict): Specify RoI layer type and
          arguments.
      out_channels (int): Output channels of RoI layers.
      featmap_strides (List[int]): Strides of input feature maps.
      finest_scale (int): Scale threshold of mapping to level 0.
          Defaults to 56.
      init_cfg (:obj:`ConfigDict` or dict or list[:obj:`ConfigDict` or             dict], optional): Initialization config dict. Defaults to None.
class_docstr_tok: ["Extract","RoI","features","from","a","single","level","feature","map",".","If","there","are","multiple","input","feature","levels",",","each","RoI","is","mapped","to","a","level","according","to","its","scale",".","The","mapping","rule","is","proposed","in","`","FPN","<","https",":","\/\/arxiv.org\/abs\/1612.03144",">","`","_",".","Args",":","roi_layer","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","Specify","RoI","layer","type","and","arguments",".","out_channels","(","int",")",":","Output","channels","of","RoI","layers",".","featmap_strides","(","List","[","int","]",")",":","Strides","of","input","feature","maps",".","finest_scale","(","int",")",":","Scale","threshold","of","mapping","to","level","0",".","Defaults","to","56.","init_cfg","(",":","obj",":","`","ConfigDict","`","or","dict","or","list","[",":","obj",":","`","ConfigDict","`","or","dict","]",",","optional",")",":","Initialization","config","dict",".","Defaults","to","None","."]
code: def to_roi(self, beziers: Tensor) -> Tensor:
      rois_list = []
      for img_id, bezier in enumerate(beziers):
          img_inds = bezier.new_full((bezier.size(0), 1), img_id)
          rois = torch.cat([img_inds, bezier], dim=-1)
          rois_list.append(rois)
      rois = torch.cat(rois_list, 0)
      return rois
  
file_path: mmocr/projects/ABCNet/abcnet/model/bezier_roi_extractor.py
imports: from typing import List, Tuple
  import torch
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmocr.registry import MODELS
  from mmocr.utils import ConfigType, OptMultiConfig
  from .base_roi_extractor import BaseRoIExtractor
label_desc: Use image node_id 2 for calling the BezierRoIExtractor obj's underlying member method code with example usage: obj.to_roi(beziers) and returns: rois