Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pointpainting multiframe): add multi-sweep pointpainting #1462

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2696be3
pointpainting_fusion-paint points
tzhong518 Apr 11, 2022
41681d0
pointpainting_fusion:run the model
tzhong518 Apr 13, 2022
9738802
fix incorrect projection
tzhong518 Apr 20, 2022
bc80fca
update pointpainting_fusion using centerpoint as shared library
tzhong518 Apr 26, 2022
4b55948
pointpainting_fusion: fix uncommited node.cpp and node.hpp
tzhong518 Apr 26, 2022
2745511
fix: update the class
tzhong518 May 24, 2022
b213e54
fix: update the class
tzhong518 May 24, 2022
d4d6363
fix: small corrections
tzhong518 May 27, 2022
f5e7652
fix: correctionts to use centerpoint_trt.hpp
tzhong518 May 30, 2022
004406d
ci(pre-commit): autofix
pre-commit-ci[bot] May 30, 2022
17522e0
Merge branch 'autowarefoundation:main' into feature/pointpainting_fusion
tzhong518 May 31, 2022
6e65439
fix: resolve conversations
tzhong518 Jun 14, 2022
f5480d1
ci(pre-commit): autofix
pre-commit-ci[bot] Jun 14, 2022
47c6d84
fix: resolve conversations
tzhong518 Jun 15, 2022
5915e61
Merge branch 'feature/pointpainting_fusion' of github.com:tzhong518/a…
tzhong518 Jun 15, 2022
1d08963
ci(pre-commit): autofix
pre-commit-ci[bot] Jun 15, 2022
0b2c52a
fix: remove magic number
tzhong518 Jun 15, 2022
6d9fd01
Merge branch 'feature/pointpainting_fusion' of github.com:tzhong518/a…
tzhong518 Jun 15, 2022
c6bc2a4
fix: remove magic number7
tzhong518 Jun 15, 2022
190f7e8
fix: fix Cmakelist, doc, variable name and default value
tzhong518 Jun 21, 2022
3ecfaff
fix: CI build&precommit
tzhong518 Jun 24, 2022
5f25bc2
Merge branch 'autowarefoundation:main' into feature/pointpainting_fusion
tzhong518 Jun 24, 2022
79edef9
fix: pre-commit-optional&build(humble)
tzhong518 Jun 24, 2022
a670258
fix: move guard to publish()
tzhong518 Jun 28, 2022
5b97edc
ci(pre-commit): autofix
pre-commit-ci[bot] Jun 28, 2022
08b82b5
Merge branch 'autowarefoundation:main' into feature/pointpainting_fusion
tzhong518 Jun 29, 2022
f20cab5
Merge branch 'autowarefoundation:main' into feature/pointpainting_fusion
tzhong518 Jun 29, 2022
4d316ca
fix: update pointpainting model
tzhong518 Jul 1, 2022
28165ff
feat: latest update
Oct 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update pointpainting_fusion using centerpoint as shared library
  • Loading branch information
tzhong518 committed May 30, 2022
commit bc80fca2e15a807bca408b0d12b2ad04aa7a6cf3
42 changes: 12 additions & 30 deletions perception/image_projection_based_fusion/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,39 +78,10 @@ if(TRT_AVAIL AND CUDA_AVAIL AND CUDNN_AVAIL)

include_directories(
include
lib/include
${OpenCV_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}
${PCL_INCLUDE_DIRS}
${CUDA_INCLUDE_DIRS}
${TORCH_INCLUDE_DIRS}
)

### pointpainting_fusion ###
ament_auto_add_library(pointpainting_fusion SHARED
lib/src/centerpoint_trt.cpp
lib/src/pointcloud_densification.cpp
lib/src/voxel_generator.cpp
lib/src/tensorrt_wrapper.cpp
lib/src/network_trt.cpp
lib/src/utils.cpp
)

