Skip to content

Commit

Permalink
feat(autoware_tensorrt_yolox):Add schema for autoware_tensorrt_yolox
Browse files Browse the repository at this point in the history
Signed-off-by: vish0012 <[email protected]>
  • Loading branch information
vish0012 committed Jan 30, 2025
1 parent b107ac7 commit ba32446
Show file tree
Hide file tree
Showing 2 changed files with 156 additions and 76 deletions.
116 changes: 78 additions & 38 deletions perception/autoware_tensorrt_yolox/schema/yolox_s_plus_opt.schema.json
Original file line number Diff line number Diff line change
@@ -1,89 +1,125 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Parameters for tensorrt_yolox_s_plus_opt Nodes",
"title": "autoware_tensorrt_yolox parameter",
"type": "object",
"definitions": {
"yolox_s_plus_opt": {
"type": "object",
"properties": {
"is_roi_overlap_segment": {
"type": "boolean",
"description": "Enable or disable ROI overlap segmentation. Disable when semantic segmentation accuracy is sufficient.",
"default": true
},
"overlap_roi_score_threshold": {
"type": "number",
"description": "Minimum existence probability of detected ROI to replace segmentation.",
"default": 0.3
},
"is_publish_color_mask": {
"type": "boolean",
"description": "Enable or disable publishing color masks for result visualization.",
"default": false
},
"roi_overlay_segment_label": {
"type": "object",
"description": "Specify which labels to refine in segmentation using ROI.",
"properties": {
"UNKNOWN": { "type": "boolean", "default": true },
"CAR": { "type": "boolean", "default": false },
"TRUCK": { "type": "boolean", "default": false },
"BUS": { "type": "boolean", "default": false },
"MOTORCYCLE": { "type": "boolean", "default": true },
"BICYCLE": { "type": "boolean", "default": true },
"PEDESTRIAN": { "type": "boolean", "default": true },
"ANIMAL": { "type": "boolean", "default": true }
},
"additionalProperties": false
},
"model_path": {
"type": "string",
"default": "$(var data_path)/tensorrt_yolox/$(var model_name).onnx",
"description": "Path to onnx model."
"description": "Path to ONNX model.",
"default": "$(var data_path)/tensorrt_yolox/$(var model_name).onnx"
},
"label_path": {
"type": "string",
"default": "$(var data_path)/tensorrt_yolox/label.txt",
"description": "Path to label file."
"description": "Path to label file.",
"default": "$(var data_path)/tensorrt_yolox/label.txt"
},
"color_map_path": {
"type": "string",
"description": "Path to semantic segmentation color map.",
"default": "$(var data_path)/tensorrt_yolox/semseg_color_map.csv"
},
"score_threshold": {
"type": "number",
"default": 0.35,
"minimum": 0.0,
"maximum": 1.0,
"description": "A threshold value of existence probability score, all of objects with score less than this threshold are ignored."
"description": "Threshold for object existence probability. Objects with scores below this value are ignored.",
"default": 0.35
},
"nms_threshold": {
"type": "number",
"default": 0.7,
"minimum": 0.0,
"maximum": 1.0,
"description": "A threshold value of NMS."
"description": "Threshold value for Non-Maximum Suppression (NMS).",
"default": 0.7
},
"precision": {
"type": "string",
"default": "int8",
"description": "Operation precision to be used on inference. Valid value is one of: [fp32, fp16, int8]."
"description": "Operation precision for inference. Options: fp32, fp16, int8.",
"default": "int8"
},
"calibration_algorithm": {
"type": "string",
"default": "Entropy",
"description": "Calibration algorithm to be used for quantization when precision==int8. Valid value is one of: [Entropy, (Legacy | Percentile), MinMax]."
"description": "Algorithm for quantization calibration when precision is int8. Options: Entropy, (Legacy | Percentile), MinMax.",
"default": "Entropy"
},
"dla_core_id": {
"type": "number",
"default": -1,
"description": "If positive ID value is specified, the node assign inference task to the DLA core."
"type": "integer",
"description": "DLA core ID for inference. If positive, assigns inference task to the specified DLA core.",
"default": -1
},
"quantize_first_layer": {
"type": "boolean",
"default": false,
"description": "If true, set the operating precision for the first (input) layer to be fp16. This option is valid only when precision==int8."
"description": "Enable fp16 precision for the first (input) layer when precision is int8.",
"default": false
},
"quantize_last_layer": {
"type": "boolean",
"default": false,
"description": "If true, set the operating precision for the last (output) layer to be fp16. This option is valid only when precision==int8."
"description": "Enable fp16 precision for the last (output) layer when precision is int8.",
"default": false
},
"profile_per_layer": {
"type": "boolean",
"default": false,
"description": "If true, profiler function will be enabled. Since the profile function may affect execution speed, it is recommended to set this flag true only for development purpose."
"description": "Enable profiler for each layer. Recommended only for development.",
"default": false
},
"clip_value": {
"type": "number",
"default": 6.0,
"description": "If positive value is specified, the value of each layer output will be clipped between [0.0, clip_value]. This option is valid only when precision==int8 and used to manually specify the dynamic range instead of using any calibration."
"description": "Maximum clipping value for layer output. Valid only for int8 precision.",
"default": 6.0
},
"preprocess_on_gpu": {
"type": "boolean",
"default": true,
"description": "If true, pre-processing is performed on GPU."
"description": "Enable preprocessing on GPU.",
"default": true
},
"gpu_id": {
"type": "integer",
"default": 0,
"description": "GPU ID for selecting CUDA device"
"description": "GPU ID for selecting CUDA device.",
"default": 0
},
"calibration_image_list_path": {
"type": "string",
"default": "",
"description": "Path to a file which contains path to images. Those images will be used for int8 quantization."
"description": "Path to file containing image paths for int8 quantization calibration.",
"default": ""
}
},
"required": [
"is_roi_overlap_segment",
"overlap_roi_score_threshold",
"is_publish_color_mask",
"roi_overlay_segment_label",
"model_path",
"label_path",
"color_map_path",
"score_threshold",
"nms_threshold",
"precision",
Expand All @@ -94,8 +130,10 @@
"profile_per_layer",
"clip_value",
"preprocess_on_gpu",
"gpu_id"
]
"gpu_id",
"calibration_image_list_path"
],
"additionalProperties": false
}
},
"properties": {
Expand All @@ -106,8 +144,10 @@
"$ref": "#/definitions/yolox_s_plus_opt"
}
},
"required": ["ros__parameters"]
"required": ["ros__parameters"],
"additionalProperties": false
}
},
"required": ["/**"]
"required": ["/**"],
"additionalProperties": false
}
116 changes: 78 additions & 38 deletions perception/autoware_tensorrt_yolox/schema/yolox_tiny.schema.json
Original file line number Diff line number Diff line change
@@ -1,89 +1,125 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Parameters for tensorrt_yolox_tiny Nodes",
"title": "autoware_tensorrt_yolox parameter",
"type": "object",
"definitions": {
"yolox_tiny": {
"type": "object",
"properties": {
"is_roi_overlap_segment": {
"type": "boolean",
"description": "Refine segmentation mask by overlaying ROI class. Disable when semantic segmentation accuracy is sufficient.",
"default": true
},
"overlap_roi_score_threshold": {
"type": "number",
"description": "Minimum existence probability of detected ROI to replace segmentation.",
"default": 0.3
},
"is_publish_color_mask": {
"type": "boolean",
"description": "Enable or disable publishing color masks for result visualization.",
"default": false
},
"roi_overlay_segment_label": {
"type": "object",
"description": "Specify which labels to refine in segmentation using ROI.",
"properties": {
"UNKNOWN": { "type": "boolean", "default": true },
"CAR": { "type": "boolean", "default": false },
"TRUCK": { "type": "boolean", "default": false },
"BUS": { "type": "boolean", "default": false },
"MOTORCYCLE": { "type": "boolean", "default": true },
"BICYCLE": { "type": "boolean", "default": true },
"PEDESTRIAN": { "type": "boolean", "default": true },
"ANIMAL": { "type": "boolean", "default": true }
},
"additionalProperties": false
},
"model_path": {
"type": "string",
"default": "$(var data_path)/tensorrt_yolox/$(var model_name).onnx",
"description": "Path to onnx model."
"description": "Path to the ONNX file for the YOLOX model.",
"default": "$(var data_path)/tensorrt_yolox/$(var model_name).onnx"
},
"label_path": {
"type": "string",
"default": "$(var data_path)/tensorrt_yolox/label.txt",
"description": "Path to label file."
"description": "Path to the label file for the YOLOX model.",
"default": "$(var data_path)/tensorrt_yolox/label.txt"
},
"color_map_path": {
"type": "string",
"description": "Path to the semantic segmentation color map file.",
"default": "$(var data_path)/tensorrt_yolox/semseg_color_map.csv"
},
"score_threshold": {
"type": "number",
"default": 0.35,
"minimum": 0.0,
"maximum": 1.0,
"description": "A threshold value of existence probability score, all of objects with score less than this threshold are ignored."
"description": "Threshold for object detection scores. Objects with scores below this value are ignored.",
"default": 0.35
},
"nms_threshold": {
"type": "number",
"default": 0.7,
"minimum": 0.0,
"maximum": 1.0,
"description": "A threshold value of NMS."
"description": "Threshold for Non-Maximum Suppression (NMS). Detections with IoU above this value are ignored.",
"default": 0.7
},
"precision": {
"type": "string",
"default": "fp16",
"description": "Operation precision to be used on inference. Valid value is one of: [fp32, fp16, int8]."
"description": "Operation precision for inference. Valid options: [fp32, fp16, int8].",
"default": "fp16"
},
"calibration_algorithm": {
"type": "string",
"default": "MinMax",
"description": "Calibration algorithm to be used for quantization when precision==int8. Valid value is one of: [Entropy, (Legacy | Percentile), MinMax]."
"description": "Calibration algorithm for quantization when precision is int8. Valid options: [Entropy, (Legacy | Percentile), MinMax].",
"default": "MinMax"
},
"dla_core_id": {
"type": "number",
"default": -1,
"description": "If positive ID value is specified, the node assign inference task to the DLA core."
"type": "integer",
"description": "DLA core ID for inference. If positive, assigns inference task to the specified DLA core.",
"default": -1
},
"quantize_first_layer": {
"type": "boolean",
"default": false,
"description": "If true, set the operating precision for the first (input) layer to be fp16. This option is valid only when precision==int8."
"description": "Enable fp16 precision for the first (input) layer when precision is int8.",
"default": false
},
"quantize_last_layer": {
"type": "boolean",
"default": false,
"description": "If true, set the operating precision for the last (output) layer to be fp16. This option is valid only when precision==int8."
"description": "Enable fp16 precision for the last (output) layer when precision is int8.",
"default": false
},
"profile_per_layer": {
"type": "boolean",
"default": false,
"description": "If true, profiler function will be enabled. Since the profile function may affect execution speed, it is recommended to set this flag true only for development purpose."
"description": "Enable profiling for each layer. Recommended only for development purposes.",
"default": false
},
"clip_value": {
"type": "number",
"default": 0.0,
"description": "If positive value is specified, the value of each layer output will be clipped between [0.0, clip_value]. This option is valid only when precision==int8 and used to manually specify the dynamic range instead of using any calibration."
"description": "Maximum clipping value for layer outputs. Valid only for int8 precision.",
"default": 0.0
},
"preprocess_on_gpu": {
"type": "boolean",
"default": true,
"description": "If true, pre-processing is performed on GPU."
"description": "Enable preprocessing on the GPU.",
"default": true
},
"gpu_id": {
"type": "integer",
"default": 0,
"description": "GPU ID for selecting CUDA device"
"description": "GPU ID for selecting the CUDA device.",
"default": 0
},
"calibration_image_list_path": {
"type": "string",
"default": "",
"description": "Path to a file which contains path to images. Those images will be used for int8 quantization."
"description": "Path to a file containing image paths for int8 quantization calibration.",
"default": ""
}
},
"required": [
"is_roi_overlap_segment",
"overlap_roi_score_threshold",
"is_publish_color_mask",
"roi_overlay_segment_label",
"model_path",
"label_path",
"color_map_path",
"score_threshold",
"nms_threshold",
"precision",
Expand All @@ -94,8 +130,10 @@
"profile_per_layer",
"clip_value",
"preprocess_on_gpu",
"gpu_id"
]
"gpu_id",
"calibration_image_list_path"
],
"additionalProperties": false
}
},
"properties": {
Expand All @@ -106,8 +144,10 @@
"$ref": "#/definitions/yolox_tiny"
}
},
"required": ["ros__parameters"]
"required": ["ros__parameters"],
"additionalProperties": false
}
},
"required": ["/**"]
"required": ["/**"],
"additionalProperties": false
}

0 comments on commit ba32446

Please sign in to comment.