MaskRCNN<T>
Models & Types · AiDotNet.ComputerVision.Segmentation.InstanceSegmentation
Mask R-CNN for instance segmentation.
Inheritance: ModelBase<T, Tensor<T>, Tensor<T>> → InstanceSegmenterBase<T> → MaskRCNN<T>
Implements: IGeneratedParameterRegistrar<T>
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.
How It Works
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
| Constructor | Summary |
|---|---|
MaskRCNN(InstanceSegmentationOptions<T> options) |
Creates a new Mask R-CNN model. |
Properties
| Property | Summary |
|---|---|
string Name { get; } |
Methods
| Method | Summary |
|---|---|
InstanceSegmentationResult<T> Segment(Tensor<T> image) |
|
Task LoadWeightsAsync(string pathOrUrl, CancellationToken cancellationToken) |
|
long GetParameterCount() |
|
void SaveWeights(string path) |
|
void TrainInstances(Tensor<T> input, IReadOnlyList<InstanceSegmentationTrainingTarget<T>> targets) |
Trains every branch with the Mask R-CNN multi-task loss L = L_cls + L_box + L_mask, plus the RPN’s proposal loss (He et al. |