Download code/tt_sceneseg/reference/__init__.py from changh95/sceneseg-p150: direct link, hf CLI and curl.
- Browser
- Download file 2.03 kB
-
https://huggingface.co/changh95/sceneseg-p150/resolve/main/code/tt_sceneseg/reference/__init__.py
- Command line
-
hf download hf://changh95/sceneseg-p150/code/tt_sceneseg/reference/__init__.py
-
curl -L -o __init__.py https://huggingface.co/changh95/sceneseg-p150/resolve/main/code/tt_sceneseg/reference/__init__.py
2.03 kB
| # 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``. | |
| """ | |