Table of Contents

Class PredictCentroids

Namespace
Bonsai.Sleap
Assembly
Bonsai.Sleap.dll

Represents an operator that performs multi-instance centroid detection for each image in the sequence using a SLEAP model.

PredictCentroids implements the centroid network. This model is most commonly used to find a set of candidate centroids from a full-resolution image. For each frame, it will return a CentroidCollection which can be further indexed to access the individual instances.

As an example application, the output of this operator is also fully compatible with the CropCenter transform node, which can be used to easily generate smaller crops centered on the detected centroid instance (i.e. Centroid)

PredictCentroids

public class PredictCentroids : Transform<IplImage, CentroidCollection>
Inheritance
PredictCentroids
Inherited Members

Properties

CentroidMinConfidence

Gets or sets a value specifying the confidence threshold used to discard centroid predictions. If no value is specified, all estimated centroid positions are returned.

[Range(0, 1)]
public float? CentroidMinConfidence { get; set; }

Property Value

float?

ColorConversion

Gets or sets a value specifying the optional color conversion used to prepare RGB video frames for inference. If no value is specified, no color conversion is performed.

public ColorConversion? ColorConversion { get; set; }

Property Value

ColorConversion?

ModelFileName

Gets or sets a value specifying the path to the exported Protocol Buffer file containing the pretrained SLEAP model.

[FileNameFilter("Protocol Buffer Files(*.pb)|*.pb")]
public string ModelFileName { get; set; }

Property Value

string

ScaleFactor

Gets or sets a value specifying the scale factor used to resize video frames for inference. If no value is specified, no resizing is performed.

public float? ScaleFactor { get; set; }

Property Value

float?

TrainingConfig

Gets or sets a value specifying the path to the configuration JSON file containing training metadata.

[FileNameFilter("Config Files(*.json)|*.json|All Files|*.*")]
public string TrainingConfig { get; set; }

Property Value

string

Methods

Process(IObservable<IplImage>)

Performs multi-instance centroid detection for each image in an observable sequence using a SLEAP model.

public override IObservable<CentroidCollection> Process(IObservable<IplImage> source)

Parameters

source IObservable<IplImage>

The sequence of images from which to extract the centroids.

Returns

IObservable<CentroidCollection>

A sequence of CentroidCollection objects representing the centroids extracted from each image in the source sequence.

See Also