Table of Contents

Class ComputerVisionBuilderExtensions

Namespace
AiDotNet
Assembly
AiDotNet.dll

Extension methods for computer vision operations.

public static class ComputerVisionBuilderExtensions
Inheritance
ComputerVisionBuilderExtensions
Inherited Members

Methods

DetectAndTrack<T>(AiModelBuilder<T, Tensor<T>, TrackingResult<T>>, Tensor<T>)

Performs detection and tracking in one step.

public static TrackingResult<T> DetectAndTrack<T>(this AiModelBuilder<T, Tensor<T>, TrackingResult<T>> builder, Tensor<T> image)

Parameters

builder AiModelBuilder<T, Tensor<T>, TrackingResult<T>>

The configured builder.

image Tensor<T>

Input image tensor.

Returns

TrackingResult<T>

Tracking result with tracked objects.

Type Parameters

T

The numeric type used for calculations.

DetectObjects<T>(AiModelBuilder<T, Tensor<T>, DetectionResult<T>>, Tensor<T>)

Performs object detection on an image.

public static DetectionResult<T> DetectObjects<T>(this AiModelBuilder<T, Tensor<T>, DetectionResult<T>> builder, Tensor<T> image)

Parameters

builder AiModelBuilder<T, Tensor<T>, DetectionResult<T>>

The configured builder.

image Tensor<T>

Input image tensor [batch, channels, height, width].

Returns

DetectionResult<T>

Detection result with bounding boxes and labels.

Type Parameters

T

The numeric type used for calculations.

RecognizeText<T>(AiModelBuilder<T, Tensor<T>, OCRResult<T>>, Tensor<T>)

Performs OCR on an image.

public static OCRResult<T> RecognizeText<T>(this AiModelBuilder<T, Tensor<T>, OCRResult<T>> builder, Tensor<T> image)

Parameters

builder AiModelBuilder<T, Tensor<T>, OCRResult<T>>

The configured builder.

image Tensor<T>

Input image tensor.

Returns

OCRResult<T>

OCR result with recognized text.

Type Parameters

T

The numeric type used for calculations.

SegmentInstances<T>(AiModelBuilder<T, Tensor<T>, InstanceSegmentationResult<T>>, Tensor<T>)

Performs instance segmentation on an image.

public static InstanceSegmentationResult<T> SegmentInstances<T>(this AiModelBuilder<T, Tensor<T>, InstanceSegmentationResult<T>> builder, Tensor<T> image)

Parameters

builder AiModelBuilder<T, Tensor<T>, InstanceSegmentationResult<T>>

The configured builder.

image Tensor<T>

Input image tensor.

Returns

InstanceSegmentationResult<T>

Instance segmentation result with masks.

Type Parameters

T

The numeric type used for calculations.

UpdateTracks<T>(AiModelBuilder<T, Tensor<T>, TrackingResult<T>>, List<Detection<T>>)

Updates object tracking with new detections.

public static TrackingResult<T> UpdateTracks<T>(this AiModelBuilder<T, Tensor<T>, TrackingResult<T>> builder, List<Detection<T>> detections)

Parameters

builder AiModelBuilder<T, Tensor<T>, TrackingResult<T>>

The configured builder.

detections List<Detection<T>>

Detections from the current frame.

Returns

TrackingResult<T>

Tracking result with updated tracks.

Type Parameters

T

The numeric type used for calculations.

VisualizeDetections<T>(AiModelBuilder<T, Tensor<T>, DetectionResult<T>>, Tensor<T>, DetectionResult<T>, string[]?)

Visualizes detection results on an image.

public static Tensor<T> VisualizeDetections<T>(this AiModelBuilder<T, Tensor<T>, DetectionResult<T>> builder, Tensor<T> image, DetectionResult<T> result, string[]? classNames = null)

Parameters

builder AiModelBuilder<T, Tensor<T>, DetectionResult<T>>

The configured builder.

image Tensor<T>

Input image.

result DetectionResult<T>

Detection result to visualize.

classNames string[]

Optional class name mapping.

Returns

Tensor<T>

Image with visualizations drawn.

Type Parameters

T

The numeric type used for calculations.

VisualizeOCR<T>(AiModelBuilder<T, Tensor<T>, OCRResult<T>>, Tensor<T>, OCRResult<T>)

Visualizes OCR results on an image.

public static Tensor<T> VisualizeOCR<T>(this AiModelBuilder<T, Tensor<T>, OCRResult<T>> builder, Tensor<T> image, OCRResult<T> result)

Parameters

builder AiModelBuilder<T, Tensor<T>, OCRResult<T>>

The configured builder.

image Tensor<T>

Input image.

result OCRResult<T>

OCR result to visualize.

Returns

Tensor<T>

Image with visualizations drawn.

Type Parameters

T

The numeric type used for calculations.

VisualizeSegmentation<T>(AiModelBuilder<T, Tensor<T>, InstanceSegmentationResult<T>>, Tensor<T>, InstanceSegmentationResult<T>, string[]?)

Visualizes instance segmentation results on an image.

public static Tensor<T> VisualizeSegmentation<T>(this AiModelBuilder<T, Tensor<T>, InstanceSegmentationResult<T>> builder, Tensor<T> image, InstanceSegmentationResult<T> result, string[]? classNames = null)

Parameters

builder AiModelBuilder<T, Tensor<T>, InstanceSegmentationResult<T>>

The configured builder.

image Tensor<T>

Input image.

result InstanceSegmentationResult<T>

Segmentation result to visualize.

classNames string[]

Optional class name mapping.

Returns

Tensor<T>

Image with visualizations drawn.

Type Parameters

T

The numeric type used for calculations.