For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo function
roi_align_nhwc
def roi_align_nhwc[dtype: DType, //, aligned: Bool, mode: StaticString = "AVG"](output: TileTensor[dtype, Engine=output.Engine, address_space=output.address_space, linear_idx_type=output.linear_idx_type], input: TileTensor[dtype, Engine=input.Engine, address_space=input.address_space, linear_idx_type=input.linear_idx_type], rois: TileTensor[dtype, Engine=rois.Engine, address_space=rois.address_space, linear_idx_type=rois.linear_idx_type], output_height: Int, output_width: Int, in_spatial_scale: Scalar, in_sampling_ratio: Scalar)
Compute ROIAlign a batch of rois of shape [M, 5] where the first dim is the batch index, followed by region box coordinates (x0, y0) (x1, y1). For inputs of NHWC format. The output shape is [M, output_height, output_width, C].
Parameters:
- dtype (
DType): Type of the input tensor. - aligned (
Bool): If not true offset the ROIs by 0.5. - mode (
StaticString): The pooling mode "AVG" for average and "MAX" for max pooling.
Args:
- output (
TileTensor[dtype, Engine=output.Engine, address_space=output.address_space, linear_idx_type=output.linear_idx_type]): Pre-allocated output tensor. - input (
TileTensor[dtype, Engine=input.Engine, address_space=input.address_space, linear_idx_type=input.linear_idx_type]): Batched images to the roi_align with NHWC format. - rois (
TileTensor[dtype, Engine=rois.Engine, address_space=rois.address_space, linear_idx_type=rois.linear_idx_type]): Batched ROIs box coordinates. - output_height (
Int): Pooled output height. - output_width (
Int): Pooled output width. - in_spatial_scale (
Scalar): Scale factor to remap the roi_align coordinates to the input coordinates. - in_sampling_ratio (
Scalar): Number of sampling points in the interpolation grid used to compute the output value of each pooled bin.