Table of Contents

Class YOLOSeg<T>

YOLOv8-Seg for instance segmentation.

public class YOLOSeg<T> : InstanceSegmenterBase<T>

Type Parameters

T

The numeric type used for calculations.

Inheritance
YOLOSeg<T>
Inherited Members

Remarks

For Beginners: YOLOv8-Seg extends YOLOv8 detection with a segmentation head. It uses prototype masks and per-instance coefficients for efficient mask prediction. This is much faster than Mask R-CNN while maintaining good quality.

Key features: - Single-stage detection + segmentation - Prototype-based mask assembly - Shared backbone with detection head - Real-time performance

Constructors

YOLOSeg(InstanceSegmentationOptions<T>)

Creates a new YOLOv8-Seg model.

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