InstanceSegmenterBase<T>
Base Classes ยท AiDotNet.ComputerVision.Segmentation.InstanceSegmentation
Base class for instance segmentation models.
Inheritance: ModelBase<T, Tensor<T>, Tensor<T>> โ InstanceSegmenterBase<T>
Known derived types: MaskRCNN<T>, SOLOv2<T>, YOLOSeg<T>
For Beginners
This base class provides the common functionality for all instance segmentation models, which detect and mask individual objects in images.
Properties
| Property | Summary |
|---|---|
ILossFunction<T> DefaultLossFunction { get; } |
|
long ParameterCount { get; } |
|
string Name { get; } |
Name of this segmentation model. |
Methods
| Method | Summary |
|---|---|
IEnumerable<ParameterChunk<T>> GetParameterStateChunks() |
|
IFullModel<T, Tensor<T>, Tensor<T>> WithParameters(Vector<T> parameters) |
|
InstanceSegmentationResult<T> Segment(Tensor<T> image) |
Performs instance segmentation on an image. |
T GetLastLoss() |
Gets the loss of the most recent training step, measured before its update. |
Task LoadWeightsAsync(string pathOrUrl, CancellationToken cancellationToken) |
Loads pretrained weights. |
Tensor<T> Predict(Tensor<T> input) |
Predicts by running the forward pass and returning every raw head, flattened per image and concatenated, so a step trained against Predict reaches every head. |
Vector<T> GetParameters() |
|
byte[] Serialize() |
|
long GetParameterCount() |
Gets the total parameter count. |
void SaveWeights(string path) |
Saves model weights. |
void SetParameters(Vector<T> parameters) |
|
void Train(Tensor<T> input, Tensor<T> expectedOutput) |
Runs one raw-output regression step against Predict (mean squared error, SGD on every trainable tensor), with DataOutputIndices out of the loss. |