Skip to content

feat(BEvFusion): fix onnx export in BEVFusion-camera#190

Merged
KSeangTan merged 34 commits intotier4:mainfrom
KSeangTan:feat/fix_bevfusion_camera_onx
Mar 4, 2026
Merged

feat(BEvFusion): fix onnx export in BEVFusion-camera#190
KSeangTan merged 34 commits intotier4:mainfrom
KSeangTan:feat/fix_bevfusion_camera_onx

Conversation

@KSeangTan
Copy link
Collaborator

@KSeangTan KSeangTan commented Feb 27, 2026

Summary

This PR fixes a bug in BEVFusion-Camera export when converting geom_feats from int to float, which it should be int to align with Autoware deployment code.
The PR also cleans up and reorganize the code structure in the exporter.

Specifically, it makes the following changes:

  • Move non-deployment code to the correct if-else condition in LSS. [1]
  • Update camera backbone configs in the deployment. [2]
  • Update the order of inputs bevfusion-camera deployment with lidar points or without lidar points. [3], [4], [5]
  • Add extract_pts_inputs to decide if it needs pointclouds as input to the onnx model. [6]
  • Fix geom_feats data type from float to int [7]
  • Check if it needs to extract points and voxels in the data builder. [8]

Test performed

  • Tested and verified the exported onnx for both lidar and camera in Autoware

@KSeangTan KSeangTan self-assigned this Feb 27, 2026
@KSeangTan KSeangTan changed the title Feat/fix bevfusion camera onx feat(BEvFusion): fix onnx export in BEVFusion-camera Feb 27, 2026
@KSeangTan KSeangTan requested review from Copilot and removed request for SamratThapa120 March 2, 2026 13:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes BEVFusion camera(-only) ONNX export incompatibilities with downstream (Autoware) deployment expectations by correcting geom_feats dtype handling and aligning exporter input ordering with updated deployment configs, alongside some exporter/data-building refactors.

Changes:

  • Export: keep geom_feats as integer for camera BEV export and run ONNX graph fix-up after each export path.
  • Deploy pipeline: add/plumb extract_pts_inputs to control whether point/voxel inputs are extracted and passed through the builder/task processor.
  • Config updates: adjust deployment input ordering/shapes and rename output ONNX filenames; minor LSS refactor to avoid computing unused tensors when geom_feats are precomputed.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
projects/BEVFusion/deploy/voxel_detection.py Makes point/voxel extraction more conditional for export input creation.
projects/BEVFusion/deploy/utils.py Passes extract_pts_inputs into SetupConfigs.
projects/BEVFusion/deploy/exporter.py Moves ONNX graph fix-up to run after model export; fixes camera BEV input dtype/order.
projects/BEVFusion/deploy/data_classes.py Adds extract_pts_inputs to the setup configuration dataclass.
projects/BEVFusion/deploy/containers.py Updates camera-only container signature and optional inputs for reordered export inputs.
projects/BEVFusion/deploy/builder.py Threads extract_pts_inputs into task processor create_input.
projects/BEVFusion/configs/t4dataset/BEVFusion-L/bevfusion_lidar_voxel_second_secfpn_50e_4xb8_base_120m.py Normalizes user-path placeholders for dataset paths.
projects/BEVFusion/configs/deploy/bevfusion_main_body_lidar_only_tensorrt_dynamic.py Renames output ONNX filename for lidar-only deployment.
projects/BEVFusion/configs/deploy/bevfusion_main_body_lidar_only_intensity_tensorrt_dynamic.py Renames output ONNX filename for lidar-only-intensity deployment.
projects/BEVFusion/configs/deploy/bevfusion_camera_point_bev_tensorrt_dynamic.py Reorders camera-point inputs, adjusts shapes, and renames output ONNX filename.
projects/BEVFusion/configs/deploy/bevfusion_camera_backbone_tensorrt_dynamic.py Updates deployed image input dimensions and renames output ONNX filename.
projects/BEVFusion/bevfusion/depth_lss.py Avoids computing extrinsics-related tensors when using precomputed geom_feats.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@vividf vividf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@KSeangTan KSeangTan merged commit 2f0a32a into tier4:main Mar 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants