class nbla::RoiAlign

template<typename T>
class RoiAlign : public nbla::BaseFunction<const vector<int>&, const vector<float>&, int, bool>

Map Regions of Interest (RoI) defined by bounding `boxes` to features of `output_size` height and width using bilinear interpolation with `sampling_ratio` points in the interpolation grid.

Inputs:

  • Input array with shape \((N, H, W, C)\) or \((N, C, H, W)\).

  • Boxes array with shape \((K, 5)\) containing box coordinates in (b, x1, y1, x2, y2) format where b is the batch index.

Outputs:

  • N-D array with shape \((K, C, output\_size[0], output\_size[1])\) or \((K, output\_size[0], output\_size[1], C)\).

See also

Reference:

Template Parameters:

T – Data type for computation.

Param output_size:

The height and width of the output feature maps.

Param spatial_scale:

Scaling factor from box to input coordinates, as (x, y).

Param sampling_ratio:

The number of sampling points used for interpolation.

Param channel_last:

Whethe last dimension is considered as channel dimension.

Public Functions

inline virtual shared_ptr<Function> copy() const

Copy another instance of Function with the same context.

inline virtual int min_inputs()

Get minimum number of inputs.

This is meant to be used in setup function with in_types which is used to get maximum number of inputs.

inline virtual int min_outputs()

Get minimum number of outputs.

This is meant to be used in setup function with out_types which is used to get max number of outputs.

inline virtual vector<dtypes> in_types()

Get input dtypes.

Last in_type will be used repeatedly if size of in_types is smaller than size of inputs

inline virtual vector<dtypes> out_types()

Get output dtypes.

Last out_type will be used repeatedly if size of out_types is smaller than size of outputs

inline virtual vector<string> allowed_array_classes()

Get array classes that are allowed to be specified by Context.

inline virtual string name()

Get function name in string.