Class RoiAlign
Represents an RoiAlign
region of interest alignment layer. This calculates an output tensor by pooling the input tensor across each region of interest given by the rois
tensor.
Inherited Members
Namespace: Unity.Sentis.Layers
Syntax
[Serializable]
public class RoiAlign : Layer
Constructors
RoiAlign(String, String, String, String, RoiPoolingMode, Int32, Int32, Int32, Single)
Initializes and returns an instance of RoiAlign
region of interest alignment layer.
Declaration
public RoiAlign(string name, string input, string rois, string batchIndices, RoiPoolingMode mode, int outputHeight, int outputWidth, int samplingRatio, float spatialScale)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name to use for the output tensor of the layer. |
String | input | The name to use for the input tensor of the layer. |
String | rois | The name to use for the region of interest tensor of the layer. |
String | batchIndices | The name to use for the 1D input tensor where each element denotes the index of the image in the batch for a given region of interest. |
RoiPoolingMode | mode | The pooling mode of the operation as an |
Int32 | outputHeight | The height of the output tensor. |
Int32 | outputWidth | The width of the output tensor. |
Int32 | samplingRatio | The number of sampling points in the interpolation grid used to compute the output value of each pooled output bin. |
Single | spatialScale | The multiplicative spatial scale factor used to translate coordinates from their input spatial scale to the scale used when pooling. |
Fields
mode
The pooling mode of the operation as an RoiPoolingMode
.
Declaration
public RoiPoolingMode mode
Field Value
Type | Description |
---|---|
RoiPoolingMode |
outputHeight
The height of the output tensor.
Declaration
public int outputHeight
Field Value
Type | Description |
---|---|
Int32 |
outputWidth
The width of the output tensor.
Declaration
public int outputWidth
Field Value
Type | Description |
---|---|
Int32 |
samplingRatio
The number of sampling points in the interpolation grid used to compute the output value of each pooled output bin.
Declaration
public int samplingRatio
Field Value
Type | Description |
---|---|
Int32 |
spatialScale
The multiplicative spatial scale factor used to translate coordinates from their input spatial scale to the scale used when pooling.
Declaration
public float spatialScale
Field Value
Type | Description |
---|---|
Single |
Methods
Execute(Tensor[], ExecutionContext)
Executes the layer using the operations and variables from the ExecutionContext
and returns the output tensor.
If the layer has more than one output, output tensors are saved to variables.
Declaration
public override Tensor Execute(Tensor[] inputTensors, ExecutionContext ctx)
Parameters
Type | Name | Description |
---|---|---|
Tensor[] | inputTensors | |
ExecutionContext | ctx |
Returns
Type | Description |
---|---|
Tensor |
Overrides
ToString()
Returns a string that represents the Layer
.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |