class_docstr: Faster R-CNN Head for VGG-16 based implementation.
  
  This class is used as a head for Faster R-CNN.
  This outputs class-wise localizations and classification based on feature
  maps in the given RoIs.
  
  Args:
      n_class (int): The number of classes possibly including the background.
      roi_size (int): Height and width of the feature maps after RoI-pooling.
      spatial_scale (float): Scale of the roi is resized.
      vgg_initialW (callable): Initializer for the layers corresponding to
          the VGG-16 layers.
      loc_initialW (callable): Initializer for the localization head.
      score_initialW (callable): Initializer for the score head.
class_docstr_tok: ["Faster","R-CNN","Head","for","VGG-16","based","implementation",".","This","class","is","used","as","a","head","for","Faster","R-CNN",".","This","outputs","class-wise","localizations","and","classification","based","on","feature","maps","in","the","given","RoIs",".","Args",":","n_class","(","int",")",":","The","number","of","classes","possibly","including","the","background",".","roi_size","(","int",")",":","Height","and","width","of","the","feature","maps","after","RoI-pooling",".","spatial_scale","(","float",")",":","Scale","of","the","roi","is","resized",".","vgg_initialW","(","callable",")",":","Initializer","for","the","layers","corresponding","to","the","VGG-16","layers",".","loc_initialW","(","callable",")",":","Initializer","for","the","localization","head",".","score_initialW","(","callable",")",":","Initializer","for","the","score","head","."]
docstr: Forward the chain.
  
  We assume that there are :math:`N` batches.
  
  Args:
      x (~chainer.Variable): 4D image variable.
      rois (array): A bounding box array containing coordinates of
          proposal boxes.  This is a concatenation of bounding box
          arrays from multiple images in the batch.
          Its shape is :math:`(R', 4)`. Given :math:`R_i` proposed
          RoIs from the :math:`i` th image,
          :math:`R' = \sum _{i=1} ^ N R_i`.
      roi_indices (array): An array containing indices of images to
          which bounding boxes correspond to. Its shape is :math:`(R',)`.
docstr_tok: ["Forward","the","chain",".","We","assume","that","there","are",":","math",":","`","N","`","batches",".","Args",":","x","(","~chainer.Variable",")",":","4D","image","variable",".","rois","(","array",")",":","A","bounding","box","array","containing","coordinates","of","proposal","boxes",".","This","is","a","concatenation","of","bounding","box","arrays","from","multiple","images","in","the","batch",".","Its","shape","is",":","math",":","`","(","R","'",",","4",")","`",".","Given",":","math",":","`","R_i","`","proposed","RoIs","from","the",":","math",":","`","i","`","th","image",",",":","math",":","`","R","'","=","\\sum","_","{","i=1","}","^","N","R_i","`",".","roi_indices","(","array",")",":","An","array","containing","indices","of","images","to","which","bounding","boxes","correspond","to",".","Its","shape","is",":","math",":","`","(","R","'",",",")","`","."]
code: def forward(self, x, rois, roi_indices):
      """Forward the chain.
  
      We assume that there are :math:`N` batches.
  
      Args:
          x (~chainer.Variable): 4D image variable.
          rois (array): A bounding box array containing coordinates of
              proposal boxes.  This is a concatenation of bounding box
              arrays from multiple images in the batch.
              Its shape is :math:`(R', 4)`. Given :math:`R_i` proposed
              RoIs from the :math:`i` th image,
              :math:`R' = \\sum _{i=1} ^ N R_i`.
          roi_indices (array): An array containing indices of images to
              which bounding boxes correspond to. Its shape is :math:`(R',)`.
  
      """
      roi_indices = roi_indices.astype(np.float32)
      indices_and_rois = self.xp.concatenate(
          (roi_indices[:, None], rois), axis=1
      )
      pool = _roi_pooling_2d_yx(
          x,
          indices_and_rois,
          self.roi_size,
          self.roi_size,
          self.spatial_scale,
      )
  
      fc6 = F.relu(self.fc6(pool))
      fc7 = F.relu(self.fc7(fc6))
      roi_cls_locs = self.cls_loc(fc7)
      roi_scores = self.score(fc7)
      return roi_cls_locs, roi_scores
  
file_path: chainercv/chainercv/links/model/faster_rcnn/faster_rcnn_vgg.py
imports: import numpy
  import chainer
  import chainer.functions
  import chainer.links
  from chainercv.links.model.faster_rcnn.faster_rcnn import FasterRCNN
  from chainercv.links.model.faster_rcnn.region_proposal_network import RegionProposalNetwork
  from chainercv.links.model.vgg.vgg16 import VGG16
  from chainercv import utils
label_desc: Use image node_id 2 for calling the VGG16RoIHead obj's underlying member method code with example usage: obj.forward(x, rois, roi_indices) and returns: roi_cls_locs,  roi_scores