Table of Contents

Class SOLOv2<T>

SOLOv2 (Segmenting Objects by Locations v2) for instance segmentation.

public class SOLOv2<T> : InstanceSegmenterBase<T>

Type Parameters

T

The numeric type used for calculations.

Inheritance
SOLOv2<T>
Inherited Members

Remarks

For Beginners: SOLOv2 is an anchor-free, box-free instance segmentation method. It directly predicts instance masks by location, dividing the image into a grid and predicting masks for each cell. This eliminates the need for ROI operations.

Key features: - Direct mask prediction without boxes - Dynamic convolution for mask generation - Grid-based location encoding - More efficient than two-stage methods

Reference: Wang et al., "SOLOv2: Dynamic and Fast Instance Segmentation", NeurIPS 2020

Constructors

SOLOv2(InstanceSegmentationOptions<T>)

Creates a new SOLOv2 model.

public SOLOv2(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.