iVS3D v2.0.0
Loading...
Searching...
No Matches
NeuralNet

Neural Network Library containing Tensor and NeuralNet classes for inference. More...

Modules

 NeuralUtil
 Contains utility functions for tensor operations in neural networks.
 
 ReduceOps
 

Namespaces

namespace  NN
 NN Neural Network Library containing Tensor and NeuralNet classes for inference.
 

Classes

class  NN::NeuralError
 Represents an error that occurred in the neural network module and contains the error type and message. More...
 
class  NN::NeuralNet
 Abstract base class for neural networks. More...
 
class  NN::NeuralNetFactory
 Factory class for creating NeuralNet instances. This abstracts from the underlying inference engine (e.g., ONNX Runtime). More...
 
class  NN::OrtNeuralNet
 A class that implements the NeuralNet interface using ONNX Runtime. More...
 
class  NN::Tensor
 A Tensor represents a N-dimensional array containing elements of the same type. Can be used as input and output for inference. More...
 

Typedefs

using NN::NeuralNetPtr = std::shared_ptr< NeuralNet >
 Smart pointer type for managing NeuralNet instances.
 
using NN::Shape = std::vector< int64_t >
 Shape of a N-dimensional Tensor represented as the size in each dimension. Can be -1 in case of dynamic dimensions.
 

Enumerations

enum class  NN::ErrorCode
 Error codes for the neural network module. More...
 
enum class  NN::TensorType
 TensorType encapsulates the supported data types of tensor elements. The supported types are: More...
 

Detailed Description

Neural Network Library containing Tensor and NeuralNet classes for inference.

Contains the Tensor class for representing N-dimensional arrays with various data types. The Tensor class supports operations like reshaping, mapping, reducing, and converting to/from cv::Mat.

A factory handles model loading and abstracts the underlying inference engine (e.g., ONNX Runtime).

Typedef Documentation

◆ NeuralNetPtr

using NN::NeuralNetPtr = typedef std::shared_ptr<NeuralNet>

Smart pointer type for managing NeuralNet instances.

This is a shared pointer type that allows for easy management of NeuralNet instances. It is used to avoid memory leaks and ensure proper cleanup of resources.

◆ Shape

using NN::Shape = typedef std::vector<int64_t>

Shape of a N-dimensional Tensor represented as the size in each dimension. Can be -1 in case of dynamic dimensions.

The Shape is a vector of int64_t values, where each value represents the size of the corresponding dimension. A Shape can be used to describe the input or output shape of a Tensor in a neural network. For example, a Shape of [-1, 3, 512, 512] indicates a dynamic batch size (first dimension), 3 channels, and a spatial resolution of 512x512 pixels. The -1 indicates that the batch size can vary.

NeuralNet net = ...; // create a neural network instance
net.inputShape(); // might be [-1,3,512,512] in NCHW format with a dynamic batch size, 3 channels and 512x512 pixels
Abstract base class for neural networks.
Definition NeuralNet.h:31
virtual Shape inputShape() const =0
Get the input shape of the neural network. This might contain dynamic dimensions (e....

The shape of a Tensor is never empty, so it always contains at least one dimension. It is guaranteed that no dimension is -1, so the shape is static. This means that the number of elements in a Tensor can be calculated as the product of all dimensions.

Enumeration Type Documentation

◆ ErrorCode

enum class NN::ErrorCode
strong

Error codes for the neural network module.

This enum class defines the various error codes that can be returned by the neural network module:

  • InvalidArgument: The provided argument i.e. the path to the onnx model is invalid.
  • OutOfMemory: The system/gpu ran out of memory.
  • RuntimeError: A runtime error occurred.
Author
Dominik Wüst (domin.nosp@m.ik.w.nosp@m.uest@.nosp@m.iosb.nosp@m..faun.nosp@m.hofe.nosp@m.r.de)
Date
August 2025

◆ TensorType

enum class NN::TensorType
strong

TensorType encapsulates the supported data types of tensor elements. The supported types are:

  • Float
  • Int64
  • UInt8