NVIDIA DeepStream SDK API Reference

6.4 Release
infer_proto_utils.h
Go to the documentation of this file.
1 
12 #ifndef __NVDSINFER_SERVER_PROTO_UTILS_H__
13 #define __NVDSINFER_SERVER_PROTO_UTILS_H__
14 
15 #include <dlfcn.h>
16 #include <stdarg.h>
17 #include <string.h>
18 #include <unistd.h>
19 #include <cassert>
20 #include <condition_variable>
21 #include <mutex>
22 #include <sstream>
23 #include <stdexcept>
24 #include <string>
25 
26 #include "nvbufsurftransform.h"
27 #include <infer_datatypes.h>
28 
29 #pragma GCC diagnostic push
30 #if __GNUC__ >= 8
31 #pragma GCC diagnostic ignored "-Wrestrict"
32 #endif
33 #include "nvdsinferserver_config.pb.h"
34 #include "nvdsinferserver_plugin.pb.h"
35 #pragma GCC diagnostic pop
36 
37 namespace ic = nvdsinferserver::config;
38 
39 namespace nvdsinferserver {
40 
41 InferDataType dataTypeFromDsProto(ic::TensorDataType dt);
42 
43 InferTensorOrder tensorOrderFromDsProto(ic::TensorOrder o);
44 InferMediaFormat mediaFormatFromDsProto(ic::MediaFormat f);
45 InferMemType memTypeFromDsProto(ic::MemoryType t);
46 
49 
50 bool validateProtoConfig(ic::InferenceConfig& c, const std::string& path);
51 bool compareModelRepo(
52  const ic::TritonModelRepo& repoA, const ic::TritonModelRepo& repoB);
53 
54 inline bool
55 hasTriton(const ic::BackendParams& params)
56 {
57  return params.has_triton() || params.has_trt_is();
58 }
59 inline const ic::TritonParams&
60 getTritonParam(const ic::BackendParams& params)
61 {
62  if (params.has_triton()) {
63  return params.triton();
64  } else {
65  assert(params.has_trt_is());
66  return params.trt_is();
67  }
68 }
69 inline ic::TritonParams*
70 mutableTriton(ic::BackendParams& params)
71 {
72  if (params.has_triton()) {
73  return params.mutable_triton();
74  } else {
75  assert(params.has_trt_is());
76  return params.mutable_trt_is();
77  }
78 }
79 
80 } // namespace nvdsinferserver
81 
82 #endif
nvdsinferserver
Copyright (c) 2021, NVIDIA CORPORATION.
Definition: infer_custom_process.h:28
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:60
NvBufSurfTransform_Compute
NvBufSurfTransform_Compute
Specifies compute devices used by NvBufSurfTransform.
Definition: nvbufsurftransform.h:40
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:79
nvdsinferserver::mutableTriton
ic::TritonParams * mutableTriton(ic::BackendParams &params)
Definition: infer_proto_utils.h:70
nvbufsurftransform.h
nvdsinferserver::memTypeFromDsProto
InferMemType memTypeFromDsProto(ic::MemoryType t)
nvdsinferserver::hasTriton
bool hasTriton(const ic::BackendParams &params)
Definition: infer_proto_utils.h:55