Table of Contents

Namespace OpenCvSharp.Dnn

Classes

ClassificationModel

This class represents high-level API for classification models. ClassificationModel allows to set params for preprocessing input image. ClassificationModel creates net from file with trained weights and config, sets preprocessing input, runs forward pass and return top-1 prediction.

DetectionModel

This class represents high-level API for object detection networks. DetectionModel allows to set params for preprocessing input image. DetectionModel creates net from file with trained weights and config, sets preprocessing input, runs forward pass and return result detections.

Image2BlobParams

Processing params of image to blob. It includes all possible image processing operations and corresponding parameters.

KeypointsModel

This class represents high-level API for keypoints models. KeypointsModel allows to set params for preprocessing input image. KeypointsModel creates net from file with trained weights and config, sets preprocessing input, runs forward pass and returns the x and y coordinates of each detected keypoint.

Layer

This interface class allows to build new Layers - are building blocks of networks.

Model

This class is presented high-level API for neural networks. It allows to set params for preprocessing input image. It creates net from file with trained weights and config, sets preprocessing input and runs forward pass.

Net

Base class for objects that own a single native OpenCV pointer through an OpenCvSafeHandle. The SafeHandle is the single source of truth for the native handle value and is responsible for releasing it (including from its own finalizer when the managed object is dropped without Dispose()).

SegmentationModel

This class represents high-level API for segmentation models. SegmentationModel allows to set params for preprocessing input image. SegmentationModel creates net from file with trained weights and config, sets preprocessing input, runs forward pass and returns the class prediction for each pixel.

TextDetectionModel

Base class for text detection networks. This is an abstract base; use TextDetectionModelEAST or TextDetectionModelDB.

TextDetectionModelDB

This class represents high-level API for text detection DL networks compatible with DB model.

TextDetectionModelEAST

This class represents high-level API for text detection DL networks compatible with EAST model.

TextRecognitionModel

This class represents high-level API for text recognition networks. TextRecognitionModel allows to set params for preprocessing input image. TextRecognitionModel creates net from file with trained weights and config, sets preprocessing input, runs forward pass and return recognition result. For TextRecognitionModel, CRNN-CTC is supported.

Tokenizer

Tokenizer for LLM / VLM text (OpenCV 5). Provides a simple API to encode text to token ids and decode token ids back to text (BPE, e.g. gpt2 / gpt4 families).

Enums

Backend

Enum of computation backends supported by layers.

EngineType

Enum of DNN inference engines that can be selected when reading a network (OpenCV 5).

ImagePaddingMode

Enum of image processing mode. To facilitate the specialization pre-processing requirements of the dnn model. For example, the letter box often used in the Yolo series of models.

ModelFormat

Enum of the original framework format a Net was loaded from.

ProfilingMode

Profiling mode for the new DNN engine (OpenCV 5). See Net.ProfilingMode.

SoftNMSMethod

Enum of Soft NMS methods.

Target

Enum of target devices for computations.

TracingMode

Tracing mode for the new DNN engine (OpenCV 5). See Net.TracingMode.