NVIDIA DeepStream SDK API Reference

8.0 Release
nvdsinferserver::Postprocessor Class Referenceabstract

Detailed Description

A generic post processor class.

Definition at line 54 of file sources/libs/nvdsinferserver/infer_postprocess.h.

Inheritance diagram for nvdsinferserver::Postprocessor:
Collaboration diagram for nvdsinferserver::Postprocessor:

Public Types

using TensorAllocator = std::function< SharedSysMem(const std::string &name, size_t bytes)>
 
using EventAllocator = std::function< SharedCuEvent()>
 
using TensorAllocator = std::function< SharedSysMem(const std::string &name, size_t bytes)>
 
using EventAllocator = std::function< SharedCuEvent()>
 
using PostprocessDone = std::function< void(NvDsInferStatus, SharedBatchArray)>
 
using PostprocessDone = std::function< void(NvDsInferStatus, SharedBatchArray)>
 

Public Member Functions

virtual ~Postprocessor ()=default
 
void setDllHandle (const SharedDllHandle &dlHandle)
 
void setLabelPath (const std::string &path)
 
void setNetworkInfo (const NvDsInferNetworkInfo &info)
 
void setOutputLayerCount (uint32_t num)
 
void setInputCopy (bool enable)
 
const std::vector< std::vector< std::string > > & getLabels () const
 
void setAllocator (TensorAllocator cpuAlloc, EventAllocator event)
 
bool needInputCopy () const
 
virtual NvDsInferStatus allocateResource (const std::vector< int > &devIds) override
 
virtual ~Postprocessor ()=default
 
void setDllHandle (const SharedDllHandle &dlHandle)
 
void setLabelPath (const std::string &path)
 
void setNetworkInfo (const NvDsInferNetworkInfo &info)
 
void setOutputLayerCount (uint32_t num)
 
void setInputCopy (bool enable)
 
const std::vector< std::vector< std::string > > & getLabels () const
 
void setAllocator (TensorAllocator cpuAlloc, EventAllocator event)
 
bool needInputCopy () const
 
virtual NvDsInferStatus allocateResource (const std::vector< int > &devIds) override
 
NvDsInferStatus postCudaProcess (SharedBatchArray inBuf, SharedCuStream mainStream, PostprocessDone done) override
 Acquire an output buffer array and call CUDA post processing steps. More...
 
NvDsInferStatus postCudaProcess (SharedBatchArray inBuf, SharedCuStream mainStream, PostprocessDone done) override
 Acquire an output buffer array and call CUDA post processing steps. More...
 
NvDsInferStatus postHostProcess (SharedBatchArray inBuf, SharedCuStream mainStream, PostprocessDone done) override
 Acquire an output buffer array and call host side processing steps. More...
 
NvDsInferStatus postHostProcess (SharedBatchArray inBuf, SharedCuStream mainStream, PostprocessDone done) override
 Acquire an output buffer array and call host side processing steps. More...
 

Protected Member Functions

 Postprocessor (InferPostprocessType type, int id)
 
NvDsInferStatus postCudaImpl (SharedBatchArray &inBuf, SharedBatchArray &outbuf, SharedCuStream &mainStream) override
 
NvDsInferStatus postHostImpl (SharedBatchArray &inBuf, SharedBatchArray &outbuf, SharedCuStream &mainStream) override
 
SharedBatchArray requestCudaOutBufs (const SharedBatchArray &inBuf) override
 
SharedBatchArray requestHostOutBufs (const SharedBatchArray &inBuf) override
 
NvDsInferStatus parseLabelsFile (const std::string &path)
 
 Postprocessor (InferPostprocessType type, int id)
 
NvDsInferStatus postCudaImpl (SharedBatchArray &inBuf, SharedBatchArray &outbuf, SharedCuStream &mainStream) override
 
NvDsInferStatus postHostImpl (SharedBatchArray &inBuf, SharedBatchArray &outbuf, SharedCuStream &mainStream) override
 