cuda_add_library(pointpainting_fusion_cuda_libraries SHARED
lib/src/circle_nms_kernel.cu
lib/src/postprocess_kernel.cu
lib/src/preprocess_kernel.cu
lib/src/scatter_kernel.cu
)

target_link_libraries(pointpainting_fusion
${NVINFER}
${NVONNXPARSER}
${CUDA_LIBRARIES}
${CUBLAS_LIBRARIES}
${CUDA_curand_LIBRARY}
${CUDNN_LIBRARY}
pointpainting_fusion_cuda_libraries
)

### node ###
Expand All @@ -122,13 +93,24 @@ if(TRT_AVAIL AND CUDA_AVAIL AND CUDNN_AVAIL)
src/roi_cluster_fusion/node.cpp
src/roi_detected_object_fusion/node.cpp
src/pointpainting_fusion/node.cpp
src/pointpainting_fusion/pointpainting_trt.cpp
src/pointpainting_fusion/voxel_generator.cpp
)

cuda_add_library(pointpainting_cuda_lib SHARED
src/pointpainting_fusion/preprocess_kernel.cu
)

target_link_libraries(${PROJECT_NAME}
pointpainting_fusion
${OpenCV_LIBRARIES}
${EIGEN3_LIBRARIES}
${PCL_LIBRARIES}
${NVINFER}
${CUDA_LIBRARIES}
${CUBLAS_LIBRARIES}
${CUDA_curand_LIBRARY}
${CUDNN_LIBRARY}
pointpainting_cuda_lib
)

rclcpp_components_register_node(${PROJECT_NAME}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@
ros__parameters:
class_names: ["CAR", "PEDESTRIAN", "BICYCLE"]
rename_car_to_truck_and_bus: true
point_feature_size: 6 # x, y, z and car, pedestrian, bicycle
max_voxel_size: 40000
point_cloud_range: [-76.8, -76.8, -3.0, 76.8, 76.8, 5.0]
voxel_size: [0.32, 0.32, 8.0]
downsample_factor: 2
encoder_in_feature_size: 11

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Copyright 2021 TIER IV, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef IMAGE_PROJECTION_BASED_FUSION__POINTPAINTING_TRT_HPP_
#define IMAGE_PROJECTION_BASED_FUSION__POINTPAINTING_TRT_HPP_

#include <image_projection_based_fusion/pointpainting_fusion/voxel_generator.hpp>
#include <lidar_centerpoint/centerpoint_trt.hpp>

namespace centerpoint
{
class PointPaintingTRT : public CenterPointTRT
{
public:
using CenterPointTRT::CenterPointTRT;

explicit PointPaintingTRT(
const NetworkParam & encoder_param, const NetworkParam & head_param,
const DensificationParam & densification_param, const CenterPointConfig & config);

~PointPaintingTRT();

protected:
bool preprocess(
const sensor_msgs::msg::PointCloud2 & input_pointcloud_msg,
const tf2_ros::Buffer & tf_buffer) override;

std::unique_ptr<image_projection_based_fusion::VoxelGeneratorTemplate> vg_ptr_pp{nullptr};
};
} // namespace centerpoint

#endif // IMAGE_PROJECTION_BASED_FUSION__POINTPAINTING_TRT_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef PREPROCESS_KERNEL_HPP_
#define PREPROCESS_KERNEL_HPP_
#ifndef IMAGE_PROJECTION_BASED_FUSION__PREPROCESS_KERNEL_HPP_
#define IMAGE_PROJECTION_BASED_FUSION__PREPROCESS_KERNEL_HPP_

#include <cuda.h>
#include <cuda_runtime_api.h>
Expand All @@ -22,8 +22,10 @@ namespace image_projection_based_fusion
{
cudaError_t generateFeatures_launch(
const float * voxel_features, const float * voxel_num_points, const int * coords,
const std::size_t num_voxels, float * features, cudaStream_t stream);
const std::size_t num_voxels, const std::size_t max_voxel_size, const float voxel_size_x,
const float voxel_size_y, const float voxel_size_z, const float range_min_x,
const float range_min_y, const float range_min_z, float * features, cudaStream_t stream);

} // namespace image_projection_based_fusion

