NVIDIA DeepStream SDK API Reference

8.0 Release
nvdsinferserver::NetworkPreprocessor Class Reference

Detailed Description

Preprocessor for scaling and normalization of the input and conversion to network media format.

Definition at line 51 of file sources/libs/nvdsinferserver/infer_preprocess.h.

Inheritance diagram for nvdsinferserver::NetworkPreprocessor:
Collaboration diagram for nvdsinferserver::NetworkPreprocessor:

Public Types

using PreprocessDone = std::function< void(NvDsInferStatus, SharedBatchArray)>
 
using PreprocessDone = std::function< void(NvDsInferStatus, SharedBatchArray)>
 

Public Member Functions

 NetworkPreprocessor (const NvDsInferNetworkInfo &info, InferMediaFormat networkFormat, InferDataType dt, int maxBatchSize)
 
virtual ~NetworkPreprocessor ()=default
 
bool setScaleOffsets (float scale, const std::vector< float > &offsets={})
 
bool setMeanFile (const std::string &file)
 
void setNetworkTensorOrder (InferTensorOrder order)
 
void setPoolSize (int size)
 
int poolSize () const
 
void setNetworkTensorName (std::string name)
 
const BatchSurfaceInfogetDstSurfaceInfo () const
 
NvDsInferStatus allocateResource (const std::vector< int > &devIds) override
 
NvDsInferStatus syncStream ()
 
 NetworkPreprocessor (const NvDsInferNetworkInfo &info, InferMediaFormat networkFormat, InferDataType dt, int maxBatchSize)
 
virtual ~NetworkPreprocessor ()=default
 
bool setScaleOffsets (float scale, const std::vector< float > &offsets={})
 
bool setMeanFile (const std::string &file)
 
void setNetworkTensorOrder (InferTensorOrder order)
 
void setPoolSize (int size)
 
int poolSize () const
 
void setNetworkTensorName (std::string name)
 
const BatchSurfaceInfogetDstSurfaceInfo () const
 
NvDsInferStatus allocateResource (const std::vector< int > &devIds) override
 
NvDsInferStatus syncStream ()
 
NvDsInferStatus transform (SharedBatchArray src, SharedCuStream mainStream, PreprocessDone done) override
 Perform the transformation on the input buffer from the buffer array, indexed using m_TransformIdx. More...
 
NvDsInferStatus transform (SharedBatchArray src, SharedCuStream mainStream, PreprocessDone done) override
 Perform the transformation on the input buffer from the buffer array, indexed using m_TransformIdx. More...
 
void setUniqueId (int id)
 
int uniqueId () const
 
void setTransformIdx (int idx)
 
void setUniqueId (int id)
 
int uniqueId () const
 
void setTransformIdx (int idx)
 
void setUniqueId (int id)
 
int uniqueId () const
 
void setTransformIdx (int idx)
 
void setUniqueId (int id)
 
int uniqueId () const
 
void setTransformIdx (int idx)
 
void setUniqueId (int id)
 
int uniqueId () const
 
void setTransformIdx (int idx)
 
void setUniqueId (int id)
 
int uniqueId () const
 
void setTransformIdx (int idx)
 

Protected Member Functions

NvDsInferStatus readMeanImageFile ()
 
 DISABLE_CLASS_COPY (NetworkPreprocessor)
 
NvDsInferStatus readMeanImageFile ()
 
 DISABLE_CLASS_COPY (NetworkPreprocessor)
 

Member Typedef Documentation

◆ PreprocessDone [1/2]

◆ PreprocessDone [2/2]

Constructor & Destructor Documentation

◆ NetworkPreprocessor() [1/2]

nvdsinferserver::NetworkPreprocessor::NetworkPreprocessor ( const NvDsInferNetworkInfo info,
InferMediaFormat  networkFormat,
InferDataType  dt,
int  maxBatchSize 
)

◆ ~NetworkPreprocessor() [1/2]

virtual nvdsinferserver::NetworkPreprocessor::~NetworkPreprocessor ( )
virtualdefault

◆ NetworkPreprocessor() [2/2]

nvdsinferserver::NetworkPreprocessor::NetworkPreprocessor ( const NvDsInferNetworkInfo info,
InferMediaFormat  networkFormat,
InferDataType  dt,
int  maxBatchSize 
)

◆ ~NetworkPreprocessor() [2/2]

virtual nvdsinferserver::NetworkPreprocessor::~NetworkPreprocessor ( )
virtualdefault

Member Function Documentation

◆ allocateResource() [1/2]

NvDsInferStatus nvdsinferserver::NetworkPreprocessor::allocateResource ( const std::vector< int > &  devIds)
overridevirtual

◆ allocateResource() [2/2]

NvDsInferStatus nvdsinferserver::NetworkPreprocessor::allocateResource ( const std::vector< int > &  devIds)
overridevirtual

◆ DISABLE_CLASS_COPY() [1/2]

nvdsinferserver::NetworkPreprocessor::DISABLE_CLASS_COPY ( NetworkPreprocessor  )
protected

◆ DISABLE_CLASS_COPY() [2/2]

nvdsinferserver::NetworkPreprocessor::DISABLE_CLASS_COPY ( NetworkPreprocessor  )
protected

◆ getDstSurfaceInfo() [1/2]

