File size: 1,967 Bytes
4d9b003 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | # SPDX-License-Identifier: Apache-2.0
"""Host pre- and post-processing of the Autoware Diffusion Planner (numpy only, no ttnn, no torch).
Exact ports of the node's host code (autoware_universe @ 9ceaccf ``planning/autoware_diffusion_planner``) and of
the in-graph pre-processing of the encoder that the TT port moves to the host (PLAN.md section 2.12 "Host fallbacks":
normalization, position features, masks, post-processing):
- :mod:`.normalize` input normalization that keeps all-zero rows at zero, speed-limit masks
(``preprocessing_utils.cpp:34-84``, ``inference/utils.hpp:112-123``);
- :mod:`.features` what the encoder graph computes before its first matmul: history truncation, validity masks,
the neighbour velocity zeroing and valid-step flag, lane attributes and speed selection, polygon / line-string
deltas, the 14-dim position features (ONNX ``atan2`` decomposition and the polygon / line-string pseudo-heading
quirk), the fusion key mask; decoder agent mask and current states (SPEC 3.8, 4.3);
- :mod:`.solver` DPM-Solver++(2M) with denoise-to-zero, its float32 scalar schedule computed with the C library
like ``dpm_solver.cpp``, the prefix constraint (``multi_step_inference.cpp:300-340``);
- :mod:`.postprocess` denormalization, poses with Eigen's quaternion of the unnormalised rotation, the trajectory
velocity / force-stop / acceleration rules, predicted neighbour paths, the turn-indicator decision
(``postprocessing_utils.cpp``, ``turn_indicator_manager.cpp``);
- :mod:`.pipeline` ``prepare(raw) -> Prepared`` and ``make_output(...) -> Trajectory``: the two halves the Python
API, the HTTP server and the CPU reference share around the network.
Importing this package has no side effects.
"""
from .normalize import normalize_inputs, speed_masks # noqa: F401
from .pipeline import Prepared, make_output, prepare # noqa: F401
__all__ = ["normalize_inputs", "speed_masks", "Prepared", "prepare", "make_output"]
|