NVIDIA DeepStream SDK API Reference

6.4 Release
NvDsPreProcess Plugin

Detailed Description

Defines an API for the GStreamer NvDsPreProcess plugin.

Defines an API for the GStreamer NvDsPreProcess custom lib.

Defines an API for the GStreamer NvDsPreProcess custom lib implementation.

Data Structures

struct  NvDsPreProcessTensorMeta
 tensor meta containing prepared tensor and related info inside preprocess user meta which is attached at batch level More...
 
struct  GstNvDsPreProcessBatchMeta
 preprocess meta as a user meta which is attached at batch level More...
 
struct  CustomTransformParams
 custom transformation parameter for calling nvbufsurftransform api for scaling and converting the ROIs to the network resolutions to be used by custom lib. More...
 
struct  NvDsPreProcessTensorParams
 Holds model parameters for tensor preparation. More...
 
struct  NvDsPreProcessNetworkSize
 Holds information about the model network. More...
 
struct  CustomSeqProcTensorParams
 Tensor params for Custom sequence processing for 3d conv network. More...
 
struct  CustomTensorParams
 Tensor params passed to custom library for tensor preparation. More...
 
struct  CustomInitParams
 Custom Initialization parameter for custom library. More...
 
struct  NvDsPreProcessCustomBuf
 Custom Buffer passed to the custom lib for preparing tensor. More...
 
class  NvDsPreProcessAcquirer
 class for acquiring and releasing a buffer from tensor pool by custom lib. More...
 
struct  NvDsPreProcessUnit
 A preprocess unit for processing which can be Frame/ROI. More...
 
struct  NvDsPreProcessBatch
 Holds information about the batch of frames to be inferred. More...
 

Macros

#define _PATH_MAX   4096
 Maximum file path length. More...
 
#define NVDSPREPROCESS_USER_CONFIGS_PIXEL_NORMALIZATION_FACTOR   "pixel-normalization-factor"
 pixel-normalization-factor config parameter More...
 
#define NVDSPREPROCESS_USER_CONFIGS_MEAN_FILE   "mean-file"
 mean-file config parameter More...
 
#define NVDSPREPROCESS_USER_CONFIGS_OFFSETS   "offsets"
 offsets config parameter More...
 

Typedefs

typedef struct CustomCtx CustomCtx
 Context for custom library. More...
 
typedef struct CustomCtx CustomCtx
 Context for custom library. More...
 
