feat(deployment): refactor config and clean code #180
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 refactoring introduces a unified component configuration system to simplify deployment configuration for multi-component models (e.g., CenterPoint) and cleans up API interfaces to improve maintainability and type safety.
Key Changes
1. Unified Component Configuration System
Problem: Configuration was scattered across multiple places (
model_io,backend_config,onnx_config, etc.), making it difficult to configure multi-component models and maintain consistency.Solution: Introduce a unified
componentsconfiguration structure as a single source of truth. Each component defines its name, file paths, I/O specification, and TensorRT profile in one place.2. Improved Artifact Path Resolution
Problem: Path resolution logic was scattered with no unified interface, missing support for multi-component models and path validation.
Solution: Add centralized path resolution functions with unified strategy. Require
base_dirto be a directory and read filenames fromcomponentsconfig. Add path security checks to prevent traversal and validate file existence.####3. Configuration Class Refactoring
BackendConfig→TensorRTConfigfor clearer namingcommon_configcomponents.*.tensorrt_profilefor per-component configurationcomponentsstructure4. Evaluation System Improvements
DetectionSummaryto support multiple matching modesmAP_by_modeandmAPH_by_mode** Note: I will create a separate PR to refactor the detection3d metrics after completing the t4metrics refactor. At that point, detection3d will directly use t4metricsv2.**