NVIDIA DeepStream SDK API Reference

6.4 Release
nvdsinferserver::SegmentPostprocessor Class Reference

Detailed Description

Post processor class for segmentation output.

Definition at line 238 of file infer_postprocess.h.

Inheritance diagram for nvdsinferserver::SegmentPostprocessor:
Collaboration diagram for nvdsinferserver::SegmentPostprocessor:

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

 SegmentPostprocessor (int uid, const ic::SegmentationParams &params)
 
NvDsInferStatus allocateResource (const std::vector< int > &devIds) override
 
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
 
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

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

Definition at line 56 of file infer_postprocess.h.

Constructor & Destructor Documentation

◆ SegmentPostprocessor()

nvdsinferserver::SegmentPostprocessor::SegmentPostprocessor ( int  uid,
const ic::SegmentationParams &  params 
)

Member Function Documentation

◆ allocateResource()

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

Reimplemented from nvdsinferserver::Postprocessor.

◆ getLabels()

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

Definition at line 74 of file infer_postprocess.h.

References nvdsinferserver::Postprocessor::m_Labels.

◆ needInputCopy()

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

◆ 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)
protectedinherited

◆ postCudaImpl()

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

◆ 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 
)
overrideprotectedvirtualinherited

◆ 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)
overrideprotectedvirtualinherited

◆ requestHostOutBufs()

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

◆ setAllocator()

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

◆ setDllHandle()

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

◆ setInputCopy()

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

◆ setLabelPath()

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

Definition at line 68 of file infer_postprocess.h.

References nvdsinferserver::Postprocessor::m_LabelPath.

◆ setNetworkInfo()

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

Definition at line 69 of file infer_postprocess.h.

References nvdsinferserver::Postprocessor::m_NetworkInfo.

◆ setOutputLayerCount()

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

◆ 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
protectedinherited

◆ m_CpuAllocator

TensorAllocator nvdsinferserver::Postprocessor::m_CpuAllocator
protectedinherited

Definition at line 121 of file infer_postprocess.h.

Referenced by nvdsinferserver::Postprocessor::setAllocator().

◆ m_CustomLibHandle

SharedDllHandle nvdsinferserver::Postprocessor::m_CustomLibHandle
protectedinherited

Custom library implementation.

Definition at line 111 of file infer_postprocess.h.

Referenced by nvdsinferserver::Postprocessor::setDllHandle().

◆ m_EventAllocator

EventAllocator nvdsinferserver::Postprocessor::m_EventAllocator
protectedinherited

Definition at line 122 of file infer_postprocess.h.

Referenced by nvdsinferserver::Postprocessor::setAllocator().

◆ m_LabelPath

std::string nvdsinferserver::Postprocessor::m_LabelPath
protectedinherited

Definition at line 116 of file infer_postprocess.h.

Referenced by nvdsinferserver::Postprocessor::setLabelPath().

◆ m_Labels

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

Holds the string labels for classes.

Definition at line 119 of file infer_postprocess.h.

Referenced by nvdsinferserver::Postprocessor::getLabels().

◆ m_NetworkInfo

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

Network input information.

Definition at line 114 of file infer_postprocess.h.

Referenced by nvdsinferserver::Postprocessor::setNetworkInfo().

◆ m_OutputLayerCount

uint32_t nvdsinferserver::Postprocessor::m_OutputLayerCount = 0
protectedinherited

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