const BatchSurfaceInfo& nvdsinferserver::NetworkPreprocessor::getDstSurfaceInfo ( ) const
inline

◆ getDstSurfaceInfo() [2/2]

const BatchSurfaceInfo& nvdsinferserver::NetworkPreprocessor::getDstSurfaceInfo ( ) const
inline

◆ poolSize() [1/2]

int nvdsinferserver::NetworkPreprocessor::poolSize ( ) const
inline

◆ poolSize() [2/2]

int nvdsinferserver::NetworkPreprocessor::poolSize ( ) const
inline

◆ readMeanImageFile() [1/2]

NvDsInferStatus nvdsinferserver::NetworkPreprocessor::readMeanImageFile ( )
protected

◆ readMeanImageFile() [2/2]

NvDsInferStatus nvdsinferserver::NetworkPreprocessor::readMeanImageFile ( )
protected

◆ setMeanFile() [1/2]

bool nvdsinferserver::NetworkPreprocessor::setMeanFile ( const std::string &  file)

◆ setMeanFile() [2/2]

bool nvdsinferserver::NetworkPreprocessor::setMeanFile ( const std::string &  file)

◆ setNetworkTensorName() [1/2]

void nvdsinferserver::NetworkPreprocessor::setNetworkTensorName ( std::string  name)
inline

◆ setNetworkTensorName() [2/2]

void nvdsinferserver::NetworkPreprocessor::setNetworkTensorName ( std::string  name)
inline

◆ setNetworkTensorOrder() [1/2]

void nvdsinferserver::NetworkPreprocessor::setNetworkTensorOrder ( InferTensorOrder  order)
inline

◆ setNetworkTensorOrder() [2/2]

void nvdsinferserver::NetworkPreprocessor::setNetworkTensorOrder ( InferTensorOrder  order)
inline

◆ setPoolSize() [1/2]

void nvdsinferserver::NetworkPreprocessor::setPoolSize ( int  size)
inline

◆ setPoolSize() [2/2]

void nvdsinferserver::NetworkPreprocessor::setPoolSize ( int  size)
inline

◆ setScaleOffsets() [1/2]

bool nvdsinferserver::NetworkPreprocessor::setScaleOffsets ( float  scale,
const std::vector< float > &  offsets = {} 
)

◆ setScaleOffsets() [2/2]

bool nvdsinferserver::NetworkPreprocessor::setScaleOffsets ( float  scale,
const std::vector< float > &  offsets = {} 
)

◆ setTransformIdx() [1/2]

void nvdsinferserver::BasePreprocessor::setTransformIdx ( int  idx)
inlineinherited

◆ setTransformIdx() [2/2]

void nvdsinferserver::BasePreprocessor::setTransformIdx ( int  idx)
inlineinherited

◆ setUniqueId() [1/2]

void nvdsinferserver::BasePreprocessor::setUniqueId ( int  id)
inlineinherited

◆ setUniqueId() [2/2]

void nvdsinferserver::BasePreprocessor::setUniqueId ( int  id)
inlineinherited

◆ syncStream() [1/2]

NvDsInferStatus nvdsinferserver::NetworkPreprocessor::syncStream ( )

◆ syncStream() [2/2]

NvDsInferStatus nvdsinferserver::NetworkPreprocessor::syncStream ( )

◆ transform() [1/2]

NvDsInferStatus nvdsinferserver::BasePreprocessor::transform ( SharedBatchArray  src,
SharedCuStream  mainStream,
PreprocessDone  done 
)
inlineoverridevirtualinherited

Perform the transformation on the input buffer from the buffer array, indexed using m_TransformIdx.

Parameters
[in]srcThe input batch buffer array.
[in]mainStreamThe main processing CUDA stream.
[in]doneThe call function to be called after transformation.
Returns
NVDSINFER_SUCCESS or NVDSINFER_RESOURCE_ERROR.

Implements nvdsinferserver::IPreprocessor.

Definition at line 103 of file 9.0/sources/libs/nvdsinferserver/infer_iprocess.h.

References NVDSINFER_RESOURCE_ERROR, and NVDSINFER_SUCCESS.

◆ transform() [2/2]

NvDsInferStatus nvdsinferserver::BasePreprocessor::transform ( SharedBatchArray  src,
SharedCuStream  mainStream,
PreprocessDone  done 
)
inlineoverridevirtualinherited

Perform the transformation on the input buffer from the buffer array, indexed using m_TransformIdx.

Parameters
[in]srcThe input batch buffer array.
[in]mainStreamThe main processing CUDA stream.
[in]doneThe call function to be called after transformation.
Returns
NVDSINFER_SUCCESS or NVDSINFER_RESOURCE_ERROR.

Implements nvdsinferserver::IPreprocessor.

Definition at line 103 of file sources/libs/nvdsinferserver/infer_iprocess.h.

References NVDSINFER_RESOURCE_ERROR, and NVDSINFER_SUCCESS.

◆ uniqueId() [1/2]

int nvdsinferserver::BasePreprocessor::uniqueId ( ) const
inlineinherited

◆ uniqueId() [2/2]

int nvdsinferserver::BasePreprocessor::uniqueId ( ) const
inlineinherited

The documentation for this class was generated from the following file: