Table of Contents

Class MaskRCNN<T>

Mask R-CNN for instance segmentation.

public class MaskRCNN<T> : InstanceSegmenterBase<T>

Type Parameters

T

The numeric type used for calculations.

Inheritance
MaskRCNN<T>
Inherited Members

Remarks

For Beginners: Mask R-CNN extends Faster R-CNN by adding a mask prediction branch parallel to the box classification and regression branches. It's a two-stage detector that first proposes regions, then classifies them and predicts masks.

Key features: - Two-stage detection with RPN and RoI heads - Parallel mask prediction branch - RoIAlign for precise spatial alignment - Decoupled mask and class prediction

Reference: He et al., "Mask R-CNN", ICCV 2017

Constructors

MaskRCNN(InstanceSegmentationOptions<T>)

Creates a new Mask R-CNN model.

public MaskRCNN(InstanceSegmentationOptions<T> options)

Parameters

options InstanceSegmentationOptions<T>

Properties

Name

Name of this segmentation model.

public override string Name { get; }

Property Value

string

Methods

GetParameterCount()

Gets the total parameter count.

public override long GetParameterCount()

Returns

long

LoadWeightsAsync(string, CancellationToken)

Loads pretrained weights.

public override Task LoadWeightsAsync(string pathOrUrl, CancellationToken cancellationToken = default)

Parameters

pathOrUrl string
cancellationToken CancellationToken

Returns

Task

SaveWeights(string)

Saves model weights.

public override void SaveWeights(string path)

Parameters

path string

Segment(Tensor<T>)

Performs instance segmentation on an image.

public override InstanceSegmentationResult<T> Segment(Tensor<T> image)

Parameters

image Tensor<T>

Input image tensor [batch, channels, height, width].

Returns

InstanceSegmentationResult<T>

Instance segmentation result with masks.