NVIDIA DeepStream SDK API Reference

6.4 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 infer_preprocess.h.

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

Public Types

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 ()
 
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)
 

Protected Member Functions

NvDsInferStatus readMeanImageFile ()
 
 DISABLE_CLASS_COPY (NetworkPreprocessor)
 

Member Typedef Documentation

◆ PreprocessDone

Definition at line 44 of file infer_iprocess.h.

Constructor & Destructor Documentation

◆ NetworkPreprocessor()

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

◆ ~NetworkPreprocessor()

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

Member Function Documentation

◆ allocateResource()

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

◆ DISABLE_CLASS_COPY()

nvdsinferserver::NetworkPreprocessor::DISABLE_CLASS_COPY ( NetworkPreprocessor  )
protected

◆ getDstSurfaceInfo()

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

Definition at line 65 of file infer_preprocess.h.

◆ poolSize()

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

Definition at line 63 of file infer_preprocess.h.

◆ readMeanImageFile()

NvDsInferStatus nvdsinferserver::NetworkPreprocessor::readMeanImageFile ( )
protected

◆ setMeanFile()

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

◆ setNetworkTensorName()

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

Definition at line 64 of file infer_preprocess.h.

◆ setNetworkTensorOrder()

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

Definition at line 59 of file infer_preprocess.h.

◆ setPoolSize()

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

Definition at line 62 of file infer_preprocess.h.

◆ setScaleOffsets()

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

◆ setTransformIdx()

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

Definition at line 92 of file infer_iprocess.h.

◆ setUniqueId()

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

Definition at line 90 of file infer_iprocess.h.

◆ syncStream()

NvDsInferStatus nvdsinferserver::NetworkPreprocessor::syncStream ( )

◆ transform()

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 infer_iprocess.h.

References NVDSINFER_RESOURCE_ERROR, and NVDSINFER_SUCCESS.

◆ uniqueId()

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

Definition at line 91 of file infer_iprocess.h.


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