SharedBatchArray requestCudaOutBufs (const SharedBatchArray &inBuf) override
 
SharedBatchArray requestHostOutBufs (const SharedBatchArray &inBuf) override
 
NvDsInferStatus parseLabelsFile (const std::string &path)
 

Protected Attributes

SharedDllHandle m_CustomLibHandle
 Custom library implementation. More...
 
bool m_CopyInputToHostBuffers = false
 
NvDsInferNetworkInfo m_NetworkInfo = {0}
 Network input information. More...
 
uint32_t m_OutputLayerCount = 0
 
std::string m_LabelPath
 
std::vector< std::vector< std::string > > m_Labels
 Holds the string labels for classes. More...
 
TensorAllocator m_CpuAllocator
 
EventAllocator m_EventAllocator
 

Member Typedef Documentation

◆ EventAllocator [1/2]

◆ EventAllocator [2/2]

◆ PostprocessDone [1/2]

◆ PostprocessDone [2/2]

◆ TensorAllocator [1/2]

using nvdsinferserver::Postprocessor::TensorAllocator = std::function<SharedSysMem(const std::string& name, size_t bytes)>

◆ TensorAllocator [2/2]

using nvdsinferserver::Postprocessor::TensorAllocator = std::function<SharedSysMem(const std::string& name, size_t bytes)>

Constructor & Destructor Documentation

◆ Postprocessor() [1/2]

nvdsinferserver::Postprocessor::Postprocessor ( InferPostprocessType  type,
int  id 
)
inlineprotected

◆ ~Postprocessor() [1/2]

virtual nvdsinferserver::Postprocessor::~Postprocessor ( )
virtualdefault

◆ Postprocessor() [2/2]

nvdsinferserver::Postprocessor::Postprocessor ( InferPostprocessType  type,
int  id 
)
inlineprotected

◆ ~Postprocessor() [2/2]

virtual nvdsinferserver::Postprocessor::~Postprocessor ( )
virtualdefault

Member Function Documentation

◆ allocateResource() [1/2]

◆ allocateResource() [2/2]

◆ getLabels() [1/2]

const std::vector<std::vector<std::string> >& nvdsinferserver::Postprocessor::getLabels ( ) const
inline

Definition at line 74 of file sources/libs/nvdsinferserver/infer_postprocess.h.

References m_Labels.

◆ getLabels() [2/2]

const std::vector<std::vector<std::string> >& nvdsinferserver::Postprocessor::getLabels ( ) const
inline

Definition at line 74 of file 9.0/sources/libs/nvdsinferserver/infer_postprocess.h.

References m_Labels.

◆ needInputCopy() [1/2]

bool nvdsinferserver::Postprocessor::needInputCopy ( ) const
inline

◆ needInputCopy() [2/2]

bool nvdsinferserver::Postprocessor::needInputCopy ( ) const
inline

◆ networkType() [1/2]

InferPostprocessType nvdsinferserver::BasePostprocessor::networkType ( ) const
inlineinherited

◆ networkType() [2/2]

InferPostprocessType nvdsinferserver::BasePostprocessor::networkType ( ) const
inlineinherited

◆ parseLabelsFile() [1/2]

NvDsInferStatus nvdsinferserver::Postprocessor::parseLabelsFile ( const std::string &  path)
protected

◆ parseLabelsFile() [2/2]

NvDsInferStatus nvdsinferserver::Postprocessor::parseLabelsFile ( const std::string &  path)
protected

◆ postCudaImpl() [1/2]

NvDsInferStatus nvdsinferserver::Postprocessor::postCudaImpl ( SharedBatchArray inBuf,
SharedBatchArray outbuf,
SharedCuStream mainStream 
)
overrideprotectedvirtual

◆ postCudaImpl() [2/2]

NvDsInferStatus nvdsinferserver::Postprocessor::postCudaImpl ( SharedBatchArray inBuf,
SharedBatchArray outbuf,
SharedCuStream mainStream 
)
overrideprotectedvirtual

