|
NVIDIA DeepStream SDK API Reference
|
7.1 Release
|
Go to the documentation of this file.
22 #ifndef __NVDSINFERSERVER_PREPROCESS_H__
23 #define __NVDSINFERSERVER_PREPROCESS_H__
26 #include <condition_variable>
34 #include <cuda_runtime_api.h>
57 bool setScaleOffsets(
float scale,
const std::vector<float>& offsets = {});
60 m_NetworkTensorOrder = order;
90 std::vector<float> m_ChannelMeans;
91 std::string m_MeanFile;
93 std::string m_TensorName;
96 SharedBufPool<UniqCudaTensorBuf> m_BufPool;
97 int m_MaxBatchSize = 1;
103 std::unique_ptr<CudaStream> m_PreProcessStream;
104 std::unique_ptr<CudaDeviceMem> m_MeanDataBuffer;
116 : m_ConvertPoolSize(convertPoolSize) {}
123 m_ComputeHW = compute_hw;
130 NvDsInferStatus allocateResource(
const std::vector<int>& devIds)
override;
139 int32_t m_ConvertPoolSize = 4;
141 int32_t m_DstWidth = 0;
142 int32_t m_DstHeight = 0;
144 uint32_t m_MaxBatchSize = 0;
145 bool m_MaintainAspectRatio =
false;
146 bool m_SymmetricPadding =
false;
149 SharedBufPool<std::unique_ptr<SurfaceBuffer>> m_ConvertPool;
This is a header file for pre-processing cuda kernels with normalization and mean subtraction require...
InferDataType
Datatype of the tensor buffer.
@ kLinear
NCHW (batch-channels-height-width) tensor order.
std::shared_ptr< BaseBatchBuffer > SharedBatchBuf
Common buffer interfaces (internal).
InferMediaFormat
Image formats.
DISABLE_CLASS_COPY(NetworkPreprocessor)
Header file for the data types used in the inference processing.
Preprocessor for scaling and normalization of the input and conversion to network media format.
InferTensorOrder
The type of tensor order.
NvDsInferStatus syncStream()
void setPoolSize(int size)
void setNetworkTensorOrder(InferTensorOrder order)
const BatchSurfaceInfo & getDstSurfaceInfo() const
Header file containing utility functions and classes used by the nvinferserver low level library.
NvBufSurfTransform_Compute
Specifies compute devices used by NvBufSurfTransform.
@ kRGB
24-bit interleaved R-G-B
virtual ~NetworkPreprocessor()=default
CropSurfaceConverter(int32_t convertPoolSize)
void setMaintainAspectRatio(bool enable)
Preprocessor for cropping, scaling and padding the inference input to required height,...
~CropSurfaceConverter() override
Holds information about the model network.
bool setMeanFile(const std::string &file)
Header file declaring utility classes for CUDA memory management, CIDA streams and events.
void setScalingFilter(NvBufSurfTransform_Inter filter)
std::shared_ptr< CudaStream > SharedCuStream
Cuda based pointers.
void setNetworkTensorName(std::string name)
@ NvBufSurfTransform_None
Specifies no video flip.
@ NvBufSurfTransformCompute_Default
Specifies VIC as a compute device for Jetson or dGPU for an x86_64 system.
void setSymmetricPadding(bool enable)
NvBufSurfTransform_Inter
Specifies video interpolation methods.
NvDsInferStatus allocateResource(const std::vector< int > &devIds) override
NvDsInferStatus readMeanImageFile()
void setParams(int outW, int outH, InferMediaFormat outFormat, int maxBatchSize)
Preprocessing and postprocessing interface header file.
@ NvBufSurfTransformInter_Default
Specifies GPU-Nearest, VIC-Nearest interpolation.
bool setScaleOffsets(float scale, const std::vector< float > &offsets={})
NetworkPreprocessor(const NvDsInferNetworkInfo &info, InferMediaFormat networkFormat, InferDataType dt, int maxBatchSize)
void setScalingHW(NvBufSurfTransform_Compute compute_hw)
NvDsInferStatus
Enum for the status codes returned by NvDsInferContext.