#endif // PREPROCESS_KERNEL_HPP_
#endif // IMAGE_PROJECTION_BASED_FUSION__PREPROCESS_KERNEL_HPP_
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 TIER IV, Inc.
// Copyright 2021 TIER IV, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -12,30 +12,22 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef UTILS_HPP_
#define UTILS_HPP_
#ifndef IMAGE_PROJECTION_BASED_FUSION__VOXEL_GENERATOR_HPP_
#define IMAGE_PROJECTION_BASED_FUSION__VOXEL_GENERATOR_HPP_

#include <cstddef>
#include <lidar_centerpoint/preprocess/voxel_generator.hpp>

namespace image_projection_based_fusion
{
struct Box3D
class VoxelGenerator : public centerpoint::VoxelGenerator
{
// initializer not allowed for __shared__ variable
int label;
float score;
float x;
float y;
float z;
float length;
float width;
float height;
float yaw;
float vel_x;
float vel_y;
};
public:
using centerpoint::VoxelGenerator::VoxelGenerator;

std::size_t divup(const std::size_t a, const std::size_t b);
std::size_t pointsToVoxels(
std::vector<float> & voxels, std::vector<int> & coordinates,
std::vector<float> & num_points_per_voxel) override;
};
} // namespace image_projection_based_fusion

#endif // UTILS_HPP_
#endif // IMAGE_PROJECTION_BASED_FUSION__VOXEL_GENERATOR_HPP_
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<launch>
<arg name="input/rois_number" default="1"/>
<arg name="input/rois_number" default="6"/>
<arg name="input/rois0" default="rois0"/>
<arg name="input/camera_info0" default="/camera_info0"/>
<arg name="input/rois1" default="rois1"/>
Expand All @@ -18,7 +18,7 @@
<arg name="input/camera_info7" default="/camera_info7"/>
<arg name="input/pointcloud" default="/sensing/lidar/top/rectified/pointcloud"/>
<arg name="output/objects" default="objects"/>
<arg name="model_name" default="pointpainting" description="options: `default` or `aip_x2` or `pointpainting`"/>
<arg name="model_name" default="pointpainting" description="options: `pointpainting`"/>
<arg name="model_path" default="$(find-pkg-share image_projection_based_fusion)/data"/>
<arg name="model_param_path" default="$(find-pkg-share image_projection_based_fusion)/config/$(var model_name).param.yaml"/>

Expand Down Expand Up @@ -65,15 +65,15 @@
<node pkg="image_projection_based_fusion" exec="pointpainting_fusion_node" name="pointpainting" output="screen">
<remap from="~/input/pointcloud" to="$(var input/pointcloud)"/>
<remap from="~/output/objects" to="$(var output/objects)"/>
<param name="score_threshold" value="0.7"/>
<param name="score_threshold" value="0.45"/>
<param name="densification_world_frame_id" value="map"/>
<param name="densification_num_past_frames" value="0"/>
<param name="trt_precision" value="fp16"/>
<param name="encoder_onnx_path" value="$(var model_path)/pts_voxel_encoder_$(var model_name).onnx"/>
<param name="encoder_engine_path" value="$(var model_path)/pts_voxel_encoder_$(var model_name).engine"/>
<param name="head_onnx_path" value="$(var model_path)/pts_backbone_neck_head_$(var model_name).onnx"/>
<param name="head_engine_path" value="$(var model_path)/pts_backbone_neck_head_$(var model_name).engine"/>
<param from="$(var model_param_path)"/>
<param from="$(var model_param_path)"/>
<param name="rois_number" value="$(var input/rois_number)"/>

<!-- debug -->
Expand Down

This file was deleted.

This file was deleted.

Loading