feat(BEvFusion): fix onnx export in BEVFusion-camera#190
Merged
KSeangTan merged 34 commits intotier4:mainfrom Mar 4, 2026
Merged
feat(BEvFusion): fix onnx export in BEVFusion-camera#190KSeangTan merged 34 commits intotier4:mainfrom
KSeangTan merged 34 commits intotier4:mainfrom
Conversation
Signed-off-by: Kok Seang Tan <kseangtan@gmail.com>
amadeuszsz
reviewed
Mar 2, 2026
...VFusion/configs/t4dataset/BEVFusion-C/bevfusion_camera_swin_fpn_30e_4xb8_j6gen2_base_120m.py
Outdated
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment.
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_featsas integer for camera BEV export and run ONNX graph fix-up after each export path. - Deploy pipeline: add/plumb
extract_pts_inputsto 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_featsare 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.
projects/BEVFusion/configs/deploy/bevfusion_camera_point_bev_tensorrt_dynamic.py
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes a bug in BEVFusion-Camera export when converting
geom_featsfrominttofloat, which it should beintto align with Autoware deployment code.The PR also cleans up and reorganize the code structure in the exporter.
Specifically, it makes the following changes:
extract_pts_inputsto decide if it needs pointclouds as input to the onnx model. [6]floattoint[7]Test performed