◆ postCudaProcess() [1/2]

NvDsInferStatus nvdsinferserver::BasePostprocessor::postCudaProcess ( SharedBatchArray  inBuf,
SharedCuStream  mainStream,
PostprocessDone  done 
)
inlineoverridevirtualinherited

Acquire an output buffer array and call CUDA post processing steps.

Parameters
[in]inBufPointer to the input batch array.
[in]mainStreamThe main CUDA stream to synchronize with.
[in]doneCallback function to be executed.
Returns
Error status.

Implements nvdsinferserver::IPostprocessor.

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

◆ postCudaProcess() [2/2]

NvDsInferStatus nvdsinferserver::BasePostprocessor::postCudaProcess ( SharedBatchArray  inBuf,
SharedCuStream  mainStream,
PostprocessDone  done 
)
inlineoverridevirtualinherited

Acquire an output buffer array and call CUDA post processing steps.

Parameters
[in]inBufPointer to the input batch array.
[in]mainStreamThe main CUDA stream to synchronize with.
[in]doneCallback function to be executed.
Returns
Error status.

Implements nvdsinferserver::IPostprocessor.

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

◆ postHostImpl() [1/2]

NvDsInferStatus nvdsinferserver::Postprocessor::postHostImpl ( SharedBatchArray inBuf,
SharedBatchArray outbuf,
SharedCuStream mainStream 
)
overrideprotectedvirtual

◆ postHostImpl() [2/2]

NvDsInferStatus nvdsinferserver::Postprocessor::postHostImpl ( SharedBatchArray inBuf,
SharedBatchArray outbuf,
SharedCuStream mainStream 
)
overrideprotectedvirtual

◆ postHostProcess() [1/2]

NvDsInferStatus nvdsinferserver::BasePostprocessor::postHostProcess ( SharedBatchArray  inBuf,
SharedCuStream  mainStream,
PostprocessDone  done 
)
inlineoverridevirtualinherited

Acquire an output buffer array and call host side processing steps.

Parameters
[in]inBufPointer to the input batch array.
[in]mainStreamThe main CUDA stream to synchronize with.
[in]doneCallback function to be executed.
Returns
Error status.

Implements nvdsinferserver::IPostprocessor.

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

◆ postHostProcess() [2/2]

NvDsInferStatus nvdsinferserver::BasePostprocessor::postHostProcess ( SharedBatchArray  inBuf,
SharedCuStream  mainStream,
PostprocessDone  done 
)
inlineoverridevirtualinherited

Acquire an output buffer array and call host side processing steps.

Parameters
[in]inBufPointer to the input batch array.
[in]mainStreamThe main CUDA stream to synchronize with.
[in]doneCallback function to be executed.
Returns
Error status.

Implements nvdsinferserver::IPostprocessor.

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

◆ requestCudaOutBufs() [1/2]

SharedBatchArray nvdsinferserver::Postprocessor::requestCudaOutBufs ( const SharedBatchArray inBuf)
overrideprotectedvirtual

◆ requestCudaOutBufs() [2/2]

SharedBatchArray nvdsinferserver::Postprocessor::requestCudaOutBufs ( const SharedBatchArray inBuf)
overrideprotectedvirtual

◆ requestHostOutBufs() [1/2]

SharedBatchArray nvdsinferserver::Postprocessor::requestHostOutBufs ( const SharedBatchArray inBuf)
overrideprotectedvirtual

◆ requestHostOutBufs() [2/2]

SharedBatchArray nvdsinferserver::Postprocessor::requestHostOutBufs ( const SharedBatchArray inBuf)
overrideprotectedvirtual

◆ setAllocator() [1/2]

void nvdsinferserver::Postprocessor::setAllocator ( TensorAllocator  cpuAlloc,
EventAllocator  event 
)
inline

◆ setAllocator() [2/2]

