NVIDIA DeepStream SDK API Reference

9.1 Release
9.1/sources/includes/nvdsinferserver/infer_custom_process.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef __NVDSINFERSERVER_CUSTOM_PROCESSOR_H__
19 #define __NVDSINFERSERVER_CUSTOM_PROCESSOR_H__
20 
21 #include <infer_datatypes.h>
22 
23 #include <condition_variable>
24 #include <functional>
25 #include <list>
26 #include <memory>
27 #include <queue>
28 
29 namespace nvdsinferserver {
30 
39 class IInferCustomProcessor {
40 public:
43  virtual ~IInferCustomProcessor() = default;
44 
52  virtual void supportInputMemType(InferMemType& type) { type = InferMemType::kCpu; }
53 
62  virtual bool requireInferLoop() const { return false; }
63 
80  const std::vector<IBatchBuffer*>& primaryInputs, std::vector<IBatchBuffer*>& extraInputs,
81  const IOptions* options) = 0;
82 
97  const IBatchArray* outputs, const IOptions* inOptions) = 0;
98 
104  virtual void notifyError(NvDsInferStatus status) = 0;
105 };
106 
107 } // namespace nvdsinferserver
108 
109 extern "C" {
110 
118 typedef nvdsinferserver::IInferCustomProcessor* (*CreateCustomProcessorFunc)(
119  const char* config, uint32_t configLen);
120 }
121 
122 #endif
nvdsinferserver::IInferCustomProcessor
Interface of Custom processor which is created and loaded at runtime through CreateCustomProcessorFun...
Definition: sources/includes/nvdsinferserver/infer_custom_process.h:39
nvdsinferserver
This is a header file for pre-processing cuda kernels with normalization and mean subtraction require...
Definition: sources/gst-plugins/gst-nvinferserver/gstnvinferserver_impl.h:69
nvdsinferserver::IInferCustomProcessor::inferenceDone
virtual NvDsInferStatus inferenceDone(const IBatchArray *outputs, const IOptions *inOptions)=0
Inference done callback for custom postpocessing.
nvdsinferserver::IInferCustomProcessor::requireInferLoop
virtual bool requireInferLoop() const
Indicate whether this custom processor requires inference loop, in which nvdsinferserver lib guarante...
Definition: 9.1/sources/includes/nvdsinferserver/infer_custom_process.h:62
nvdsinferserver::IInferCustomProcessor::notifyError
virtual void notifyError(NvDsInferStatus status)=0
Notification of an error to the interface implementation.
nvdsinferserver::IInferCustomProcessor::supportInputMemType
virtual void supportInputMemType(InferMemType &type)
Query the memory type, extraInputProcess() implementation supports.
Definition: 9.1/sources/includes/nvdsinferserver/infer_custom_process.h:52
infer_datatypes.h
Header file for the data types used in the inference processing.
nvdsinferserver::IOptions
Definition: sources/includes/nvdsinferserver/infer_ioptions.h:59
nvdsinferserver::InferMemType
InferMemType
The memory types of inference buffers.
Definition: sources/includes/nvdsinferserver/infer_datatypes.h:61
nvdsinferserver::IInferCustomProcessor::~IInferCustomProcessor
virtual ~IInferCustomProcessor()=default
IInferCustomProcessor will be deleted by nvdsinferserver lib.
nvdsinferserver::InferMemType::kCpu
@ kCpu
Host (CPU) memory.
nvdsinferserver::IBatchArray
Interface class for an array of batch buffers.
Definition: sources/includes/nvdsinferserver/infer_datatypes.h:233
nvdsinferserver::IInferCustomProcessor::extraInputProcess
virtual NvDsInferStatus extraInputProcess(const std::vector< IBatchBuffer * > &primaryInputs, std::vector< IBatchBuffer * > &extraInputs, const IOptions *options)=0
Custom processor for extra input data.
NvDsInferStatus
NvDsInferStatus
Enum for the status codes returned by NvDsInferContext.
Definition: sources/includes/nvdsinfer.h:231