forked from zhouyuchong/gst-nvinfer-custom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gstnvinfer_property_parser.h
161 lines (132 loc) · 7.41 KB
/
gstnvinfer_property_parser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
/**
* Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
*
* NVIDIA Corporation and its licensors retain all intellectual property
* and proprietary rights in and to this software, related documentation
* and any modifications thereto. Any use, reproduction, disclosure or
* distribution of this software and related documentation without an express
* license agreement from NVIDIA Corporation is strictly prohibited.
*
*/
#ifndef __GST_NVINFER_PROPERTY_PARSER_H__
#define __GST_NVINFER_PROPERTY_PARSER_H__
#include <glib.h>
#include "nvdsinfer_context.h"
#include "gstnvinfer.h"
#define DEFAULT_PRE_CLUSTER_THRESHOLD 0.2
#define DEFAULT_POST_CLUSTER_THRESHOLD 0.0
#define DEFAULT_EPS 0.0
#define DEFAULT_GROUP_THRESHOLD 0
#define DEFAULT_MIN_BOXES 0
#define DEFAULT_DBSCAN_MIN_SCORE 0
#define DEFAULT_NMS_IOU_THRESHOLD 0.3
#define DEFAULT_TOP_K -1
#define CONFIG_GROUP_PROPERTY "property"
#define CONFIG_GROUP_INFER_PARSE_FUNC "parse-func"
/** Gstreamer element configuration. */
#define CONFIG_GROUP_INFER_UNIQUE_ID "gie-unique-id"
#define CONFIG_GROUP_INFER_PROCESS_MODE "process-mode"
#define CONFIG_GROUP_INFER_INTERVAL "interval"
#define CONFIG_GROUP_INFER_LABEL "labelfile-path"
#define CONFIG_GROUP_INFER_GPU_ID "gpu-id"
#define CONFIG_GROUP_INFER_SECONDARY_REINFER_INTERVAL "secondary-reinfer-interval"
#define CONFIG_GROUP_INFER_OUTPUT_TENSOR_META "output-tensor-meta"
#define CONFIG_GROUP_INFER_ENABLE_DLA "enable-dla"
#define CONFIG_GROUP_INFER_USE_DLA_CORE "use-dla-core"
/** Runtime engine parameters. */
#define CONFIG_GROUP_INFER_BATCH_SIZE "batch-size"
#define CONFIG_GROUP_INFER_TENSOR_META_POOL_SIZE "tensor-meta-pool-size"
#define CONFIG_GROUP_INFER_NETWORK_MODE "network-mode"
#define CONFIG_GROUP_INFER_MODEL_ENGINE "model-engine-file"
#define CONFIG_GROUP_INFER_INT8_CALIBRATION_FILE "int8-calib-file"
#define CONFIG_GROUP_INFER_WORKSPACE_SIZE "workspace-size"
/** Generic model parameters. */
#define CONFIG_GROUP_INFER_OUTPUT_BLOB_NAMES "output-blob-names"
#define CONFIG_GROUP_INFER_IS_CLASSIFIER_LEGACY "is-classifier"
#define CONFIG_GROUP_INFER_NETWORK_TYPE "network-type"
#define CONFIG_GROUP_INFER_FORCE_IMPLICIT_BATCH_DIM "force-implicit-batch-dim"
#define CONFIG_GROUP_INFER_INFER_DIMENSIONS "infer-dims"
#define CONFIG_GROUP_INFER_OUTPUT_IO_FORMATS "output-io-formats"
#define CONFIG_GROUP_INFER_LAYER_DEVICE_PRECISION "layer-device-precision"
/** Preprocessing parameters. */
#define CONFIG_GROUP_INFER_MODEL_COLOR_FORMAT "model-color-format"
#define CONFIG_GROUP_INFER_SCALE_FACTOR "net-scale-factor"
#define CONFIG_GROUP_INFER_OFFSETS "offsets"
#define CONFIG_GROUP_INFER_MEANFILE "mean-file"
#define CONFIG_GROUP_INFER_MAINTAIN_ASPECT_RATIO "maintain-aspect-ratio"
#define CONFIG_GROUP_INFER_SYMMETRIC_PADDING "symmetric-padding"
#define CONFIG_GROUP_INFER_SCALING_FILTER "scaling-filter"
#define CONFIG_GROUP_INFER_SCALING_COMPUTE_HW "scaling-compute-hw"
#define CONFIG_GROUP_INFER_NET_INPUT_ORDER "network-input-order"
#define CONFIG_GROUP_INFER_INPUT_FROM_META "input-tensor-from-meta"
/** Custom implementation required to support a network. */
#define CONFIG_GROUP_INFER_CUSTOM_LIB_PATH "custom-lib-path"
#define CONFIG_GROUP_INFER_CUSTOM_PARSE_BBOX_FUNC "parse-bbox-func-name"
#define CONFIG_GROUP_INFER_CUSTOM_PARSE_BBOX_IM_FUNC "parse-bbox-instance-mask-func-name"
#define CONFIG_GROUP_INFER_CUSTOM_ENGINE_CREATE_FUNC "engine-create-func-name"
#define CONFIG_GROUP_INFER_CUSTOM_PARSE_CLASSIFIER_FUNC "parse-classifier-func-name"
#define CONFIG_GROUP_INFER_CUSTOM_NETWORK_CONFIG "custom-network-config"
/** Caffe model specific parameters. */
#define CONFIG_GROUP_INFER_MODEL "model-file"
#define CONFIG_GROUP_INFER_PROTO "proto-file"
/** UFF model specific parameters. */
#define CONFIG_GROUP_INFER_UFF "uff-file"
#define CONFIG_GROUP_INFER_UFF_INPUT_ORDER "uff-input-order"
#define CONFIG_GROUP_INFER_UFF_INPUT_DIMENSIONS_LEGACY "input-dims"
#define CONFIG_GROUP_INFER_UFF_INPUT_DIMENSIONS_LEGACY_V2 "uff-input-dims"
#define CONFIG_GROUP_INFER_UFF_INPUT_BLOB_NAME "uff-input-blob-name"
/** TLT model parameters. */
#define CONFIG_GROUP_INFER_TLT_ENCODED_MODEL "tlt-encoded-model"
#define CONFIG_GROUP_INFER_TLT_MODEL_KEY "tlt-model-key"
/** ONNX model specific parameters. */
#define CONFIG_GROUP_INFER_ONNX "onnx-file"
/** Detector specific parameters. */
#define CONFIG_GROUP_INFER_NUM_DETECTED_CLASSES "num-detected-classes"
#define CONFIG_GROUP_INFER_ENABLE_DBSCAN "enable-dbscan"
#define CONFIG_GROUP_INFER_CLUSTER_MODE "cluster-mode"
/** Classifier specific parameters. */
#define CONFIG_GROUP_INFER_CLASSIFIER_TYPE "classifier-type"
#define CONFIG_GROUP_INFER_CLASSIFIER_THRESHOLD "classifier-threshold"
#define CONFIG_GROUP_INFER_CLASSIFIER_ASYNC_MODE "classifier-async-mode"
/** Segmentaion specific parameters. */
#define CONFIG_GROUP_INFER_SEGMENTATION_THRESHOLD "segmentation-threshold"
#define CONFIG_GROUP_INFER_SEGMENTATION_OUTPUT_ORDER "segmentation-output-order"
/** Instance Segmentaion specific parameters. */
#define CONFIG_GROUP_INFER_OUTPUT_INSTANCE_MASK "output-instance-mask"
/** Parameters for filtering objects based min/max size threshold when
operating in secondary mode. */
#define CONFIG_GROUP_INFER_INPUT_OBJECT_MIN_WIDTH "input-object-min-width"
#define CONFIG_GROUP_INFER_INPUT_OBJECT_MIN_HEIGHT "input-object-min-height"
#define CONFIG_GROUP_INFER_INPUT_OBJECT_MAX_WIDTH "input-object-max-width"
#define CONFIG_GROUP_INFER_INPUT_OBJECT_MAX_HEIGHT "input-object-max-height"
#define CONFIG_GROUP_INFER_INPUT_OBJECT_ALIGNMENT "alignment"
#define CONFIG_GROUP_INFER_INPUT_OBJECT_USER_META "user-meta"
/** Parameters for filtering objects based on class-id and unique id of the
detector when operating in secondary mode. */
#define CONFIG_GROUP_INFER_GIE_ID_FOR_OPERATION "operate-on-gie-id"
#define CONFIG_GROUP_INFER_CLASS_IDS_FOR_OPERATION "operate-on-class-ids"
#define CONFIG_GROUP_INFER_CLASS_IDS_FOR_FILTERING "filter-out-class-ids"
/** Per-class detection/filtering parameters. */
#define CONFIG_GROUP_INFER_CLASS_ATTRS_PREFIX "class-attrs-"
#define CONFIG_GROUP_INFER_CLASS_ATTRS_THRESHOLD "threshold"
#define CONFIG_GROUP_INFER_CLASS_ATTRS_PRE_CLUSTER_THRESHOLD "pre-cluster-threshold"
#define CONFIG_GROUP_INFER_CLASS_ATTRS_POST_CLUSTER_THRESHOLD "post-cluster-threshold"
#define CONFIG_GROUP_INFER_CLASS_ATTRS_EPS "eps"
#define CONFIG_GROUP_INFER_CLASS_ATTRS_GROUP_THRESHOLD "group-threshold"
#define CONFIG_GROUP_INFER_CLASS_ATTRS_MIN_BOXES "minBoxes"
#define CONFIG_GROUP_INFER_CLASS_ATTRS_DBSCAN_MIN_SCORE "dbscan-min-score"
#define CONFIG_GROUP_INFER_CLASS_ATTRS_ROI_TOP_OFFSET "roi-top-offset"
#define CONFIG_GROUP_INFER_CLASS_ATTRS_ROI_BOTTOM_OFFSET "roi-bottom-offset"
#define CONFIG_GROUP_INFER_CLASS_ATTRS_DETECTED_MIN_WIDTH "detected-min-w"
#define CONFIG_GROUP_INFER_CLASS_ATTRS_DETECTED_MIN_HEIGHT "detected-min-h"
#define CONFIG_GROUP_INFER_CLASS_ATTRS_DETECTED_MAX_WIDTH "detected-max-w"
#define CONFIG_GROUP_INFER_CLASS_ATTRS_DETECTED_MAX_HEIGHT "detected-max-h"
#define CONFIG_GROUP_INFER_CLASS_ATTRS_BORDER_COLOR "border-color"
#define CONFIG_GROUP_INFER_CLASS_ATTRS_BG_COLOR "bg-color"
#define CONFIG_GROUP_INFER_CLASS_ATTRS_NMS_IOU_THRESHOLD "nms-iou-threshold"
#define CONFIG_GROUP_INFER_CLASS_ATTRS_TOP_K "topk"
gboolean gst_nvinfer_parse_config_file (GstNvInfer *nvinfer,
NvDsInferContextInitParams *init_params, const gchar * cfg_file_path);
gboolean gst_nvinfer_parse_context_params (NvDsInferContextInitParams *params,
const gchar * cfg_file_path);
#endif /*__GST_NVINFER_PROPERTY_PARSER_H__*/