File size: 2,292 Bytes
31ffdfe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
29
30
31
32
33
34
35
36
37
38
39
40
# SPDX-License-Identifier: Apache-2.0
"""ASGI serving app of AutoE2E (Reactive v1.0, KITScenes checkpoint) on one Tenstorrent Blackhole p150: the HTTP
contract of the Autoware collection (vendored ``ttaw.server.app``) bound to :class:`tt_autoe2e.api.AutoE2E`.

    python -m uvicorn --host 0.0.0.0 --port 20000 --lifespan on tt_autoe2e.server.app:app

``POST /predict``: ``images`` (the 6 cameras ``front, front_left, front_right, rear_left, rear, rear_right``),
``calibration`` (``cameras.<name>.intrinsics`` / ``T_ref_from_camera``, or ``{"preset": "synthetic_rig"}``),
``stream`` (``id``, ``reset``, ``T_world_from_ego``), ``inputs`` (``egomotion_history`` [256], optional
``map_context`` [14, 450, 300] and ``route_mask`` [2, 450, 300]) -> ``trajectory`` [64, 6] (x, y, yaw, speed, accel,
curvature at 10 Hz) and ``meta.history_steps``. One stream at a time (a new id restarts the history); call it at
2 Hz per stream (the model's 500 ms history grid).
"""
from pathlib import Path

from .. import __version__
from ..api import AutoE2E
from ..ttaw.server.app import ServerSpec, create_app, parse_mesh_shape  # noqa: F401

__all__ = ["SPEC", "app", "parse_mesh_shape"]

SPEC = ServerSpec(
    model_name=AutoE2E.MODEL_NAME,
    env_prefix=AutoE2E.ENV_PREFIX,
    model_cls=AutoE2E,
    task="end-to-end driving: 6 cameras + navigation rasters + ego history -> a 6.4 s trajectory (AutoE2E Reactive)",
    default_weights=AutoE2E.DEFAULT_REPO,
    owner="changh95",
    io="6 cameras (+ calibration, ego pose) + the ego history and optional Lanelet2 map / route rasters per 500 ms "
       "step in; 64 x (x, y, yaw, speed, acceleration, curvature) at 10 Hz out",
    autoware={"package": "none (AutoE2E is a standalone end-to-end planner: autowarefoundation/auto_e2e)"},
    source={"repo": f"https://huggingface.co/changh95/{AutoE2E.MODEL_NAME}",
            "license": "code Apache-2.0; weights CC BY-NC-SA 4.0 (AutowareFoundation/auto_e2e)"},
    calib_dir=Path(__file__).resolve().parents[1] / "calib",
    version=__version__,
    description=f"{AutoE2E.MODEL_NAME}: AutoE2E (Autoware Foundation, Reactive v1.0, KITScenes checkpoint) on one "
                "Tenstorrent Blackhole p150, stateful per stream (the last 7 steps' image features on the device).",
)
app = create_app(SPEC)