NVIDIA DeepStream SDK API Reference

7.0 Release
infer_proto_utils.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2019-2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  */
12 
13 #ifndef __NVDSINFER_SERVER_PROTO_UTILS_H__
14 #define __NVDSINFER_SERVER_PROTO_UTILS_H__
15 
16 #include <dlfcn.h>
17 #include <stdarg.h>
18 #include <string.h>
19 #include <unistd.h>
20 #include <cassert>
21 #include <condition_variable>
22 #include <mutex>
23 #include <sstream>
24 #include <stdexcept>
25 #include <string>
26 
27 #include "nvbufsurftransform.h"
28 #include <infer_datatypes.h>
29 
30 #pragma GCC diagnostic push
31 #if __GNUC__ >= 8
32 #pragma GCC diagnostic ignored "-Wrestrict"
33 #endif
34 #include "nvdsinferserver_config.pb.h"
35 #include "nvdsinferserver_plugin.pb.h"
36 #pragma GCC diagnostic pop
37 
38 namespace ic = nvdsinferserver::config;
39 
40 namespace nvdsinferserver {
41 
42 InferDataType dataTypeFromDsProto(ic::TensorDataType dt);
43 
44 InferTensorOrder tensorOrderFromDsProto(ic::TensorOrder o);
45 InferMediaFormat mediaFormatFromDsProto(ic::MediaFormat f);
46 InferMemType memTypeFromDsProto(ic::MemoryType t);
47 
50 
51 bool validateProtoConfig(ic::InferenceConfig& c, const std::string& path);
52 bool compareModelRepo(
53  const ic::TritonModelRepo& repoA, const ic::TritonModelRepo& repoB);
54 
55 inline bool
56 hasTriton(const ic::BackendParams& params)
57 {
58  return params.has_triton() || params.has_trt_is();
59 }
60 inline const ic::TritonParams&
61 getTritonParam(const ic::BackendParams& params)
62 {
63  if (params.has_triton()) {
64  return params.triton();
65  } else {
66  assert(params.has_trt_is());
67  return params.trt_is();
68  }
69 }
70 inline ic::TritonParams*
71 mutableTriton(ic::BackendParams& params)
72 {
73  if (params.has_triton()) {
74  return params.mutable_triton();
75  } else {
76  assert(params.has_trt_is());
77  return params.mutable_trt_is();
78  }
79 }
80 
81 } // namespace nvdsinferserver
82 
83 #endif
nvdsinferserver
This is a header file for pre-processing cuda kernels with normalization and mean subtraction require...
Definition: infer_custom_process.h:24
nvdsinferserver::InferDataType
InferDataType
Datatype of the tensor buffer.
Definition: infer_datatypes.h:83
nvdsinferserver::InferMediaFormat
InferMediaFormat
Image formats.
Definition: infer_datatypes.h:129
nvdsinferserver::validateProtoConfig
bool validateProtoConfig(ic::InferenceConfig &c, const std::string &path)
infer_datatypes.h
Header file for the data types used in the inference processing.
nvdsinferserver::InferTensorOrder
InferTensorOrder
The type of tensor order.
Definition: infer_datatypes.h:41
nvdsinferserver::dataTypeFromDsProto
InferDataType dataTypeFromDsProto(ic::TensorDataType dt)
nvdsinferserver::mediaFormatFromDsProto
InferMediaFormat mediaFormatFromDsProto(ic::MediaFormat f)
nvdsinferserver::getTritonParam
const ic::TritonParams & getTritonParam(const ic::BackendParams &params)
Definition: infer_proto_utils.h:61
NvBufSurfTransform_Compute
NvBufSurfTransform_Compute
Specifies compute devices used by NvBufSurfTransform.
Definition: nvbufsurftransform.h:45
nvdsinferserver::computeHWFromDsProto
NvBufSurfTransform_Compute computeHWFromDsProto(ic::FrameScalingHW h)
nvdsinferserver::tensorOrderFromDsProto
InferTensorOrder tensorOrderFromDsProto(ic::TensorOrder o)
nvdsinferserver::scalingFilterFromDsProto
NvBufSurfTransform_Inter scalingFilterFromDsProto(uint32_t filter)
nvdsinferserver::InferMemType
InferMemType
The memory types of inference buffers.
Definition: infer_datatypes.h:56
nvdsinferserver::compareModelRepo
bool compareModelRepo(const ic::TritonModelRepo &repoA, const ic::TritonModelRepo &repoB)
NvBufSurfTransform_Inter
NvBufSurfTransform_Inter
Specifies video interpolation methods.
Definition: nvbufsurftransform.h:84
nvdsinferserver::mutableTriton
ic::TritonParams * mutableTriton(ic::BackendParams &params)
Definition: infer_proto_utils.h:71
nvbufsurftransform.h
nvdsinferserver::memTypeFromDsProto
InferMemType memTypeFromDsProto(ic::MemoryType t)
nvdsinferserver::hasTriton
bool hasTriton(const ic::BackendParams &params)
Definition: infer_proto_utils.h:56