class_docstr: `PointRend <https://arxiv.org/abs/1912.08193>`_.
class_docstr_tok: ["`","PointRend","<","https",":","\/\/arxiv.org\/abs\/1912.08193",">","`","_","."]
docstr: Sample fine grained feats from each level feature map and
  concatenate them together.
docstr_tok: ["Sample","fine","grained","feats","from","each","level","feature","map","and","concatenate","them","together","."]
code: def _get_fine_grained_point_feats(
      self, x, rois, rel_roi_points, img_metas
  ):
      """Sample fine grained feats from each level feature map and
      concatenate them together."""
      num_imgs = len(img_metas)
      fine_grained_feats = []
      for idx in range(self.mask_roi_extractor.num_inputs):
          feats = x[idx]
          spatial_scale = 1.0 / float(
              self.mask_roi_extractor.featmap_strides[idx]
          )
          point_feats = []
          for batch_ind in range(num_imgs):
              # unravel batch dim
              feat = feats[batch_ind].unsqueeze(0)
              inds = rois[:, 0].long() == batch_ind
              if inds.any():
                  rel_img_points = rel_roi_point_to_rel_img_point(
                      rois[inds],
                      rel_roi_points[inds],
                      feat.shape[2:],
                      spatial_scale,
                  ).unsqueeze(0)
                  point_feat = point_sample(feat, rel_img_points)
                  point_feat = point_feat.squeeze(0).transpose(0, 1)
                  point_feats.append(point_feat)
          fine_grained_feats.append(torch.cat(point_feats, dim=0))
      return torch.cat(fine_grained_feats, dim=1)
  
file_path: insightface/detection/scrfd/mmdet/models/roi_heads/point_rend_roi_head.py
imports: import torch
  import torch.nn.functional
  from mmcv.ops import point_sample, rel_roi_point_to_rel_img_point
  from mmdet.core import bbox2roi, bbox_mapping, merge_aug_masks
  from ..None import builder
  from ..builder import HEADS
  from .standard_roi_head import StandardRoIHead
label_desc: Use image node_id 6 for calling the PointRendRoIHead obj's underlying member method code with example usage: obj._get_fine_grained_point_feats(x, rois, rel_roi_points, img_metas) and returns: torch