|
|
NVIDIA DeepStream SDK API Reference
|
9.1 Release
|
Go to the documentation of this file.
27 #ifndef __NVDSINFERSERVER_PREPROCESS_H__
28 #define __NVDSINFERSERVER_PREPROCESS_H__
31 #include <condition_variable>
39 #include <cuda_runtime_api.h>
42 #include "infer_datatypes.h"
47 #include "nvbufsurface.h"
48 #include "nvbufsurftransform.h"
56 class NetworkPreprocessor :
public BasePreprocessor {
62 bool setScaleOffsets(
float scale,
const std::vector<float>& offsets = {});
65 m_NetworkTensorOrder = order;
95 std::vector<float> m_ChannelMeans;
96 std::string m_MeanFile;
98 std::string m_TensorName;
101 SharedBufPool<UniqCudaTensorBuf> m_BufPool;
102 int m_MaxBatchSize = 1;
108 std::unique_ptr<CudaStream> m_PreProcessStream;
109 std::unique_ptr<CudaDeviceMem> m_MeanDataBuffer;
118 class CropSurfaceConverter :
public BasePreprocessor {
121 : m_ConvertPoolSize(convertPoolSize) {}
128 m_ComputeHW = compute_hw;
135 NvDsInferStatus allocateResource(
const std::vector<int>& devIds)
override;
144 int32_t m_ConvertPoolSize = 4;
146 int32_t m_DstWidth = 0;
147 int32_t m_DstHeight = 0;
149 uint32_t m_MaxBatchSize = 0;
150 bool m_MaintainAspectRatio =
false;
151 bool m_SymmetricPadding =
false;
154 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.
InferMediaFormat
Image formats.
DISABLE_CLASS_COPY(NetworkPreprocessor)
Preprocessor for scaling and normalization of the input and conversion to network media format.
std::shared_ptr< BaseBatchBuffer > SharedBatchBuf
Common buffer interfaces (internal).
InferTensorOrder
The type of tensor order.
NvDsInferStatus syncStream()
void setPoolSize(int size)
void setNetworkTensorOrder(InferTensorOrder order)
const BatchSurfaceInfo & getDstSurfaceInfo() const
Header file declaring utility classes for CUDA memory management, CIDA streams and events.
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)
~CropSurfaceConverter() override
std::shared_ptr< CudaStream > SharedCuStream
Cuda based pointers.
Holds information about the model network.
bool setMeanFile(const std::string &file)
void setScalingFilter(NvBufSurfTransform_Inter filter)
Header file containing utility functions and classes used by the nvinferserver low level library.
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)
@ NvBufSurfTransformInter_Default
Specifies GPU-Nearest, VIC-Nearest interpolation.
Preprocessing and postprocessing interface header file.
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.