Class MaskRCNN<T>
- Assembly
- AiDotNet.dll
Mask R-CNN for instance segmentation.
public class MaskRCNN<T> : InstanceSegmenterBase<T>
Type Parameters
TThe 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
optionsInstanceSegmentationOptions<T>
Properties
Name
Name of this segmentation model.
public override string Name { get; }
Property Value
Methods
GetParameterCount()
Gets the total parameter count.
public override long GetParameterCount()
Returns
LoadWeightsAsync(string, CancellationToken)
Loads pretrained weights.
public override Task LoadWeightsAsync(string pathOrUrl, CancellationToken cancellationToken = default)
Parameters
pathOrUrlstringcancellationTokenCancellationToken
Returns
SaveWeights(string)
Saves model weights.
public override void SaveWeights(string path)
Parameters
pathstring
Segment(Tensor<T>)
Performs instance segmentation on an image.
public override InstanceSegmentationResult<T> Segment(Tensor<T> image)
Parameters
imageTensor<T>Input image tensor [batch, channels, height, width].
Returns
- InstanceSegmentationResult<T>
Instance segmentation result with masks.