ROIPooling

Input

  • x:
    • Required: yes
    • Type: float16, float32
    • Description: input feature map, with shape [batch, C, H, W]
    • Restriction: h/w varies according to pooled_h/pooled_w.
      1. pooled_h = pooled_w: 2, 17, h and w <= 50
      2. pooled_h = pooled_w: 4, 5, 10-16, h and w <= 70
      3. pooled_h = pooled_w: 7, 8, h and w <= 80
      4. pooled_h = pooled_w: 3, h and w <= 60
      5. pooled_h = pooled_w: 18-20, h and w <= 40
  • rois:
    • Required: yes
    • Type: float16, float32
    • Description: Has shape [batch, 5, N]. The number of input ROIs. N indicates the maximum number of ROIs across batches, which will be rounded up to the nearest multiple of 16.

      For example, if the maximum number of ROIs across batches is 17, the value of N (N ≤ 6000) is rounded up to 32. N<=6000

    • Restriction:
      • Default: float16
      • Constraints:
        • Before setting, clear the memory block first.
        • ROIPooling crops the input ROIs to the width and height range of the feature map to avoid calculation inconsistency with the CPU result.
  • roi_actual_num:
    • Required: no
    • Type: int
    • Description: actual number of ROIs per batch. Has shape [batch, 8]. The value 8 indicates that only the first column in the eight columns is valid (data padding is performed for performance acceleration, and the rest seven columns are invalid data that is padded).

      For example, for shape [4, 8], only the first column is valid, indicating the number of ROIs per batch.

      [0,0]...[0,7]

      [1,0]...[1,7]

      [2,0]...[2,7]

      [3,0]...[3,7]

    • Restriction:

      Default: int32

      If this parameter is not used, the N value of rois is used for inference. If this parameter is used, the actual number of ROIs set by using roi_actual_num is used for inference.

Attribute

  • pooled_h:
    • Required: yes
    • Type: int
    • Description: height of the ROI output feature map. Must be greater than 0.
    • Restriction: Must be in the range [2, 20].
  • pooled_w:
    • Required: yes
    • Type: int
    • Description: width of the ROI output feature map. Must be greater than 0.
    • Restriction: Must be in the range [2, 20].
  • spatial_scale:
    • Required: no
    • Type: float
    • Description: ratio of the input feature map over the input image size. spatial_scale_h and spatial_scale_w take higher precedence over this attribute. If spatial_scale_h and spatial_scale_w are not specified, spatial_scale is converted to spatial_scale_h and spatial_scale_w by the Caffe plugin.
    • Restrictions: none
  • spatial_scale_h:
    • Required: no
    • Type: float
    • Description: height ratio of the input feature map over the input image size (default = 0.0625)
    • Restrictions: none
  • spatial_scale_w:
    • Required: no
    • Type: float
    • Description: width ratio of the input feature map over the input image size (default = 0.0625)
    • Restrictions: none

Output

y:
  • Required: yes
  • Type: float16, float32
  • Description: output tensor of shape [batch * N, C, pooled_h, pooled_w], resulted from cropping input feature maps according to rois before max pooling.
  • Restrictions: none