Class YOLOSeg<T>
- Assembly
- AiDotNet.dll
YOLOv8-Seg for instance segmentation.
public class YOLOSeg<T> : InstanceSegmenterBase<T>
Type Parameters
TThe 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
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.