feat(perception): project recorded results into Rerun

This commit is contained in:
DCCONSTRUCTIONS
2026-07-19 17:39:13 +03:00
parent 31fc4f6567
commit 2b53168149
13 changed files with 1328 additions and 8 deletions
+16
View File
@@ -1,6 +1,7 @@
from __future__ import annotations
import asyncio
import shutil
from collections.abc import AsyncIterator, Iterable
from contextlib import asynccontextmanager, suppress
from pathlib import Path
@@ -13,6 +14,7 @@ from fastapi.staticfiles import StaticFiles
from pydantic import ValidationError
from k1link import __version__
from k1link.compute import RecordedPerceptionOverlayStore
from k1link.sessions import (
MaterializedRecording,
RecordedMediaInspector,
@@ -51,6 +53,19 @@ session_recording_materializer = SessionRecordingMaterializer(
session_recorded_media_inspector = RecordedMediaInspector(
session_store.data_dir / "recorded-media-preparations"
)
_ffmpeg = shutil.which("ffmpeg")
_ffprobe = shutil.which("ffprobe")
session_perception_overlay_store = (
RecordedPerceptionOverlayStore(
jobs_root=REPOSITORY_ROOT / ".runtime" / "compute-jobs",
results_root=REPOSITORY_ROOT / ".runtime" / "compute-results",
cache_root=session_store.data_dir / "perception-overlays",
ffmpeg_path=Path(_ffmpeg),
ffprobe_path=Path(_ffprobe),
)
if _ffmpeg is not None and _ffprobe is not None
else None
)
def _prepare_recorded_media_for_launch(
@@ -304,6 +319,7 @@ app.include_router(
recording_materializer=session_recording_materializer,
recording_preparation_manager=session_recording_preparation_manager,
media_inspector=session_recorded_media_inspector,
perception_overlay_provider=session_perception_overlay_store,
)
)