-
Notifications
You must be signed in to change notification settings - Fork 23
feat(BEVFusion): export bevfusion-camera onnx #183
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
Merged
KSeangTan
merged 34 commits into
tier4:main
from
KSeangTan:feat/export_bevfusion_camera
Feb 13, 2026
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
9bb04ce
Update docker installation commit for perception_evaluation
KSeangTan ebee4a0
Merge branch 'tier4:main' into main
KSeangTan 775f1d0
Resolve merge conflicts
KSeangTan edb373a
Merge branch 'tier4:main' into main
KSeangTan a358886
Merge branch 'tier4:main' into main
KSeangTan be329c4
Merge branch 'tier4:main' into main
KSeangTan 6b81116
Merge branch 'tier4:main' into main
KSeangTan 3e3c09d
Merge branch 'tier4:main' into main
KSeangTan 9de5ca0
Add them temp
KSeangTan fdeaa33
Merge branch 'tier4:main' into main
KSeangTan 33fc04c
Merge branch 'main' into feat/export_bevfusion_camera
KSeangTan e16ddee
Fix broken bevfusion exporter script
KSeangTan f4b02c6
Fix broken bevfusion exporter script
KSeangTan aa8c322
Fix broken bevfusion exporter script
KSeangTan a4bb4d6
Fix import statements
KSeangTan 7fadaf2
Fix import statements
KSeangTan a39a141
Fix import statements
KSeangTan cc67c65
Fix import statements
KSeangTan 3e3e60a
Fix import statements
KSeangTan 1b4b1f2
Fix camera outputs
KSeangTan a485b79
Fix camera outputs
KSeangTan 69590d2
Add docstring
KSeangTan 1c0a307
Add docstring
KSeangTan 29a00af
Add docstring
KSeangTan 9b71536
Merge branch 'tier4:main' into main
KSeangTan b208d49
Merge branch 'main' into feat/export_bevfusion_camera
KSeangTan 5132269
Update configs
KSeangTan 1c9b1c0
Add TODO for feature_dims
KSeangTan b38a970
Raise ValueError if num_proposal not found
KSeangTan 82e1e29
Remove _network from param
KSeangTan 8b60d10
Remove double commenting
KSeangTan 78f4337
Update readme
KSeangTan 7e3a271
Remove unnecessary model impoprt
KSeangTan e991644
Merge branch 'main' into feat/export_bevfusion_camera
KSeangTan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
93 changes: 93 additions & 0 deletions
93
projects/BEVFusion/configs/deploy/bevfusion_camera_point_bev_tensorrt_dynamic.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| codebase_config = dict(type="mmdet3d", task="VoxelDetection", model_type="end2end") | ||
|
|
||
| custom_imports = dict( | ||
| imports=[ | ||
| "projects.BEVFusion.deploy", | ||
| "projects.BEVFusion.bevfusion", | ||
| "projects.SparseConvolution", | ||
| ], | ||
| allow_failed_imports=False, | ||
| ) | ||
|
|
||
| depth_bins = 129 | ||
| # TODO(KokSeang): Read this parameter from a base config | ||
| feature_dims = (48, 96) | ||
| # image_dims = (640, 576) | ||
|
|
||
| backend_config = dict( | ||
| type="tensorrt", | ||
| common_config=dict(max_workspace_size=1 << 32), | ||
| model_inputs=[ | ||
| dict( | ||
| input_shapes=dict( | ||
| # TODO(TIERIV): Optimize. Now, using points will increase latency significantly | ||
| points=dict(min_shape=[5000, 4], opt_shape=[50000, 4], max_shape=[200000, 4]), | ||
| lidar2image=dict(min_shape=[1, 4, 4], opt_shape=[6, 4, 4], max_shape=[6, 4, 4]), | ||
| img_aug_matrix=dict(min_shape=[1, 4, 4], opt_shape=[6, 4, 4], max_shape=[6, 4, 4]), | ||
| geom_feats=dict( | ||
| min_shape=[0 * depth_bins * feature_dims[0] * feature_dims[1], 4], | ||
| opt_shape=[6 * depth_bins * feature_dims[0] * feature_dims[1] // 2, 4], | ||
| max_shape=[6 * depth_bins * feature_dims[0] * feature_dims[1], 4], | ||
| ), | ||
| kept=dict( | ||
| min_shape=[0 * depth_bins * feature_dims[0] * feature_dims[1]], | ||
| opt_shape=[6 * depth_bins * feature_dims[0] * feature_dims[1]], | ||
| max_shape=[6 * depth_bins * feature_dims[0] * feature_dims[1]], | ||
| ), | ||
| ranks=dict( | ||
| min_shape=[0 * depth_bins * feature_dims[0] * feature_dims[1]], | ||
| opt_shape=[6 * depth_bins * feature_dims[0] * feature_dims[1] // 2], | ||
| max_shape=[6 * depth_bins * feature_dims[0] * feature_dims[1]], | ||
| ), | ||
| indices=dict( | ||
| min_shape=[0 * depth_bins * feature_dims[0] * feature_dims[1]], | ||
| opt_shape=[6 * depth_bins * feature_dims[0] * feature_dims[1] // 2], | ||
| max_shape=[6 * depth_bins * feature_dims[0] * feature_dims[1]], | ||
| ), | ||
| image_feats=dict( | ||
| min_shape=[0, 256, feature_dims[0], feature_dims[1]], | ||
| opt_shape=[6, 256, feature_dims[0], feature_dims[1]], | ||
| max_shape=[6, 256, feature_dims[0], feature_dims[1]], | ||
| ), | ||
| ) | ||
| ) | ||
| ], | ||
| ) | ||
|
|
||
| onnx_config = dict( | ||
| type="onnx", | ||
| export_params=True, | ||
| keep_initializers_as_inputs=False, | ||
| opset_version=17, | ||
| save_file="camera_point_bev.onnx", | ||
| input_names=["points", "lidar2image", "img_aug_matrix", "geom_feats", "kept", "ranks", "indices", "image_feats"], | ||
| output_names=["bbox_pred", "score", "label_pred"], | ||
| dynamic_axes={ | ||
| "points": { | ||
| 0: "num_points", | ||
| }, | ||
| "lidar2image": { | ||
| 0: "num_imgs", | ||
| }, | ||
| "img_aug_matrix": { | ||
| 0: "num_imgs", | ||
| }, | ||
| "geom_feats": { | ||
| 0: "num_kept", | ||
| }, | ||
| "kept": { | ||
| 0: "num_geom_feats", | ||
| }, | ||
| "ranks": { | ||
| 0: "num_kept", | ||
| }, | ||
| "indices": { | ||
| 0: "num_kept", | ||
| }, | ||
| "image_feats": { | ||
| 0: "num_imgs", | ||
| }, | ||
| }, | ||
| input_shape=None, | ||
| verbose=True, | ||
| ) | ||
49 changes: 49 additions & 0 deletions
49
...cts/BEVFusion/configs/deploy/bevfusion_main_body_lidar_only_intensity_tensorrt_dynamic.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| codebase_config = dict(type="mmdet3d", task="VoxelDetection", model_type="end2end") | ||
|
|
||
| custom_imports = dict( | ||
| imports=[ | ||
| "projects.BEVFusion.deploy", | ||
| "projects.BEVFusion.bevfusion", | ||
| "projects.SparseConvolution", | ||
| ], | ||
| allow_failed_imports=False, | ||
| ) | ||
|
|
||
| backend_config = dict( | ||
| type="tensorrt", | ||
| common_config=dict(max_workspace_size=1 << 32), | ||
| model_inputs=[ | ||
| dict( | ||
| input_shapes=dict( | ||
| voxels=dict( | ||
| min_shape=[1, 10, 5], opt_shape=[64000, 10, 5], max_shape=[256000, 10, 5] | ||
| ), # [M, maximum number of points, features] features=5 when using intensity | ||
| coors=dict(min_shape=[1, 3], opt_shape=[64000, 3], max_shape=[256000, 3]), | ||
| num_points_per_voxel=dict(min_shape=[1], opt_shape=[64000], max_shape=[256000]), | ||
| ) | ||
| ) | ||
| ], | ||
| ) | ||
|
|
||
| onnx_config = dict( | ||
| type="onnx", | ||
| export_params=True, | ||
| keep_initializers_as_inputs=False, | ||
| opset_version=17, | ||
| save_file="main_body.onnx", | ||
| input_names=["voxels", "coors", "num_points_per_voxel"], | ||
| output_names=["bbox_pred", "score", "label_pred"], | ||
| dynamic_axes={ | ||
| "voxels": { | ||
| 0: "voxels_num", | ||
| }, | ||
| "coors": { | ||
| 0: "voxels_num", | ||
| }, | ||
| "num_points_per_voxel": { | ||
| 0: "voxels_num", | ||
| }, | ||
| }, | ||
| input_shape=None, | ||
| verbose=True, | ||
| ) |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,3 @@ | ||
| from . import base | ||
| from .voxel_detection import VoxelDetection | ||
|
|
||
| __all__ = [ | ||
| "base", | ||
| "VoxelDetection", | ||
| ] | ||
| __all__ = ["VoxelDetection"] |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.