NVIDIA DeepStream SDK API Reference

9.1 Release
sources/libs/nvdsinferserver/infer_simple_context.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2020-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_SIMPLE_CONTEXT_H__
19 #define __NVDSINFERSERVER_SIMPLE_CONTEXT_H__
20 
21 #include "infer_base_backend.h"
22 #include "infer_base_context.h"
23 #include "infer_cuda_utils.h"
24 #include "infer_datatypes.h"
25 #include "infer_utils.h"
26 
27 namespace nvdsinferserver {
28 
29 
31 public:
33  ~InferSimpleContext() override;
34 
35 protected:
37  const ic::BackendParams& params, int maxBatchSize,
40  const ic::InferenceConfig& config, BaseBackend& backend) override;
41  NvDsInferStatus deinit() override;
42 
43 private:
44  // should not called
45  NvDsInferStatus createPreprocessor(
46  const ic::PreProcessParams& params,
47  std::vector<UniqPreprocessor>& processors) override;
48  NvDsInferStatus createPostprocessor(
49  const ic::PostProcessParams& params,
50  UniqPostprocessor& processor) override;
51  NvDsInferStatus allocateResource(
52  const ic::InferenceConfig& config) override;
53 
54  void getNetworkInputInfo(NvDsInferNetworkInfo& networkInfo) override
55  {
56  networkInfo = m_NetworkImageInfo;
57  }
58  void notifyError(NvDsInferStatus status) override {}
59  SharedCuStream& mainStream() override { return m_Stream; }
60 
61 private:
62  // Optional, not needed
63  NvDsInferNetworkInfo m_NetworkImageInfo{0, 0, 0};
64 
65  SharedCuStream m_Stream{nullptr};
66 };
67 
68 } // namespace nvdsinferserver
69 
70 #endif //__NVDSINFERSERVER_SIMPLE_CONTEXT_H__
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::InferSimpleContext::InferSimpleContext
InferSimpleContext()
infer_base_context.h
Header file of the base class for inference context.
nvdsinferserver::InferBaseContext::maxBatchSize
int maxBatchSize() const
Definition: sources/libs/nvdsinferserver/infer_base_context.h:104
nvdsinferserver::InferSimpleContext::fixateInferenceInfo
NvDsInferStatus fixateInferenceInfo(const ic::InferenceConfig &config, BaseBackend &backend) override
nvdsinferserver::InferSimpleContext::~InferSimpleContext
~InferSimpleContext() override
nvdsinferserver::InferSimpleContext::deinit
NvDsInferStatus deinit() override
nvdsinferserver::InferSimpleContext::createNNBackend
NvDsInferStatus createNNBackend(const ic::BackendParams &params, int maxBatchSize, UniqBackend &backend)
nvdsinferserver::UniqPostprocessor
std::unique_ptr< BasePostprocessor > UniqPostprocessor
Processor interfaces.
Definition: sources/libs/nvdsinferserver/infer_common.h:103
nvdsinferserver::SharedCuStream
std::shared_ptr< CudaStream > SharedCuStream
Cuda based pointers.
Definition: sources/libs/nvdsinferserver/infer_common.h:89
NvDsInferNetworkInfo
Holds information about the model network.
Definition: sources/includes/nvdsinfer.h:119
nvdsinferserver::UniqBackend
std::unique_ptr< BaseBackend > UniqBackend
Definition: sources/libs/nvdsinferserver/infer_base_backend.h:217
nvdsinferserver::InferBaseContext::backend
BaseBackend * backend()
Definition: sources/libs/nvdsinferserver/infer_base_context.h:106
nvdsinferserver::InferBaseContext
The base class for handling the inference context.
Definition: sources/libs/nvdsinferserver/infer_base_context.h:57
nvdsinferserver::InferBaseContext::config
const ic::InferenceConfig & config() const
Definition: sources/libs/nvdsinferserver/infer_base_context.h:103
nvdsinferserver::InferSimpleContext
Definition: sources/libs/nvdsinferserver/infer_simple_context.h:30
infer_utils.h
Header file containing utility functions and classes used by the nvinferserver low level library.
nvdsinferserver::BaseBackend
Base class of inference backend processing.
Definition: sources/libs/nvdsinferserver/infer_base_backend.h:45
infer_base_backend.h
Header file for inference processing backend base class.
infer_cuda_utils.h
Header file declaring utility classes for CUDA memory management, CIDA streams and events.
NvDsInferStatus
NvDsInferStatus
Enum for the status codes returned by NvDsInferContext.
Definition: sources/includes/nvdsinfer.h:231