Skip to content

Commit

Permalink
refactor: add JSON Schema and remove default values in `declare_param…
Browse files Browse the repository at this point in the history
…eter()`

Signed-off-by: ktro2828 <[email protected]>
  • Loading branch information
ktro2828 committed Sep 5, 2023
1 parent 23851b6 commit 83fca82
Show file tree
Hide file tree
Showing 6 changed files with 399 additions and 39 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Parameters for Point Painting Fusion Node",
"type": "object",
"definitions": {
"pointpainting": {
"type": "object",
"properties": {
"model_params": {
"type": "object",
"description": "Parameters for model configuration.",
"properties": {
"class_names": {
"type": "array",
"description": "An array of class names will be predicted.",
"default": ["CAR", "TRUCK", "BUS", "BICYCLE", "PEDESTRIAN"],
"uniqueItems": true
},
"paint_class_names": {
"type": "array",
"description": "An array of class names will be painted by PointPainting",
"default": ["CAR", "BICYCLE", "PEDESTRIAN"],
"uniqueItems": true
},
"point_feature_size": {
"type": "integer",
"description": "A number of channels of point feature layer.",
"default": 7
},
"max_voxel_size": {
"type": "integer",
"description": "A maximum size of voxel grid.",
"default": 40000
},
"point_cloud_range": {
"type": "array",
"description": "An array of distance ranges of each class, this must have same length with `class_names`.",
"default": [-121.6, -76.8, -3.0, 121.6, 76.8, 5.0]
},
"voxel_size": {
"type": "array",
"description": "An array of voxel grid sizes for PointPainting, this must have same length with `paint_class_names`.",
"default": [0.32, 0.32, 8.0]
},
"down_sample_factor": {
"type": "integer",
"description": "A scale factor of downsampling points",
"default": 1,
"minimum": 1
},
"encoder_in_feature_size": {
"type": "integer",
"description": "A size of encoder input feature channels.",
"default": 12
},
"yaw_norm_thresholds": {
"type": "array",
"description": "An array of distance threshold values of norm of yaw [rad].",
"default": [0.3, 0.3, 0.3, 0.3, 0.0],
"minimum": 0.0,
"maximum": 1.0
},
"has_twist": {
"type": "boolean",
"description": "Indicates whether the model outputs twist value.",
"default": false
}
}
},
"densification_params": {
"type": "object",
"description": "Parameters for pointcloud densification.",
"properties": {
"world_frame_id": {
"type": "string",
"description": "A name of frame id where world coordinates system is defined with respect to.",
"default": "map"
},
"num_past_frames": {
"type": "integer",
"description": "A number of past frames to be considered as same input frame.",
"default": 0,
"minimum": 0
}
}
},
"post_process_params": {
"type": "object",
"properties": {
"score_threshold": {
"type": "number",
"description": "A threshold value of existence probability score, all of objects with score less than this threshold are ignored.",
"default": 0.4,
"minimum": 0.0,
"maximum": 1.0
},
"circle_nms_dist_threshold": {
"type": "number",
"description": "",
"default": 0.3,
"minimum": 0.0,
"maximum": 1.0
},
"iou_nms_target_class_names": {
"type": "array",
"description": "An array of class names to be target in NMS.",
"default": ["CAR"],
"uniqueItems": true
},
"iou_search_distance_2d": {
"type": "number",
"description": "A maximum distance value to search the nearest objects.",
"default": 10.0,
"minimum": 0.0
},
"iou_nms_threshold": {
"type": "number",
"description": "A threshold value of NMS using IoU score.",
"default": 0.1,
"minimum": 0.0,
"maximum": 1.0
}
}
},
"omp_params": {
"type": "object",
"properties": {
"num_threads": {
"type": "integer",
"description": "The number of threads that is set to the environment variable OMP_NUM_THREADS.",
"default": 1,
"minimum": 1
}
}
}
},
"required": ["model_params", "densification_params", "post_process_params", "omp_params"]
}
},
"properties": {
"/**": {
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/pointpainting"
}
},
"required": ["ros__parameters"]
}
},
"required": ["/**"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Parameters for RoI Cluster Fusion Node",
"type": "object",
"definitions": {
"roi_cluster_fusion": {
"type": "object",
"properties": {
"use_iou": {
"type": "boolean",
"description": "If this parameter is true, calculate the common IoU score.",
"default": false
},
"use_iou_x": {
"type": "boolean",
"description": "If this parameter is true, compute the IoU score in the x-direction",
"default": true
},
"use_iou_y": {
"type": "boolean",
"description": "If this parameter is true, calculate the IoU score in the y-direction.",
"default": false
},
"use_cluster_semantic_type": {
"type": "boolean",
"description": "If this parameter is false, label of cluster objects will be reset to UNKNOWN.",
"default": false
},
"only_allow_inside_cluster": {
"type": "boolean",
"description": "If this parameter is true, only clusters in which all their points are inside the RoI can be assigned to the RoI.",
"default": true
},
"roi_scale_factor": {
"type": "number",
"description": "A scale factor for resizing RoI while checking if cluster points are inside the RoI.",
"default": 1.1,
"minimum": 1.0,
"maximum": 2.0
},
"iou_threshold": {
"type": "number",
"description": "An IoU score threshold. Note that the total IoU score is the sum of the IoU scores that are set to true in use_iou, use_iou_x and use_iou_y.",
"default": 0.3,
"minimum": 0.0
},
"unknown_iou_threshold": {
"type": "number",
"description": "A threshold value of IoU score for objects labeled UNKNOWN.",
"default": 0.1,
"minimum": 0.0,
"maximum": 1.0
},
"remove_unknown": {
"type": "boolean",
"description": "If this parameter is true, all of objects labeled UNKNOWN will be removed in post-process.",
"default": false
},
"trust_distance": {
"type": "number",
"description": "A distance value to filtering out objects with its distance.",
"default": 100.0,
"minimum": 0.0
}
},
"required": [
"use_iou",
"use_iou_x",
"use_iou_y",
"use_cluster_semantic_type",
"only_allow_inside_cluster",
"roi_scale_factor",
"iou_threshold",
"unknown_iou_threshold",
"remove_unknown",
"trust_distance"
]
}
},
"properties": {
"/**": {
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/roi_cluster_fusion"
}
},
"required": ["ros__parameters"]
}
},
"required": ["/**"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Parameters for RoI Detected Object Fusion Node",
"type": "object",
"definitions": {
"roi_detected_object_fusion": {
"type": "object",
"properties": {
"passthrough_lower_bound_probability_thresholds": {
"type": "array",
"description": "An array of object probability thresholds. The objects that have higher probability than their respective thresholds are kept.",
"default": [0.35, 0.35, 0.35, 0.35, 0.35, 0.35, 0.35, 0.5]
},
"trust_distances": {
"type": "array",
"description": "An array of object distances thresholds. The objects that are closer than their respective thresholds kept.",
"default": [50.0, 100.0, 100.0, 100.0, 100.0, 50.0, 50.0, 50.0]
},
"min_iou_threshold": {
"type": "number",
"description": "An Iou threshold",
"default": 0.5,
"minimum": 0.0,
"maximum": 1.0
},
"roi_probability_threshold": {
"type": "number",
"description": "A object probability threshold.",
"default": 0.5,
"minimum": 0.0,
"maximum": 1.0
},
"use_roi_probability": {
"type": "boolean",
"description": "If this parameter is true, the objects are filtered out with their RoI probabilities.",
"default": false
},
"can_assign_matrix": {
"type": "array",
"description": "An NxN matrix, where N represents the number of classes. A value 1 indicates that it is assignable, while a value of 0 indicates not.",
"default": [
1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1,
0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0,
0, 0, 0, 1, 1, 1
]
}
},
"required": [
"passthrough_lower_bound_probability_thresholds",
"trust_distances",
"min_iou_threshold",
"roi_probability_threshold",
"use_roi_probability",
"can_assign_matrix"
]
}
},
"properties": {
"/**": {
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/roi_detected_object_fusion"
}
},
"required": ["ros__parameters"]
}
},
"required": ["/**"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Parameters for Synchronization of RoI Fusion Nodes",
"type": "object",
"definitions": {
"roi_sync": {
"type": "object",
"properties": {
"input_offset_ms": {
"type": "array",
"description": "An array of timestamp offsets for each camera [ms].",
"default": [61.67, 111.67, 45.0, 28.33, 78.33, 95.0]
},
"timeout_ms": {
"type": "number",
"description": "A timeout value can be assigned within a single frame [ms].",
"default": 70.0,
"minimum": 1.0,
"maximum": 100.0
},
"match_threshold_ms": {
"type": "number",
"description": "A maximum threshold value to synchronize RoIs from multiple cameras [ms].",
"default": 50.0,
"minimum": 0.0,
"maximum": 100.0
}
},
"required": ["input_offset_ms", "timeout_ms", "match_threshold_ms"]
}
},
"properties": {
"/**": {
"type": "object",
"properties": {
"ros__parameters": {
"$ref": "#/definitions/roi_sync"
}
},
"required": ["ros__parameters"]
}
},
"required": ["/**"]
}
Loading

0 comments on commit 83fca82

Please sign in to comment.