Skip to content

Commit

Permalink
add centerpoint detector
Browse files Browse the repository at this point in the history
  • Loading branch information
SeasoulChris committed Jul 22, 2022
1 parent 484c449 commit 986fe47
Show file tree
Hide file tree
Showing 11 changed files with 805 additions and 5 deletions.
29 changes: 27 additions & 2 deletions modules/perception/common/perception_gflags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,32 @@ DEFINE_string(mask_bbox_head_torch_file,
"models/detection/mask_pillars/pts_bbox_head.zip",
"The path of pillars bbox head torch file.");

// lidar_center_point
DEFINE_string(center_point_model_file,
"/apollo/modules/perception/production/data/perception/lidar/"
"models/detection/center_point/centerpoint.pdmodel",
"The path of center point model file.");
DEFINE_string(center_point_params_file,
"/apollo/modules/perception/production/data/perception/lidar/"
"models/detection/center_point/centerpoint.pdiparams",
"The path of center point params file.");
DEFINE_bool(use_trt, true, "True if preprocess in CPU mode.");
DEFINE_int32(trt_precision, 1,
"Precision type of tensorrt, 0: kFloat32, 1: kHalf");
DEFINE_int32(
trt_use_static, 0,
"Whether to load the tensorrt graph optimization from a disk path");
DEFINE_string(
trt_static_dir,
"/apollo/modules/perception/lidar/lib/detector/center_point_detection/",
"Path of a tensorrt graph optimization directory");
DEFINE_int32(collect_shape_info, 1,
"Whether to collect dynamic shape before using tensorrt");
DEFINE_string(dynamic_shape_file,
"/apollo/modules/perception/production/data/perception/lidar/"
"models/detection/center_point/collect_shape_info.pbtxt",
"Path of a dynamic shape file for tensorrt");

// emergency detection onnx
DEFINE_string(onnx_obstacle_detector_model,
"/apollo/modules/perception/camera"
Expand All @@ -141,7 +167,6 @@ DEFINE_string(torch_detector_model,
"The torch model file for emergency detection");

// lidar sensor name
DEFINE_string(lidar_sensor_name, "velodyne128",
"lidar sensor name");
DEFINE_string(lidar_sensor_name, "velodyne128", "lidar sensor name");
} // namespace perception
} // namespace apollo
10 changes: 10 additions & 0 deletions modules/perception/common/perception_gflags.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ DECLARE_string(mask_backbone_torch_file);
DECLARE_string(mask_fpn_torch_file);
DECLARE_string(mask_bbox_head_torch_file);

// lidar_center_point
DECLARE_string(center_point_model_file);
DECLARE_string(center_point_params_file);
DECLARE_bool(use_trt);
DECLARE_int32(trt_precision);
DECLARE_int32(trt_use_static);
DECLARE_string(trt_static_dir);
DECLARE_int32(collect_shape_info);
DECLARE_string(dynamic_shape_file);

// emergency detection onnx
DECLARE_string(onnx_obstacle_detector_model);
DECLARE_string(onnx_test_input_path);
Expand Down
1 change: 1 addition & 0 deletions modules/perception/lidar/app/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ cc_library(
"//modules/perception/lidar/lib/interface:base_lidar_obstacle_detection",
"//modules/perception/lidar/lib/pointcloud_preprocessor:pointcloud_preprocessor",
"//modules/perception/lidar/lib/detector/point_pillars_detection:point_pillars_detection",
"//modules/perception/lidar/lib/detector/center_point_detection:center_point_detection",
"//modules/perception/lidar/lib/detector/cnn_segmentation:cnn_segmentation",
"//modules/perception/lidar/lib/detector/mask_pillars_detection:mask_pillars_detection",
"//modules/perception/lidar/lib/detector/ncut_segmentation:ncut_segmentation",
Expand Down
3 changes: 2 additions & 1 deletion modules/perception/lidar/app/lidar_obstacle_detection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ bool LidarObstacleDetection::Init(
use_map_manager_ = config.use_map_manager();
use_object_filter_bank_ = config.use_object_filter_bank();
use_object_builder_ = ("PointPillarsDetection" != config.detector() ||
"MaskPillarsDetection" != config.detector());
"MaskPillarsDetection" != config.detector() ||
"CenterPointDetection" != config.detector());

use_map_manager_ = use_map_manager_ && options.enable_hdmap_input;

Expand Down
42 changes: 42 additions & 0 deletions modules/perception/lidar/lib/detector/center_point_detection/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
load("@local_config_cuda//cuda:build_defs.bzl", "cuda_library")
load("//tools:cpplint.bzl", "cpplint")

package(default_visibility = ["//visibility:public"])

cc_library(
name = "center_point_detection",
srcs = [
"center_point_detection.cc",
],
hdrs = [
"center_point_detection.h",
],
deps = [
":params",
"//cyber/common",
"//modules/perception/base",
"//modules/perception/common:perception_gflags",
"//modules/perception/lidar/common",
"//modules/perception/lidar/lib/interface:base_lidar_detector",
"//modules/perception/lib/thread",
"@centerpoint_infer_op//:centerpoint_infer_op",
"@eigen",
"@local_config_pcl//:pcl",
"@local_config_tensorrt//:tensorrt",
"@paddleinference//:paddleinference_lib",
],
alwayslink = True,
)

cc_library(
name = "common",
hdrs = ["common.h"],
)

cc_library(
name = "params",
hdrs = ["params.h"],
)

cpplint()
Loading

0 comments on commit 986fe47

Please sign in to comment.