TensorRT  7.1.3.0
NvInferPluginUtils.h
Go to the documentation of this file.
1 /*
2  * Copyright 1993-2020 NVIDIA Corporation. All rights reserved.
3  *
4  * NOTICE TO LICENSEE:
5  *
6  * This source code and/or documentation ("Licensed Deliverables") are
7  * subject to NVIDIA intellectual property rights under U.S. and
8  * international Copyright laws.
9  *
10  * These Licensed Deliverables contained herein is PROPRIETARY and
11  * CONFIDENTIAL to NVIDIA and is being provided under the terms and
12  * conditions of a form of NVIDIA software license agreement by and
13  * between NVIDIA and Licensee ("License Agreement") or electronically
14  * accepted by Licensee. Notwithstanding any terms or conditions to
15  * the contrary in the License Agreement, reproduction or disclosure
16  * of the Licensed Deliverables to any third party without the express
17  * written consent of NVIDIA is prohibited.
18  *
19  * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
20  * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
21  * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
22  * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
23  * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
24  * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
25  * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
26  * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
27  * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
28  * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
29  * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
30  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
31  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
32  * OF THESE LICENSED DELIVERABLES.
33  *
34  * U.S. Government End Users. These Licensed Deliverables are a
35  * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
36  * 1995), consisting of "commercial computer software" and "commercial
37  * computer software documentation" as such terms are used in 48
38  * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
39  * only as a commercial end item. Consistent with 48 C.F.R.12.212 and
40  * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
41  * U.S. Government End Users acquire the Licensed Deliverables with
42  * only those rights set forth herein.
43  *
44  * Any use of the Licensed Deliverables in individual and commercial
45  * software must include, in the user documentation and internal
46  * comments to the code, the above Disclaimer and U.S. Government End
47  * Users Notice.
48  */
49 
50 #ifndef NV_INFER_PLUGIN_UTILS_H
51 #define NV_INFER_PLUGIN_UTILS_H
52 #include "NvInferRuntimeCommon.h"
53 
60 
61 namespace nvinfer1
62 {
70 enum class PluginType : int
71 {
72  kFASTERRCNN = 0,
73  kNORMALIZE = 1,
74  kPERMUTE = 2,
75  kPRIORBOX = 3,
77  kCONCAT = 5,
78  kPRELU = 6,
79  kYOLOREORG = 7,
80  kYOLOREGION = 8,
81  kANCHORGENERATOR = 9,
82 };
83 
85 template <>
86 constexpr inline int EnumMax<PluginType>()
87 {
88  return 10;
89 }
90 
91 namespace plugin
92 {
93 
98 typedef struct
99 {
100  int data[4];
101 } Quadruple;
102 
103 
124 {
125  float *minSize, *maxSize, *aspectRatios;
126  int numMinSize, numMaxSize, numAspectRatios;
127  bool flip;
128  bool clip;
129  float variance[4];
130  int imgH, imgW;
131  float stepH, stepW;
132  float offset;
133 };
134 
150 {
151  int poolingH;
152  int poolingW;
153  int featureStride;
154  int preNmsTop;
155  int nmsMaxOut;
156  int anchorsRatioCount;
157  int anchorsScaleCount;
158  float iouThreshold;
159  float minBoxSize;
160  float spatialScale;
161 };
162 
163 
177 {
178  float minSize, maxSize;
179  float* aspectRatios;
180  int numAspectRatios, H, W;
181  float variance[4];
182 };
183 
188 enum class CodeTypeSSD : int
189 {
190  CORNER = 0,
191  CENTER_SIZE = 1,
192  CORNER_SIZE = 2,
193  TF_CENTER = 3
194 };
195 
215 {
216  bool shareLocation, varianceEncodedInTarget;
217  int backgroundLabelId, numClasses, topK, keepTopK;
218  float confidenceThreshold, nmsThreshold;
219  CodeTypeSSD codeType;
220  int inputOrder[3];
221  bool confSigmoid;
222  bool isNormalized;
223 };
224 
225 
237 TRT_DEPRECATED typedef struct
238 {
239  int* leaf;
240  int n;
241  int* parent;
242  int* child;
243  int* group;
244  char** name;
245 
246  int groups;
247  int* groupSize;
248  int* groupOffset;
249 } softmaxTree; // softmax tree
250 
251 struct TRT_DEPRECATED RegionParameters
252 {
253  int num;
254  int coords;
255  int classes;
256  softmaxTree* smTree;
257 };
258 
275 
277 {
278  bool shareLocation;
279  int backgroundLabelId, numClasses, topK, keepTopK;
280  float scoreThreshold, iouThreshold;
281  bool isNormalized;
282 };
283 
284 } // end plugin namespace
285 } // end nvinfer1 namespace
286 #endif
nvinfer1::PluginType::kANCHORGENERATOR
SSD Grid Anchor Generator.
nvinfer1::PluginType::kYOLOREORG
YOLO Reorg Plugin.
nvinfer1::plugin::RegionParameters
Definition: NvInferPluginUtils.h:251
nvinfer1::plugin::Quadruple
The Permute plugin layer permutes the input tensor by changing the memory order of the data....
Definition: NvInferPluginUtils.h:98
nvinfer1::PluginType::kSSDDETECTIONOUTPUT
SSD DetectionOutput plugin.
nvinfer1::plugin::GridAnchorParameters
The Anchor Generator plugin layer generates the prior boxes of designated sizes and aspect ratios acr...
Definition: NvInferPluginUtils.h:176
nvinfer1::plugin::PriorBoxParameters
The PriorBox plugin layer generates the prior boxes of designated sizes and aspect ratios across all ...
Definition: NvInferPluginUtils.h:123
nvinfer1::PluginType::kPRELU
YOLO PReLU Plugin.
nvinfer1::PluginType::kYOLOREGION
YOLO Region Plugin.
nvinfer1::PluginType::kPRIORBOX
PriorBox plugin.
nvinfer1::plugin::RPROIParams
RPROIParams is used to create the RPROIPlugin instance. It contains:
Definition: NvInferPluginUtils.h:149
nvinfer1
The TensorRT API version 1 namespace.
nvinfer1::PluginType::kCONCAT
Concat plugin.
nvinfer1::PluginType::kPERMUTE
Permute plugin.
nvinfer1::PluginType
PluginType
The type values for the various plugins.
Definition: NvInferPluginUtils.h:70
nvinfer1::PluginType::kFASTERRCNN
FasterRCNN fused plugin (RPN + ROI pooling).
nvinfer1::plugin::CodeTypeSSD
CodeTypeSSD
The type of encoding used for decoding the bounding boxes and loc_data.
Definition: NvInferPluginUtils.h:188
nvinfer1::plugin::softmaxTree
The Region plugin layer performs region proposal calculation: generate 5 bounding boxes per cell (for...
Definition: NvInferPluginUtils.h:237
NvInferRuntimeCommon.h
nvinfer1::plugin::NMSParameters
The NMSParameters are used by the BatchedNMSPlugin for performing the non_max_suppression operation o...
Definition: NvInferPluginUtils.h:276
nvinfer1::plugin::DetectionOutputParameters
The DetectionOutput plugin layer generates the detection output based on location and confidence pred...
Definition: NvInferPluginUtils.h:214
nvinfer1::PluginType::kNORMALIZE
Normalize plugin.