NVIDIA DeepStream SDK API Reference

6.4 Release
nvdsinferserver::Postprocessor Class Referenceabstract

Detailed Description

A generic post processor class.

Definition at line 54 of file 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 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
 
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...
 

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)
 

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

Definition at line 57 of file infer_postprocess.h.

◆ PostprocessDone

Definition at line 62 of file infer_iprocess.h.

◆ TensorAllocator

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

Definition at line 56 of file infer_postprocess.h.

Constructor & Destructor Documentation

◆ Postprocessor()

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

Definition at line 60 of file infer_postprocess.h.

◆ ~Postprocessor()

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

Member Function Documentation

◆ allocateResource()

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

◆ getLabels()

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

Definition at line 74 of file infer_postprocess.h.

References m_Labels.

◆ needInputCopy()

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

Definition at line 82 of file infer_postprocess.h.

References m_CopyInputToHostBuffers.

◆ networkType()

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

Definition at line 180 of file infer_iprocess.h.

◆ parseLabelsFile()

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

◆ postCudaImpl()

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

◆ postCudaProcess()

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

◆ postHostImpl()

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

◆ postHostProcess()

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

◆ requestCudaOutBufs()

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

◆ requestHostOutBufs()

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

◆ setAllocator()

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

Definition at line 77 of file infer_postprocess.h.

References m_CpuAllocator, and m_EventAllocator.

◆ setDllHandle()

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

Definition at line 65 of file infer_postprocess.h.

References m_CustomLibHandle.

◆ setInputCopy()

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

Definition at line 73 of file infer_postprocess.h.

References m_CopyInputToHostBuffers.

◆ setLabelPath()

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

Definition at line 68 of file infer_postprocess.h.

References m_LabelPath.

◆ setNetworkInfo()

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

Definition at line 69 of file infer_postprocess.h.

References m_NetworkInfo.

◆ setOutputLayerCount()

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

Definition at line 72 of file infer_postprocess.h.

References m_OutputLayerCount.

◆ setUniqueId()

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

Definition at line 178 of file infer_iprocess.h.

◆ uniqueId()

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

Definition at line 179 of file infer_iprocess.h.

Field Documentation

◆ m_CopyInputToHostBuffers

bool nvdsinferserver::Postprocessor::m_CopyInputToHostBuffers = false
protected

Definition at line 112 of file infer_postprocess.h.

Referenced by needInputCopy(), and setInputCopy().

◆ m_CpuAllocator

TensorAllocator nvdsinferserver::Postprocessor::m_CpuAllocator
protected

Definition at line 121 of file infer_postprocess.h.

Referenced by setAllocator().

◆ m_CustomLibHandle

SharedDllHandle nvdsinferserver::Postprocessor::m_CustomLibHandle
protected

Custom library implementation.

Definition at line 111 of file infer_postprocess.h.

Referenced by setDllHandle().

◆ m_EventAllocator

EventAllocator nvdsinferserver::Postprocessor::m_EventAllocator
protected

Definition at line 122 of file infer_postprocess.h.

Referenced by setAllocator().

◆ m_LabelPath

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

Definition at line 116 of file 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 infer_postprocess.h.

Referenced by getLabels().

◆ m_NetworkInfo

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

Network input information.

Definition at line 114 of file infer_postprocess.h.

Referenced by setNetworkInfo().

◆ m_OutputLayerCount

uint32_t nvdsinferserver::Postprocessor::m_OutputLayerCount = 0
protected

Definition at line 115 of file infer_postprocess.h.

Referenced by setOutputLayerCount().


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