void nvdsinferserver::Postprocessor::setAllocator ( TensorAllocator  cpuAlloc,
EventAllocator  event 
)
inline

◆ setDllHandle() [1/2]

void nvdsinferserver::Postprocessor::setDllHandle ( const SharedDllHandle dlHandle)
inline

◆ setDllHandle() [2/2]

void nvdsinferserver::Postprocessor::setDllHandle ( const SharedDllHandle dlHandle)
inline

◆ setInputCopy() [1/2]

void nvdsinferserver::Postprocessor::setInputCopy ( bool  enable)
inline

◆ setInputCopy() [2/2]

void nvdsinferserver::Postprocessor::setInputCopy ( bool  enable)
inline

◆ setLabelPath() [1/2]

void nvdsinferserver::Postprocessor::setLabelPath ( const std::string &  path)
inline

Definition at line 68 of file 9.0/sources/libs/nvdsinferserver/infer_postprocess.h.

References m_LabelPath.

◆ setLabelPath() [2/2]

void nvdsinferserver::Postprocessor::setLabelPath ( const std::string &  path)
inline

Definition at line 68 of file sources/libs/nvdsinferserver/infer_postprocess.h.

References m_LabelPath.

◆ setNetworkInfo() [1/2]

void nvdsinferserver::Postprocessor::setNetworkInfo ( const NvDsInferNetworkInfo info)
inline

◆ setNetworkInfo() [2/2]

void nvdsinferserver::Postprocessor::setNetworkInfo ( const NvDsInferNetworkInfo info)
inline

Definition at line 69 of file sources/libs/nvdsinferserver/infer_postprocess.h.

References m_NetworkInfo.

◆ setOutputLayerCount() [1/2]

void nvdsinferserver::Postprocessor::setOutputLayerCount ( uint32_t  num)
inline

◆ setOutputLayerCount() [2/2]

void nvdsinferserver::Postprocessor::setOutputLayerCount ( uint32_t  num)
inline

◆ setUniqueId() [1/2]

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

◆ setUniqueId() [2/2]

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

◆ uniqueId() [1/2]

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

◆ uniqueId() [2/2]

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

Field Documentation

◆ m_CopyInputToHostBuffers

bool nvdsinferserver::Postprocessor::m_CopyInputToHostBuffers = false
protected

◆ m_CpuAllocator

TensorAllocator nvdsinferserver::Postprocessor::m_CpuAllocator
protected

Definition at line 121 of file sources/libs/nvdsinferserver/infer_postprocess.h.

Referenced by setAllocator().

◆ m_CustomLibHandle

SharedDllHandle nvdsinferserver::Postprocessor::m_CustomLibHandle
protected

Custom library implementation.

Definition at line 111 of file sources/libs/nvdsinferserver/infer_postprocess.h.

Referenced by setDllHandle().

◆ m_EventAllocator

EventAllocator nvdsinferserver::Postprocessor::m_EventAllocator
protected

Definition at line 122 of file sources/libs/nvdsinferserver/infer_postprocess.h.

Referenced by setAllocator().

◆ m_LabelPath

std::string nvdsinferserver::Postprocessor::m_LabelPath
protected

Definition at line 116 of file sources/libs/nvdsinferserver/infer_postprocess.h.

Referenced by setLabelPath().

◆ m_Labels

std::vector< std::vector< std::string > > nvdsinferserver::Postprocessor::m_Labels
protected

Holds the string labels for classes.

Definition at line 119 of file sources/libs/nvdsinferserver/infer_postprocess.h.

Referenced by getLabels().

◆ m_NetworkInfo

NvDsInferNetworkInfo nvdsinferserver::Postprocessor::m_NetworkInfo = {0}
protected

Network input information.

Definition at line 114 of file sources/libs/nvdsinferserver/infer_postprocess.h.

Referenced by setNetworkInfo().

◆ m_OutputLayerCount

uint32_t nvdsinferserver::Postprocessor::m_OutputLayerCount = 0
protected

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