Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f8f557d
feat: refactor config
vividf Feb 2, 2026
ec97293
chore: fix property
vividf Feb 2, 2026
e0a9448
chore: clean code
vividf Feb 2, 2026
b73d2da
chore: temp remove centerpoint files
vividf Feb 2, 2026
ce8dc0d
chore: clean code
vividf Feb 10, 2026
cb55c2a
feat: integrate centerpoint to deployment framework
vividf Feb 2, 2026
592e42a
chore: centerpoint - clean or {}
vividf Feb 2, 2026
9e3c362
chore: centerpoint-clean code
vividf Feb 2, 2026
7dfd76f
chore: temp remove centerpoint files
vividf Feb 2, 2026
691a992
chore: add files back
vividf Feb 2, 2026
3b1b173
ci(pre-commit): autofix
pre-commit-ci[bot] Feb 16, 2026
043a2ee
chore: clean code
vividf Feb 16, 2026
c474027
chore: update threshold for centerpoint
vividf Feb 18, 2026
11a1702
chore: clean up code
vividf Feb 18, 2026
caa8f5d
chore: refactor base config - centerpoint
vividf Mar 5, 2026
fb8a111
chore: clean up code: device spec, remove unused fucntion .etc - cent…
vividf Mar 10, 2026
b1ceb04
chore: fix Any
vividf Mar 10, 2026
175f075
chore: add docstring
vividf Mar 10, 2026
ace2afb
chore: refactor export compenent - centerpoint
vividf Mar 10, 2026
2261126
chore: fix more Device spec - centerpoint
vividf Mar 10, 2026
bd91470
chore: fix
vividf Mar 10, 2026
a387b49
chore: add more docstring
vividf Mar 10, 2026
e9b987b
chore: change file name
vividf Mar 10, 2026
ec0bafc
chore: remove redundant check
vividf Mar 10, 2026
d6c4dc6
chore: orangize directory
vividf Mar 11, 2026
54b0818
chore: rename sample file
vividf Mar 11, 2026
a6b9840
chore: remove init
vividf Mar 11, 2026
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
22 changes: 22 additions & 0 deletions deployment/projects/centerpoint/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""CenterPoint deployment bundle.

This package owns all CenterPoint deployment-specific code (runner/evaluator/loader/pipelines/export).
It registers a ProjectAdapter into the global `project_registry` so the unified CLI can invoke it.
"""

from __future__ import annotations

from deployment.projects.centerpoint.cli import add_args
from deployment.projects.centerpoint.entrypoint import run

# Trigger pipeline factory registration for this project.
from deployment.projects.centerpoint.pipelines.factory import CenterPointPipelineFactory # noqa: F401
from deployment.projects.registry import ProjectAdapter, project_registry

project_registry.register(
ProjectAdapter(
name="centerpoint",
add_args=add_args,
run=run,
)
)
14 changes: 14 additions & 0 deletions deployment/projects/centerpoint/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""CenterPoint CLI extensions."""

from __future__ import annotations

import argparse


