Download code/tt_diffusion_planner/host/__init__.py from changh95/diffusion-planner-p150: direct link, hf CLI and curl.
- Browser
- Download file 1.97 kB
-
https://huggingface.co/changh95/diffusion-planner-p150/resolve/main/code/tt_diffusion_planner/host/__init__.py
- Command line
-
hf download hf://changh95/diffusion-planner-p150/code/tt_diffusion_planner/host/__init__.py
-
curl -L -o __init__.py https://huggingface.co/changh95/diffusion-planner-p150/resolve/main/code/tt_diffusion_planner/host/__init__.py
1.97 kB
| # 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"] | |