|
NVIDIA DeepStream SDK API Reference
|
7.1 Release
|
Go to the documentation of this file.
13 #ifndef __NVDS_SEQUENCE_IMAGE_PREPROCESS_H__
14 #define __NVDS_SEQUENCE_IMAGE_PREPROCESS_H__
33 uint32_t channel,
cudaStream_t stream, uint32_t stride, uint32_t interval)
34 : _allocator(
allocator), _tensorParams(params), _seqStride(stride), _subsample(interval)
37 DSASSERT(shape.size() == 5 || shape.size() == 4);
38 if (shape.size() == 5) {
45 std::accumulate(shape.begin() + 1, shape.end(), 1, [](
int s,
int i) { return s * i; });
68 uint32_t perBatchBytes()
const {
return _perBatchSize *
sizeof(float); }
71 uint32_t HWbytes()
const {
return perBatchBytes() / _seqSize / _channels; }
73 uint32_t SHWbytes()
const {
return perBatchBytes() / _channels; }
77 if (_readyPendings.empty()) {
80 res = _readyPendings.front();
89 std::vector<std::unique_ptr<FullBatchBlock>> _accumulateBlocks;
91 std::queue<ReadyResult> _readyPendings;
92 uint32_t _maxBatch = 0;
93 uint32_t _seqSize = 0;
95 uint32_t _perBatchSize = 0;
126 std::unique_ptr<BufferManager> _bufManager;
134 Float4Vec _scales = {{1.0, 1.0, 1.0, 1.0}};
135 Float4Vec _means = {{0.0, 0.0, 0.0, 0.0}};
136 uint32_t _subsample = 0;
155 #endif // __NVDS_SEQUENCE_IMAGE_PREPROCESS_H__
NvDsPreProcessStatus locateRoiDst(const NvDsPreProcessUnit &roi, void *&dstPatch)
PROCESS_EXPORT_API NvDsPreProcessStatus CustomSequenceTensorPreparation(CustomCtx *ctx, NvDsPreProcessBatch *batch, NvDsPreProcessCustomBuf *&buf, CustomTensorParams &tensorParam, NvDsPreProcessAcquirer *allocator)
constexpr static uint32_t kDefaultStride
Custom Initialization parameter for custom library.
constexpr static uint32_t kDefaultChannel
NvDsPreProcessStatus buildRoiBlocks(const std::vector< NvDsPreProcessUnit > &rois)
NvDsPreProcessStatus deinit()
Holds information about the batch of frames to be inferred.
bool popReady(ReadyResult &res)
#define PROCESS_EXPORT_API
NvDsPreProcessStatus prepareTensorData(NvDsPreProcessBatch *batch, NvDsPreProcessCustomBuf *&buf, CustomTensorParams &tensorParam, NvDsPreProcessAcquirer *allocator)
NvDsPreProcessStatus preprocessData(const NvDsPreProcessUnit &unit, NvDsPreProcessFormat inFormat, void *outPtr)
NvDsPreProcessStatus
Enum for the status codes returned by NvDsPreProcessImpl.
NvDsPreProcessAcquirer * allocator() const
constexpr static uint32_t kDefaultSubSample
PROCESS_EXPORT_API CustomCtx * initLib(CustomInitParams initparams)
void setAllocator(NvDsPreProcessAcquirer *allocator)
A preprocess unit for processing which can be Frame/ROI.
Tensor params passed to custom library for tensor preparation.
NvDsPreProcessStatus init()
Custom Buffer passed to the custom lib for preparing tensor.
class for acquiring and releasing a buffer from tensor pool by custom lib.
std::vector< int > network_input_shape
Hold the network shape - interpreted based on network input order For resnet10 : NCHW = infer-batch-s...
PROCESS_EXPORT_API void deInitLib(CustomCtx *ctx)
Holds model parameters for tensor preparation.
BufferManager(NvDsPreProcessAcquirer *allocator, const NvDsPreProcessTensorParams ¶ms, uint32_t depth, uint32_t channel, cudaStream_t stream, uint32_t stride, uint32_t interval)
std::tuple< uint64_t, int64_t, int64_t > SourceKey
~SequenceImagePreprocess()
NvDsPreProcessStatus collectReady()
std::map< SourceKey, std::unique_ptr< RoiProcessedBuf > > SrcDestBufMap
SequenceImagePreprocess(const CustomInitParams &initParams)
struct CustomCtx CustomCtx
Context for custom library.
NvDsPreProcessFormat
Defines model color formats.