def add_args(parser: argparse.ArgumentParser) -> None:
"""Register CenterPoint-specific CLI flags onto a project subparser."""
parser.add_argument(
"--rot-y-axis-reference",
action="store_true",
help="Convert rotation to y-axis clockwise reference (CenterPoint ONNX-compatible format)",
)
22 changes: 8 additions & 14 deletions deployment/projects/centerpoint/config/deploy_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
CenterPoint Deployment Configuration
"""

# ============================================================================
# Task type for pipeline building
# Options: 'detection2d', 'detection3d', 'classification', 'segmentation'
# ============================================================================
task_type = "detection3d"

# ============================================================================
# Checkpoint Path - Single source of truth for PyTorch model
# ============================================================================
Expand Down Expand Up @@ -38,16 +32,15 @@
# ============================================================================
# Unified Component Configuration (Single Source of Truth)
#
# Component key is the unique identifier (used for config lookup, filenames, logs).
# Each component defines:
# - name: Component identifier used in export
# - onnx_file: Output ONNX filename
# - engine_file: Output TensorRT engine filename
# - io: Input/output specification for ONNX export
# - tensorrt_profile: TensorRT optimization profile (min/opt/max shapes)
# ============================================================================
components = dict(
voxel_encoder=dict(
name="pts_voxel_encoder",
pts_voxel_encoder=dict(
onnx_file="pts_voxel_encoder.onnx",
engine_file="pts_voxel_encoder.engine",
io=dict(
Expand All @@ -70,8 +63,7 @@
),
),
),
backbone_head=dict(
name="pts_backbone_neck_head",
pts_backbone_neck_head=dict(
onnx_file="pts_backbone_neck_head.onnx",
engine_file="pts_backbone_neck_head.engine",
io=dict(
Expand Down Expand Up @@ -111,7 +103,7 @@
# ============================================================================
runtime_io = dict(
# This should be a path relative to `data_root` in the model config.
info_file="info/t4dataset_j6gen2_infos_val.pkl",
info_file="info/t4dataset_j6gen2_base_infos_test.pkl",
sample_idx=1,
)

Expand All @@ -128,6 +120,7 @@

# ============================================================================
# TensorRT Build Settings (shared across all components)
# Supports `auto`, `fp16`, `fp32_tf32`, and `strongly_typed`
# ============================================================================
tensorrt_config = dict(
precision_policy="auto",
Expand Down Expand Up @@ -161,10 +154,11 @@

# ============================================================================
# Verification Configuration
# Note that fp16 can failed in this tolerance (max difference > tolerance)
# ============================================================================
verification = dict(
enabled=False,
tolerance=1e-1,
enabled=True,
tolerance=1,
num_verify_samples=1,
devices=devices,
scenarios=dict(
Expand Down
79 changes: 79 additions & 0 deletions deployment/projects/centerpoint/entrypoint.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
"""CenterPoint deployment entrypoint invoked by the unified CLI."""

from __future__ import annotations

import argparse
import logging

from mmengine.config import Config

from deployment.cli.args import setup_logging
from deployment.configs import BaseDeploymentConfig
from deployment.core.contexts import CenterPointExportContext
from deployment.projects.centerpoint.eval.evaluator import CenterPointEvaluator
from deployment.projects.centerpoint.eval.metrics_utils import extract_t4metric_v2_config
from deployment.projects.centerpoint.io.data_loader import CenterPointDataLoader
from deployment.projects.centerpoint.runner import CenterPointDeploymentRunner

_REQUIRED_COMPONENTS = ("pts_voxel_encoder", "pts_backbone_neck_head")


def _validate_required_components(components_cfg) -> None:
"""Validate that all CenterPoint required components exist in the config.

Args:
components_cfg: Components config with get_component(name).

Raises:
KeyError or similar: If any of _REQUIRED_COMPONENTS is missing.
"""
for component_name in _REQUIRED_COMPONENTS:
components_cfg.get_component(component_name)


def run(args: argparse.Namespace) -> int:
"""Run the CenterPoint deployment workflow for the unified CLI.

Args:
args: Parsed command-line arguments containing deploy_cfg and model_cfg paths.

Returns:
Exit code (0 for success).
"""
logger = setup_logging(args.log_level)

deploy_cfg = Config.fromfile(args.deploy_cfg)
model_cfg = Config.fromfile(args.model_cfg)
config = BaseDeploymentConfig(deploy_cfg)

_validate_required_components(config.components_cfg)

logger.info("=" * 80)
logger.info("CenterPoint Deployment Pipeline (Unified CLI)")
logger.info("=" * 80)

data_loader = CenterPointDataLoader(
info_file=config.runtime_config.info_file,
model_cfg=model_cfg,
)
logger.info(f"Loaded {data_loader.num_samples} samples")

metrics_config = extract_t4metric_v2_config(model_cfg, logger=logger)

evaluator = CenterPointEvaluator(
model_cfg=model_cfg,
metrics_config=metrics_config,
components_cfg=config.components_cfg,
)

runner = CenterPointDeploymentRunner(
data_loader=data_loader,
evaluator=evaluator,
config=config,
model_cfg=model_cfg,
logger=logger,
)

context = CenterPointExportContext(rot_y_axis_reference=bool(getattr(args, "rot_y_axis_reference", False)))
runner.run(context=context)
return 0
Loading