TensorRT  6.0.1.5
NvInferPluginUtils.h
1 /*
2  * Copyright 1993-2019 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"
59 
60 namespace nvinfer1
61 {
69 enum class PluginType : int
70 {
71  kFASTERRCNN = 0,
72  kNORMALIZE = 1,
73  kPERMUTE = 2,
74  kPRIORBOX = 3,
76  kCONCAT = 5,
77  kPRELU = 6,
78  kYOLOREORG = 7,
79  kYOLOREGION = 8,
80  kANCHORGENERATOR = 9,
81 };
82 
84 template <>
85 constexpr inline int EnumMax<PluginType>()
86 {
87  return 10;
88 }
89 
90 namespace plugin
91 {
92 
97 typedef struct
98 {
99  int data[4];
100 } Quadruple;
101 
102 
123 {
124  float *minSize, *maxSize, *aspectRatios;
125  int numMinSize, numMaxSize, numAspectRatios;
126  bool flip;
127  bool clip;
128  float variance[4];
129  int imgH, imgW;
130  float stepH, stepW;
131  float offset;
132 };
133 
149 {
150  int poolingH;
151  int poolingW;
152  int featureStride;
153  int preNmsTop;
154  int nmsMaxOut;
155  int anchorsRatioCount;
156  int anchorsScaleCount;
157  float iouThreshold;
158  float minBoxSize;
159  float spatialScale;
160 };
161 
162 
176 {
177  float minSize, maxSize;
178  float* aspectRatios;
179  int numAspectRatios, H, W;
180  float variance[4];
181 };
182 
187 enum class CodeTypeSSD : int
188 {
189  CORNER = 0,
190  CENTER_SIZE = 1,
191  CORNER_SIZE = 2,
192  TF_CENTER = 3
193 };
194 
214 {
215  bool shareLocation, varianceEncodedInTarget;
216  int backgroundLabelId, numClasses, topK, keepTopK;
217  float confidenceThreshold, nmsThreshold;
218  CodeTypeSSD codeType;
219  int inputOrder[3];
220  bool confSigmoid;
221  bool isNormalized;
222 };
223 
224 
236 TRT_DEPRECATED typedef struct
237 {
238  int* leaf;
239  int n;
240  int* parent;
241  int* child;
242  int* group;
243  char** name;
244 
245  int groups;
246  int* groupSize;
247  int* groupOffset;
248 } softmaxTree; // softmax tree
249 
250 struct TRT_DEPRECATED RegionParameters
251 {
252  int num;
253  int coords;
254  int classes;
255  softmaxTree* smTree;
256 };
257 
274 
276 {
277  bool shareLocation;
278  int backgroundLabelId, numClasses, topK, keepTopK;
279  float scoreThreshold, iouThreshold;
280  bool isNormalized;
281 };
282 
283 } // end plugin namespace
284 } // end nvinfer1 namespace
285 #endif
RPROIParams is used to create the RPROIPlugin instance. It contains:
Definition: NvInferPluginUtils.h:148
The Permute plugin layer permutes the input tensor by changing the memory order of the data...
Definition: NvInferPluginUtils.h:97
YOLO PReLU Plugin.
SSD Grid Anchor Generator.
PluginType
The type values for the various plugins.
Definition: NvInferPluginUtils.h:69
FasterRCNN fused plugin (RPN + ROI pooling).
SSD DetectionOutput plugin.
The TensorRT API version 1 namespace.
The PriorBox plugin layer generates the prior boxes of designated sizes and aspect ratios across all ...
Definition: NvInferPluginUtils.h:122
The NMSParameters are used by the BatchedNMSPlugin for performing the non_max_suppression operation o...
Definition: NvInferPluginUtils.h:275
The Region plugin layer performs region proposal calculation: generate 5 bounding boxes per cell (for...
Definition: NvInferPluginUtils.h:236
Definition: NvInferPluginUtils.h:250
The Anchor Generator plugin layer generates the prior boxes of designated sizes and aspect ratios acr...
Definition: NvInferPluginUtils.h:175
The DetectionOutput plugin layer generates the detection output based on location and confidence pred...
Definition: NvInferPluginUtils.h:213