File size: 2,026 Bytes
aec3f16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# SPDX-License-Identifier: Apache-2.0
"""CPU reference of SceneSeg (Autoware VisionPilot): the ground truth every PCC / output-agreement gate of the TT port
compares against. Importable without ttnn; torch / onnx / onnxruntime are imported inside the functions that need
them.

- :mod:`.config`    what the port reproduces: artifact pins (ONNX / .pth sha256, Drive ids, the re-hosted weights
                    repo), network constants (COMPILE), the channel-order variants (LOAD), the node's pre- / post-
                    processing constants, the tap names with their ONNX tensors; every value with its source.
- :mod:`.weights`   the deployed ONNX's initializers addressed by consuming node (vendored ``ttaw.weights.OnnxWeights``;
                    no BN node is left in the export, so nothing is folded), checked against :data:`.weights.ARCH`
                    (108 layers written from the architecture); the same table from the upstream ``.pth`` /
                    re-hosted safetensors with the BatchNorms folded in fp64 (cross-check). The TT port loads its
                    weights with the same function.
- :mod:`.model`     ``SceneSegReference``: the deployed graph in fp32 torch, module by module (EfficientNet-B0
                    backbone, SceneContext, SceneNeck, SceneSegHead), with per-module taps
                    (``ttaw.golden.TapRegistry``) and teacher-forced partial runs for the TT module gates.
- :mod:`.ort`       the onnxruntime oracle of the deployed ONNX with taps as extra outputs (research and tests only).
- :mod:`.pipeline`  ``ReferencePipeline``: image -> host pre-processing -> network -> host post-processing ->
                    ``SceneSegMask``, the same output as ``SceneSeg.__call__``.
- :mod:`.assets`    where tests find the weights without downloading.

Pre- and post-processing live in ``tt_sceneseg.host`` (shared with the Python API). The ``to_dict()`` of the
pipeline's output on the shipped sample is stored as ``samples/<stem>.<variant>.reference.json``.
"""