rlmesh.Recorder
Accumulates recorded workloads and exports them as one bundle.
Recorder(
*,
result_set_id: str | None = None,
fps: int = DEFAULT_FPS,
quality: int = DEFAULT_QUALITY,
)Each add() / capture() starts a new workload (one model x env x
task cell). A single capture hooks object may drive several run calls;
their episodes accumulate into that one workload, uniquely indexed.
Example – metrics only, path-agnostic::
rec = rlmesh.Recorder() result = rlmesh.run(model, env, episodes=50) rec.add(result, model=“smolvla”, env=“libero”, task=“libero-spatial-0”) rec.export(“results/run.zip”)
Example – with media, on the session path::
rec = rlmesh.Recorder() sess = rlmesh.session(model, env) sess.run( episodes=50, hooks=rec.capture(model=“smolvla”, env=“libero”, task=“libero-spatial-0”), ) rec.export(“results/run.zip”)
Attributes
Methods
- add()Record a completed
RunResultas a new workload (no media). - capture()A
RunHooksthat records a live run into a new workload. - to_dict()The
rlmesh.result.v1document as a JSON-native dict. - export()Write the bundle to
pathand return it. - close()Remove the temp staging dir holding captured frame stacks.
result_set_id
property[source]property result_set_id: strThe locally minted id anchoring this bundle (re-upload dedupe key).
workloads
property[source]property workloads: tuple[WorkloadRecord, ...]The workloads recorded so far, in the order they were started.
add
function[source]add(
result: RunResult,
*,
model: str,
env: str,
task: str | None = None,
config: dict[str, Any] | None = None,
included_in_metrics: bool = True,
)capture
function[source]capture(
*,
model: str,
env: str,
task: str | None = None,
config: dict[str, Any] | None = None,
cameras: list[str] | None = None,
session: RunContext | None = None,
video_info_keys: tuple[str, ...] = DEFAULT_VIDEO_INFO_KEYS,
included_in_metrics: bool = True,
)A RunHooks that records a live run into a new workload.
Frame sourcing:
- By default the recorded sources are auto-discovered on the first step
from the session running the hooks (received via
on_run_start()): the env’srender()frame (when it exposes an rgb render mode) plus every declared image role, each to its own video – exactly the sources the live viewer offers, under the same labels. cameras– explicit sources to record each step: env image roles (read as HWC) and/or"render"for the env’srender()frame.cameras=[]opts out of frames entirely (metrics only).session– only needed when driving the hooks by hand (outside arun); an explicitly passed session also wins over the running loop’sRunContext. Therender()frame is reachable on the session loop and, on the nativeModel.runloop, for a local env object; a vector env is refused unlesscameras=[].
video_info_keys name the step-info keys checked for an env-produced
video file path (the env renders its own video); the file is copied into the
bundle. Recorded frames are encoded to AV1 mp4 in process.
to_dict
function[source]to_dict(*, recorded_at: str | None = None)The rlmesh.result.v1 document as a JSON-native dict.
export
function[source]export(
path: str | Path,
*,
archive: bool | str | None = None,
recorded_at: str | None = None,
)Write the bundle to path and return it.
Writes a folder by default, or a zip when path ends .zip or
archive is True / "zip". archive=False forces a folder.
close
function[source]close()Remove the temp staging dir holding captured frame stacks. Idempotent.
Call after export(). Staged files are also under the OS temp dir, so a
missed close is cleaned by the OS eventually.