Skip to content

UI (rpx_benchmark.ui)

Terminal output helper used by the CLI: a rich-based backend when the rich package is available, a plain-text backend otherwise. Both backends share the same interface (header, stage, result table, phase score table, efficiency table, progress callback, footer), so library code stays agnostic to which one is active.

ui

Terminal UX for the RPX CLI.

Degrades gracefully: if rich is installed we emit Claude-Code-style panels, spinners, and a live progress bar. Without rich we fall back to plain print lines so the CLI is still usable over bare ssh, CI logs, and in scripts.

Usage::

from rpx_benchmark.ui import ConsoleUI
ui = ConsoleUI.auto()
ui.header("Monocular Depth", model="depth_pro", split="hard")
with ui.stage("Downloading split"):
    ...
ui.result_table(result.aggregated)
ui.phase_score_table(dr_report.weighted_phase_score)
ui.progress_cb(total_samples)   # returns a ProgressCallback

The module is import-safe even when rich is missing.

ConsoleUI(_backend: Any) dataclass

Thin wrapper delegating to either the rich or plain backend.