typedef void(* NvDsPreProcessConvertFcn) (float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
 Function pointer type to which any of the NvDsPreProcessConvert functions can be assigned. More...
 

Enumerations

enum  NvDsPreProcessStatus {
  NVDSPREPROCESS_SUCCESS = 0,
  NVDSPREPROCESS_CONFIG_FAILED,
  NVDSPREPROCESS_CUSTOM_LIB_FAILED,
  NVDSPREPROCESS_CUSTOM_TRANSFORMATION_FAILED,
  NVDSPREPROCESS_CUSTOM_TENSOR_FAILED,
  NVDSPREPROCESS_INVALID_PARAMS,
  NVDSPREPROCESS_OUTPUT_PARSING_FAILED,
  NVDSPREPROCESS_CUDA_ERROR,
  NVDSPREPROCESS_TENSORRT_ERROR,
  NVDSPREPROCESS_RESOURCE_ERROR,
  NVDSPREPROCESS_TENSOR_NOT_READY,
  NVDSPREPROCESS_SUCCESS = 0,
  NVDSPREPROCESS_CONFIG_FAILED,
  NVDSPREPROCESS_CUSTOM_LIB_FAILED,
  NVDSPREPROCESS_CUSTOM_TRANSFORMATION_FAILED,
  NVDSPREPROCESS_CUSTOM_TENSOR_FAILED,
  NVDSPREPROCESS_INVALID_PARAMS,
  NVDSPREPROCESS_OUTPUT_PARSING_FAILED,
  NVDSPREPROCESS_CUDA_ERROR,
  NVDSPREPROCESS_TENSORRT_ERROR,
  NVDSPREPROCESS_RESOURCE_ERROR,
  NVDSPREPROCESS_TENSOR_NOT_READY
}
 Enum for the status codes returned by NvDsPreProcessImpl. More...
 
enum  NvDsPreProcessNetworkInputOrder {
  NvDsPreProcessNetworkInputOrder_kNCHW = 0,
  NvDsPreProcessNetworkInputOrder_kNHWC,
  NvDsPreProcessNetworkInputOrder_CUSTOM,
  NvDsPreProcessNetworkInputOrder_kNCHW = 0,
  NvDsPreProcessNetworkInputOrder_kNHWC,
  NvDsPreProcessNetworkInputOrder_CUSTOM
}
 Enum for the network input order according to which network shape will be provided to prepare raw tensor for inferencing. More...
 
enum  NvDsPreProcessFormat {
  NvDsPreProcessFormat_RGB,
  NvDsPreProcessFormat_BGR,
  NvDsPreProcessFormat_GRAY,
  NvDsPreProcessFormat_RGBA,
  NvDsPreProcessFormat_BGRx,
  NvDsPreProcessFormat_Tensor,
  NvDsPreProcessFormat_Unknown = 0xFFFFFFFF,
  NvDsPreProcessFormat_RGB,
  NvDsPreProcessFormat_BGR,
  NvDsPreProcessFormat_GRAY,
  NvDsPreProcessFormat_RGBA,
  NvDsPreProcessFormat_BGRx,
  NvDsPreProcessFormat_Tensor,
  NvDsPreProcessFormat_Unknown = 0xFFFFFFFF
}
 Defines model color formats. More...
 
enum  NvDsPreProcessStatus {
  NVDSPREPROCESS_SUCCESS = 0,
  NVDSPREPROCESS_CONFIG_FAILED,
  NVDSPREPROCESS_CUSTOM_LIB_FAILED,
  NVDSPREPROCESS_CUSTOM_TRANSFORMATION_FAILED,
  NVDSPREPROCESS_CUSTOM_TENSOR_FAILED,
  NVDSPREPROCESS_INVALID_PARAMS,
  NVDSPREPROCESS_OUTPUT_PARSING_FAILED,
  NVDSPREPROCESS_CUDA_ERROR,
  NVDSPREPROCESS_TENSORRT_ERROR,
  NVDSPREPROCESS_RESOURCE_ERROR,
  NVDSPREPROCESS_TENSOR_NOT_READY,
  NVDSPREPROCESS_SUCCESS = 0,
  NVDSPREPROCESS_CONFIG_FAILED,
  NVDSPREPROCESS_CUSTOM_LIB_FAILED,
  NVDSPREPROCESS_CUSTOM_TRANSFORMATION_FAILED,
  NVDSPREPROCESS_CUSTOM_TENSOR_FAILED,
  NVDSPREPROCESS_INVALID_PARAMS,
  NVDSPREPROCESS_OUTPUT_PARSING_FAILED,
  NVDSPREPROCESS_CUDA_ERROR,
  NVDSPREPROCESS_TENSORRT_ERROR,
  NVDSPREPROCESS_RESOURCE_ERROR,
  NVDSPREPROCESS_TENSOR_NOT_READY
}
 Enum for the status codes returned by NvDsPreProcessImpl. More...
 
enum  NvDsPreProcessNetworkInputOrder {
  NvDsPreProcessNetworkInputOrder_kNCHW = 0,
  NvDsPreProcessNetworkInputOrder_kNHWC,
  NvDsPreProcessNetworkInputOrder_CUSTOM,
  NvDsPreProcessNetworkInputOrder_kNCHW = 0,
  NvDsPreProcessNetworkInputOrder_kNHWC,
  NvDsPreProcessNetworkInputOrder_CUSTOM
}
 Enum for the network input order according to which network shape will be provided to prepare raw tensor for inferencing. More...
 
enum  NvDsPreProcessFormat {
  NvDsPreProcessFormat_RGB,
  NvDsPreProcessFormat_BGR,
  NvDsPreProcessFormat_GRAY,
  NvDsPreProcessFormat_RGBA,
  NvDsPreProcessFormat_BGRx,
  NvDsPreProcessFormat_Tensor,
  NvDsPreProcessFormat_Unknown = 0xFFFFFFFF,
  NvDsPreProcessFormat_RGB,
  NvDsPreProcessFormat_BGR,
  NvDsPreProcessFormat_GRAY,
  NvDsPreProcessFormat_RGBA,
  NvDsPreProcessFormat_BGRx,
  NvDsPreProcessFormat_Tensor,
  NvDsPreProcessFormat_Unknown = 0xFFFFFFFF
}
 Defines model color formats. More...
 

Functions

void NvDsPreProcessConvert_C3ToP3Float (float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
 Converts an input packed 3 channel buffer of width x height resolution into an planar 3-channel float buffer of width x height resolution. More...
 
void NvDsPreProcessConvert_C3ToL3Float (float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
 Converts an input packed 3 channel buffer of width x height resolution into an linear 3-channel float buffer of width x height resolution. More...
 
void NvDsPreProcessConvert_C4ToP3Float (float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
 Converts an input packed 3 channel buffer of width x height resolution into an planar 3-channel float buffer of width x height resolution. More...
 
void NvDsPreProcessConvert_C4ToL3Float (float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
 Converts an input packed 3 channel buffer of width x height resolution into an linear 3-channel float buffer of width x height resolution. More...
 
void NvDsPreProcessConvert_C3ToP3RFloat (float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
 Converts an input packed 3 channel buffer of width x height resolution into an planar 3-channel float buffer of width x height resolution with plane order reversed. More...
 
void NvDsPreProcessConvert_C3ToL3RFloat (float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
 Converts an input packed 3 channel buffer of width x height resolution into an linear 3-channel float buffer of width x height resolution with plane order reversed. More...
 
void NvDsPreProcessConvert_C4ToP3RFloat (float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
 Converts an input packed 4 channel buffer of width x height resolution into an planar 3-channel float buffer of width x height resolution with plane order reversed. More...
 
void NvDsPreProcessConvert_C4ToL3RFloat (float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
 Converts an input packed 4 channel buffer of width x height resolution into an linear 3-channel float buffer of width x height resolution with plane order reversed. More...
 
void NvDsPreProcessConvert_C1ToP1Float (float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
 Converts an 1 channel UINT8 input of width x height resolution into an 1 channel float buffer of width x height resolution. More...
 
void NvDsPreProcessConvert_FtFTensor (float *outBuffer, float *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)
 
NvDsPreProcessStatus CustomTransformation (NvBufSurface *in_surf, NvBufSurface *out_surf, CustomTransformParams &params)
 Custom transformation function for group. More...
 
NvDsPreProcessStatus CustomAsyncTransformation (NvBufSurface *in_surf, NvBufSurface *out_surf, CustomTransformParams &params)
 Custom Asynchronus group transformation function. More...
 
NvDsPreProcessStatus CustomTensorPreparation (CustomCtx *ctx, NvDsPreProcessBatch *batch, NvDsPreProcessCustomBuf *&buf, CustomTensorParams &tensorParam, NvDsPreProcessAcquirer *acquirer)
 Custom tensor preparation function for NCHW/NHWC network order. More...
 
CustomCtxinitLib (CustomInitParams initparams)
 custom library initialization function More...
 
void deInitLib (CustomCtx *ctx)
 custom library deinitialization function More...
 

Variables

void * NvDsPreProcessTensorMeta::raw_tensor_buffer
 raw tensor buffer preprocessed for infer More...
 
guint64 NvDsPreProcessTensorMeta::buffer_size
 size of raw tensor buffer More...
 
std::vector< int > NvDsPreProcessTensorMeta::tensor_shape
 raw tensor buffer shape More...
 
NvDsDataType NvDsPreProcessTensorMeta::data_type
 model datatype for which tensor prepared More...
 
std::string NvDsPreProcessTensorMeta::tensor_name
 to be same as model input layer name More...
 
guint NvDsPreProcessTensorMeta::gpu_id
 gpu-id on which tensor prepared More...
 
void * NvDsPreProcessTensorMeta::private_data
 pointer to buffer from tensor pool More...
 
guint NvDsPreProcessTensorMeta::meta_id
 meta id for differentiating between multiple tensor meta from same gst buffer,for the case when sum of roi's exceeds the batch size More...
 
std::vector< guint64 > GstNvDsPreProcessBatchMeta::target_unique_ids
 target unique ids for which meta is prepared More...
 
NvDsPreProcessTensorMetaGstNvDsPreProcessBatchMeta::tensor_meta
 pointer to tensor meta More...
 
std::vector< NvDsRoiMetaGstNvDsPreProcessBatchMeta::roi_vector
 list of roi vectors per batch More...
 
void * GstNvDsPreProcessBatchMeta::private_data
 pointer to buffer from scaling pool More...
 

Macro Definition Documentation

◆ _PATH_MAX

#define _PATH_MAX   4096

Maximum file path length.

Definition at line 46 of file nvdspreprocess_lib.h.

◆ NVDSPREPROCESS_USER_CONFIGS_MEAN_FILE

#define NVDSPREPROCESS_USER_CONFIGS_MEAN_FILE   "mean-file"

mean-file config parameter

Definition at line 52 of file nvdspreprocess_lib.h.

◆ NVDSPREPROCESS_USER_CONFIGS_OFFSETS

#define NVDSPREPROCESS_USER_CONFIGS_OFFSETS   "offsets"

offsets config parameter

Definition at line 55 of file nvdspreprocess_lib.h.

◆ NVDSPREPROCESS_USER_CONFIGS_PIXEL_NORMALIZATION_FACTOR

#define NVDSPREPROCESS_USER_CONFIGS_PIXEL_NORMALIZATION_FACTOR   "pixel-normalization-factor"

pixel-normalization-factor config parameter

Definition at line 49 of file nvdspreprocess_lib.h.

Typedef Documentation

◆ CustomCtx [1/2]

typedef struct CustomCtx CustomCtx

Context for custom library.

Definition at line 54 of file gst-plugins/gst-nvdspreprocess/include/nvdspreprocess_interface.h.

◆ CustomCtx [2/2]

typedef struct CustomCtx CustomCtx

Context for custom library.

Definition at line 54 of file includes/nvdspreprocess_interface.h.

◆ NvDsPreProcessConvertFcn

typedef void(* NvDsPreProcessConvertFcn) (float *outBuffer, unsigned char *inBuffer, unsigned int width, unsigned int height, unsigned int pitch, float scaleFactor, float *meanDataBuffer, cudaStream_t stream)

Function pointer type to which any of the NvDsPreProcessConvert functions can be assigned.

Definition at line 334 of file nvdspreprocess_conversion.h.

Enumeration Type Documentation

◆ NvDsPreProcessFormat [1/2]

Defines model color formats.

Enumerator
NvDsPreProcessFormat_RGB 

Specifies 24-bit interleaved R-G-B format.

NvDsPreProcessFormat_BGR 

Specifies 24-bit interleaved B-G-R format.

NvDsPreProcessFormat_GRAY 

Specifies 8-bit Luma format.

NvDsPreProcessFormat_RGBA 

Specifies 32-bit interleaved R-G-B-A format.

NvDsPreProcessFormat_BGRx 

Specifies 32-bit interleaved B-G-R-x format.

NvDsPreProcessFormat_Tensor 

NCHW planar.

NvDsPreProcessFormat_Unknown 
NvDsPreProcessFormat_RGB 

Specifies 24-bit interleaved R-G-B format.

NvDsPreProcessFormat_BGR 

Specifies 24-bit interleaved B-G-R format.

NvDsPreProcessFormat_GRAY 

Specifies 8-bit Luma format.

NvDsPreProcessFormat_RGBA 

Specifies 32-bit interleaved R-G-B-A format.

NvDsPreProcessFormat_BGRx 

Specifies 32-bit interleaved B-G-R-x format.

NvDsPreProcessFormat_Tensor 

NCHW planar.

NvDsPreProcessFormat_Unknown 

Definition at line 104 of file gst-plugins/gst-nvdspreprocess/include/nvdspreprocess_interface.h.

◆ NvDsPreProcessFormat [2/2]

Defines model color formats.

Enumerator
NvDsPreProcessFormat_RGB 

Specifies 24-bit interleaved R-G-B format.

NvDsPreProcessFormat_BGR 

Specifies 24-bit interleaved B-G-R format.

NvDsPreProcessFormat_GRAY 

Specifies 8-bit Luma format.

NvDsPreProcessFormat_RGBA 

Specifies 32-bit interleaved R-G-B-A format.

NvDsPreProcessFormat_BGRx 

Specifies 32-bit interleaved B-G-R-x format.

NvDsPreProcessFormat_Tensor 

NCHW planar.

NvDsPreProcessFormat_Unknown 
NvDsPreProcessFormat_RGB 

Specifies 24-bit interleaved R-G-B format.

NvDsPreProcessFormat_BGR 

Specifies 24-bit interleaved B-G-R format.

NvDsPreProcessFormat_GRAY 

Specifies 8-bit Luma format.

NvDsPreProcessFormat_RGBA 

Specifies 32-bit interleaved R-G-B-A format.

NvDsPreProcessFormat_BGRx 

Specifies 32-bit interleaved B-G-R-x format.

NvDsPreProcessFormat_Tensor 

NCHW planar.

NvDsPreProcessFormat_Unknown 

Definition at line 104 of file includes/nvdspreprocess_interface.h.

◆ NvDsPreProcessNetworkInputOrder [1/2]

Enum for the network input order according to which network shape will be provided to prepare raw tensor for inferencing.

Enumerator
NvDsPreProcessNetworkInputOrder_kNCHW 

Specifies NCHW network input order.

NvDsPreProcessNetworkInputOrder_kNHWC 

Specifies NHWC network input order.

NvDsPreProcessNetworkInputOrder_CUSTOM 

Specifies any other custom input order handled by custom lib.

NvDsPreProcessNetworkInputOrder_kNCHW 

Specifies NCHW network input order.

NvDsPreProcessNetworkInputOrder_kNHWC 

Specifies NHWC network input order.

NvDsPreProcessNetworkInputOrder_CUSTOM 

Specifies any other custom input order handled by custom lib.

Definition at line 91 of file includes/nvdspreprocess_interface.h.

◆ NvDsPreProcessNetworkInputOrder [2/2]

Enum for the network input order according to which network shape will be provided to prepare raw tensor for inferencing.

Enumerator
NvDsPreProcessNetworkInputOrder_kNCHW 

Specifies NCHW network input order.

NvDsPreProcessNetworkInputOrder_kNHWC 

Specifies NHWC network input order.

NvDsPreProcessNetworkInputOrder_CUSTOM 

Specifies any other custom input order handled by custom lib.

NvDsPreProcessNetworkInputOrder_kNCHW 

Specifies NCHW network input order.

NvDsPreProcessNetworkInputOrder_kNHWC 

Specifies NHWC network input order.

NvDsPreProcessNetworkInputOrder_CUSTOM 

Specifies any other custom input order handled by custom lib.

Definition at line 91 of file gst-plugins/gst-nvdspreprocess/include/nvdspreprocess_interface.h.

◆ NvDsPreProcessStatus [1/2]

Enum for the status codes returned by NvDsPreProcessImpl.

Enumerator
NVDSPREPROCESS_SUCCESS 

NvDsPreprocess operation succeeded.

NVDSPREPROCESS_CONFIG_FAILED 

Failed to configure the tensor_impl instance possibly due to an erroneous initialization property.

NVDSPREPROCESS_CUSTOM_LIB_FAILED 

Custom Library interface implementation failed.

NVDSPREPROCESS_CUSTOM_TRANSFORMATION_FAILED 

Custom Group Transformation failed.

NVDSPREPROCESS_CUSTOM_TENSOR_FAILED 

Custom Tensor Preparation failed.

NVDSPREPROCESS_INVALID_PARAMS 

Invalid parameters were supplied.

NVDSPREPROCESS_OUTPUT_PARSING_FAILED 

Output parsing failed.

NVDSPREPROCESS_CUDA_ERROR 

CUDA error was encountered.

NVDSPREPROCESS_TENSORRT_ERROR 

TensorRT interface failed.

NVDSPREPROCESS_RESOURCE_ERROR 

Resource error was encountered.

NVDSPREPROCESS_TENSOR_NOT_READY 

Tensor Yet not ready to be attached as meta.

NVDSPREPROCESS_SUCCESS 

NvDsPreprocess operation succeeded.

NVDSPREPROCESS_CONFIG_FAILED 

Failed to configure the tensor_impl instance possibly due to an erroneous initialization property.

NVDSPREPROCESS_CUSTOM_LIB_FAILED 

Custom Library interface implementation failed.

NVDSPREPROCESS_CUSTOM_TRANSFORMATION_FAILED 

Custom Group Transformation failed.

NVDSPREPROCESS_CUSTOM_TENSOR_FAILED 

Custom Tensor Preparation failed.

NVDSPREPROCESS_INVALID_PARAMS 

Invalid parameters were supplied.

NVDSPREPROCESS_OUTPUT_PARSING_FAILED 

Output parsing failed.

NVDSPREPROCESS_CUDA_ERROR 

CUDA error was encountered.

NVDSPREPROCESS_TENSORRT_ERROR 

TensorRT interface failed.

NVDSPREPROCESS_RESOURCE_ERROR 

Resource error was encountered.

NVDSPREPROCESS_TENSOR_NOT_READY 

Tensor Yet not ready to be attached as meta.

Definition at line 59 of file includes/nvdspreprocess_interface.h.

◆ NvDsPreProcessStatus [2/2]

Enum for the status codes returned by NvDsPreProcessImpl.

Enumerator
NVDSPREPROCESS_SUCCESS 

NvDsPreprocess operation succeeded.

NVDSPREPROCESS_CONFIG_FAILED 

Failed to configure the tensor_impl instance possibly due to an erroneous initialization property.

NVDSPREPROCESS_CUSTOM_LIB_FAILED 

Custom Library interface implementation failed.

NVDSPREPROCESS_CUSTOM_TRANSFORMATION_FAILED 

Custom Group Transformation failed.

NVDSPREPROCESS_CUSTOM_TENSOR_FAILED 

Custom Tensor Preparation failed.

NVDSPREPROCESS_INVALID_PARAMS 

Invalid parameters were supplied.

NVDSPREPROCESS_OUTPUT_PARSING_FAILED 

Output parsing failed.

NVDSPREPROCESS_CUDA_ERROR 

CUDA error was encountered.

NVDSPREPROCESS_TENSORRT_ERROR 

TensorRT interface failed.

NVDSPREPROCESS_RESOURCE_ERROR 

Resource error was encountered.

NVDSPREPROCESS_TENSOR_NOT_READY 

Tensor Yet not ready to be attached as meta.

NVDSPREPROCESS_SUCCESS 

NvDsPreprocess operation succeeded.

NVDSPREPROCESS_CONFIG_FAILED 

Failed to configure the tensor_impl instance possibly due to an erroneous initialization property.

NVDSPREPROCESS_CUSTOM_LIB_FAILED 

Custom Library interface implementation failed.

NVDSPREPROCESS_CUSTOM_TRANSFORMATION_FAILED 

Custom Group Transformation failed.

NVDSPREPROCESS_CUSTOM_TENSOR_FAILED 

Custom Tensor Preparation failed.

NVDSPREPROCESS_INVALID_PARAMS 

Invalid parameters were supplied.

NVDSPREPROCESS_OUTPUT_PARSING_FAILED 

Output parsing failed.

NVDSPREPROCESS_CUDA_ERROR 

CUDA error was encountered.

NVDSPREPROCESS_TENSORRT_ERROR 

TensorRT interface failed.

NVDSPREPROCESS_RESOURCE_ERROR 

Resource error was encountered.

NVDSPREPROCESS_TENSOR_NOT_READY 

Tensor Yet not ready to be attached as meta.

Definition at line 59 of file gst-plugins/gst-nvdspreprocess/include/nvdspreprocess_interface.h.

Function Documentation

◆ CustomAsyncTransformation()

NvDsPreProcessStatus CustomAsyncTransformation ( NvBufSurface in_surf,
NvBufSurface out_surf,
CustomTransformParams params 
)

Custom Asynchronus group transformation function.

◆ CustomTensorPreparation()

NvDsPreProcessStatus CustomTensorPreparation ( CustomCtx ctx,
NvDsPreProcessBatch batch,
NvDsPreProcessCustomBuf *&  buf,
CustomTensorParams tensorParam,
NvDsPreProcessAcquirer acquirer 
)

Custom tensor preparation function for NCHW/NHWC network order.

◆ CustomTransformation()

NvDsPreProcessStatus CustomTransformation ( NvBufSurface in_surf,
NvBufSurface out_surf,
CustomTransformParams params 
)

Custom transformation function for group.

◆ deInitLib()

void deInitLib ( CustomCtx ctx)

custom library deinitialization function

◆ initLib()

CustomCtx* initLib ( CustomInitParams  initparams)

custom library initialization function

◆ NvDsPreProcessConvert_C1ToP1Float()

void NvDsPreProcessConvert_C1ToP1Float ( float *  outBuffer,
unsigned char *  inBuffer,
unsigned int  width,
unsigned int  height,
unsigned int  pitch,
float  scaleFactor,
float *  meanDataBuffer,
cudaStream_t  stream 
)

Converts an 1 channel UINT8 input of width x height resolution into an 1 channel float buffer of width x height resolution.

The input buffer can have a pitch > width . The cuda kernel supports normalization and mean image subtraction.

Parameters
outBufferCuda device buffer for float output. Should be at least (width * height * sizeof(float)) bytes.
inBufferCuda device buffer for UINT8 input. Should be at least (pitch * height) bytes.
widthWidth of the buffers in pixels.
heightHeight of the buffers in pixels.
pitchPitch of the input buffer in bytes.
scaleFactorNormalization factor.
meanDataBufferMean Image Data buffer. Should be at least (width * height * sizeof(float)) bytes.
streamCuda stream identifier.

◆ NvDsPreProcessConvert_C3ToL3Float()

void NvDsPreProcessConvert_C3ToL3Float ( float *  outBuffer,
unsigned char *  inBuffer,
unsigned int  width,
unsigned int  height,
unsigned int  pitch,
float  scaleFactor,
float *  meanDataBuffer,
cudaStream_t  stream 
)

Converts an input packed 3 channel buffer of width x height resolution into an linear 3-channel float buffer of width x height resolution.

The input buffer can have a pitch > (width * 3). The cuda kernel supports normalization and mean image subtraction.

This kernel can be used for RGB -> RGB and BGR -> BGR conversions.

Parameters
outBufferCuda device buffer for planar float output. Should be at least (width * height * 3 * sizeof(float)) bytes.
inBufferCuda device buffer for packed input. Should be at least (pitch * height) bytes.
widthWidth of the buffers in pixels.
heightHeight of the buffers in pixels.
pitchPitch of the input buffer in bytes.
scaleFactorNormalization factor.
meanDataBufferMean Image Data buffer. Should be at least (width * height * 3 * sizeof(float)) bytes.
streamCuda stream identifier.

◆ NvDsPreProcessConvert_C3ToL3RFloat()

void NvDsPreProcessConvert_C3ToL3RFloat ( float *  outBuffer,
unsigned char *  inBuffer,
unsigned int  width,
unsigned int  height,
unsigned int  pitch,
float  scaleFactor,
float *  meanDataBuffer,
cudaStream_t  stream 
)

Converts an input packed 3 channel buffer of width x height resolution into an linear 3-channel float buffer of width x height resolution with plane order reversed.

The input buffer can have a pitch > (width * 3). The cuda kernel supports normalization and mean image subtraction.

This kernel can be used for BGR -> RGB and RGB -> BGR conversions.

Parameters
outBufferCuda device buffer for planar float output. Should be at least (width * height * 3 * sizeof(float)) bytes.
inBufferCuda device buffer for packed input. Should be at least (pitch * height) bytes.
widthWidth of the buffers in pixels.
heightHeight of the buffers in pixels.
pitchPitch of the input buffer in bytes.
scaleFactorNormalization factor.
meanDataBufferMean Image Data buffer. Should be at least (width * height * 3 * sizeof(float)) bytes.
streamCuda stream identifier.

◆ NvDsPreProcessConvert_C3ToP3Float()

void NvDsPreProcessConvert_C3ToP3Float ( float *  outBuffer,
unsigned char *  inBuffer,
unsigned int  width,
unsigned int  height,
unsigned int  pitch,
float  scaleFactor,
float *  meanDataBuffer,
cudaStream_t  stream 
)

Converts an input packed 3 channel buffer of width x height resolution into an planar 3-channel float buffer of width x height resolution.

The input buffer can have a pitch > (width * 3). The cuda kernel supports normalization and mean image subtraction.

This kernel can be used for RGB -> RGB and BGR -> BGR conversions.

Parameters
outBufferCuda device buffer for planar float output. Should be at least (width * height * 3 * sizeof(float)) bytes.
inBufferCuda device buffer for packed input. Should be at least (pitch * height) bytes.
widthWidth of the buffers in pixels.
heightHeight of the buffers in pixels.
pitchPitch of the input buffer in bytes.
scaleFactorNormalization factor.
meanDataBufferMean Image Data buffer. Should be at least (width * height * 3 * sizeof(float)) bytes.
streamCuda stream identifier.

◆ NvDsPreProcessConvert_C3ToP3RFloat()

void NvDsPreProcessConvert_C3ToP3RFloat ( float *  outBuffer,
unsigned char *  inBuffer,
unsigned int  width,
unsigned int  height,
unsigned int  pitch,
float  scaleFactor,
float *  meanDataBuffer,
cudaStream_t  stream 
)

Converts an input packed 3 channel buffer of width x height resolution into an planar 3-channel float buffer of width x height resolution with plane order reversed.

The input buffer can have a pitch > (width * 3). The cuda kernel supports normalization and mean image subtraction.

This kernel can be used for BGR -> RGB and RGB -> BGR conversions.

Parameters
outBufferCuda device buffer for planar float output. Should be at least (width * height * 3 * sizeof(float)) bytes.
inBufferCuda device buffer for packed input. Should be at least (pitch * height) bytes.
widthWidth of the buffers in pixels.
heightHeight of the buffers in pixels.
pitchPitch of the input buffer in bytes.
scaleFactorNormalization factor.
meanDataBufferMean Image Data buffer. Should be at least (width * height * 3 * sizeof(float)) bytes.
streamCuda stream identifier.

◆ NvDsPreProcessConvert_C4ToL3Float()

void NvDsPreProcessConvert_C4ToL3Float ( float *  outBuffer,
unsigned char *  inBuffer,
unsigned int  width,
unsigned int  height,
unsigned int  pitch,
float  scaleFactor,
float *  meanDataBuffer,
cudaStream_t  stream 
)

Converts an input packed 3 channel buffer of width x height resolution into an linear 3-channel float buffer of width x height resolution.

The input buffer can have a pitch > (width * 3). The cuda kernel supports normalization and mean image subtraction.

This kernel can be used for RGBA -> RGB and BGRx -> BGR conversions.

Parameters
outBufferCuda device buffer for linear float output. Should be at least (width * height * 3 * sizeof(float)) bytes.
inBufferCuda device buffer for packed input. Should be at least (pitch * height) bytes.
widthWidth of the buffers in pixels.
heightHeight of the buffers in pixels.
pitchPitch of the input buffer in bytes.
scaleFactorNormalization factor.
meanDataBufferMean Image Data buffer. Should be at least (width * height * 3 * sizeof(float)) bytes.
streamCuda stream identifier.

◆ NvDsPreProcessConvert_C4ToL3RFloat()

void NvDsPreProcessConvert_C4ToL3RFloat ( float *  outBuffer,
unsigned char *  inBuffer,
unsigned int  width,
unsigned int  height,
unsigned int  pitch,
float  scaleFactor,
float *  meanDataBuffer,
cudaStream_t  stream 
)

Converts an input packed 4 channel buffer of width x height resolution into an linear 3-channel float buffer of width x height resolution with plane order reversed.

The input buffer can have a pitch > (width * 3). The cuda kernel supports normalization and mean image subtraction.

This kernel can be used for BGRx -> RGB and RGBA -> BGR conversions.

Parameters
outBufferCuda device buffer for planar float output. Should be at least (width * height * 3 * sizeof(float)) bytes.
inBufferCuda device buffer for packed input. Should be at least (pitch * height) bytes.
widthWidth of the buffers in pixels.
heightHeight of the buffers in pixels.
pitchPitch of the input buffer in bytes.
scaleFactorNormalization factor.
meanDataBufferMean Image Data buffer. Should be at least (width * height * 3 * sizeof(float)) bytes.
streamCuda stream identifier.

◆ NvDsPreProcessConvert_C4ToP3Float()

void NvDsPreProcessConvert_C4ToP3Float ( float *  outBuffer,
unsigned char *  inBuffer,
unsigned int  width,
unsigned int  height,
unsigned int  pitch,
float  scaleFactor,
float *  meanDataBuffer,
cudaStream_t  stream 
)

Converts an input packed 3 channel buffer of width x height resolution into an planar 3-channel float buffer of width x height resolution.

The input buffer can have a pitch > (width * 3). The cuda kernel supports normalization and mean image subtraction.

This kernel can be used for RGBA -> RGB and BGRx -> BGR conversions.

Parameters
outBufferCuda device buffer for planar float output. Should be at least (width * height * 3 * sizeof(float)) bytes.
inBufferCuda device buffer for packed input. Should be at least (pitch * height) bytes.
widthWidth of the buffers in pixels.
heightHeight of the buffers in pixels.
pitchPitch of the input buffer in bytes.
scaleFactorNormalization factor.
meanDataBufferMean Image Data buffer. Should be at least (width * height * 3 * sizeof(float)) bytes.
streamCuda stream identifier.

◆ NvDsPreProcessConvert_C4ToP3RFloat()

void NvDsPreProcessConvert_C4ToP3RFloat ( float *  outBuffer,
unsigned char *  inBuffer,
unsigned int  width,
unsigned int  height,
unsigned int  pitch,
float  scaleFactor,
float *  meanDataBuffer,
cudaStream_t  stream 
)

Converts an input packed 4 channel buffer of width x height resolution into an planar 3-channel float buffer of width x height resolution with plane order reversed.

The input buffer can have a pitch > (width * 3). The cuda kernel supports normalization and mean image subtraction.

This kernel can be used for BGRx -> RGB and RGBA -> BGR conversions.

Parameters
outBufferCuda device buffer for planar float output. Should be at least (width * height * 3 * sizeof(float)) bytes.
inBufferCuda device buffer for packed input. Should be at least (pitch * height) bytes.
widthWidth of the buffers in pixels.
heightHeight of the buffers in pixels.
pitchPitch of the input buffer in bytes.
scaleFactorNormalization factor.
meanDataBufferMean Image Data buffer. Should be at least (width * height * 3 * sizeof(float)) bytes.
streamCuda stream identifier.

◆ NvDsPreProcessConvert_FtFTensor()

void NvDsPreProcessConvert_FtFTensor ( float *  outBuffer,
float *  inBuffer,
unsigned int  width,
unsigned int  height,
unsigned int  pitch,
float  scaleFactor,
float *  meanDataBuffer,
cudaStream_t  stream 
)

Variable Documentation

◆ buffer_size

guint64 NvDsPreProcessTensorMeta::buffer_size

size of raw tensor buffer

Definition at line 56 of file gst-plugins/gst-nvdspreprocess/include/nvdspreprocess_meta.h.

◆ data_type

NvDsDataType NvDsPreProcessTensorMeta::data_type

model datatype for which tensor prepared

Definition at line 62 of file gst-plugins/gst-nvdspreprocess/include/nvdspreprocess_meta.h.

◆ gpu_id

guint NvDsPreProcessTensorMeta::gpu_id

gpu-id on which tensor prepared

Definition at line 68 of file gst-plugins/gst-nvdspreprocess/include/nvdspreprocess_meta.h.

◆ meta_id

guint NvDsPreProcessTensorMeta::meta_id

meta id for differentiating between multiple tensor meta from same gst buffer,for the case when sum of roi's exceeds the batch size

Definition at line 74 of file gst-plugins/gst-nvdspreprocess/include/nvdspreprocess_meta.h.

◆ private_data [1/2]

void * NvDsPreProcessTensorMeta::private_data

pointer to buffer from tensor pool

Definition at line 71 of file gst-plugins/gst-nvdspreprocess/include/nvdspreprocess_meta.h.

◆ private_data [2/2]

void * GstNvDsPreProcessBatchMeta::private_data

pointer to buffer from scaling pool

Definition at line 94 of file gst-plugins/gst-nvdspreprocess/include/nvdspreprocess_meta.h.

◆ raw_tensor_buffer

void * NvDsPreProcessTensorMeta::raw_tensor_buffer

raw tensor buffer preprocessed for infer

Definition at line 53 of file gst-plugins/gst-nvdspreprocess/include/nvdspreprocess_meta.h.

◆ roi_vector

std::vector< NvDsRoiMeta > GstNvDsPreProcessBatchMeta::roi_vector

list of roi vectors per batch

Definition at line 91 of file gst-plugins/gst-nvdspreprocess/include/nvdspreprocess_meta.h.

◆ target_unique_ids

std::vector< guint64 > GstNvDsPreProcessBatchMeta::target_unique_ids

target unique ids for which meta is prepared

Definition at line 85 of file gst-plugins/gst-nvdspreprocess/include/nvdspreprocess_meta.h.

◆ tensor_meta

NvDsPreProcessTensorMeta * GstNvDsPreProcessBatchMeta::tensor_meta

pointer to tensor meta

Definition at line 88 of file gst-plugins/gst-nvdspreprocess/include/nvdspreprocess_meta.h.

◆ tensor_name

std::string NvDsPreProcessTensorMeta::tensor_name

to be same as model input layer name

Definition at line 65 of file gst-plugins/gst-nvdspreprocess/include/nvdspreprocess_meta.h.

◆ tensor_shape

std::vector< int > NvDsPreProcessTensorMeta::tensor_shape

raw tensor buffer shape

Definition at line 59 of file gst-plugins/gst-nvdspreprocess/include/nvdspreprocess_meta.h.