rpx_benchmark.tasks.relative_pose
Relative camera pose between two frames.
1"""Relative camera pose between two frames.""" 2 3from __future__ import annotations 4 5from dataclasses import dataclass 6 7from ..api import TaskType 8from ._pipeline import PipelineResult, TaskRunConfig, run_pipeline 9from .registry import TaskSpec, register_task 10 11PRIMARY_METRIC = "rotation_error_deg" 12 13 14@dataclass 15class RelativePoseRunConfig(TaskRunConfig): 16 pass 17 18 19def run_relative_pose(cfg: RelativePoseRunConfig) -> PipelineResult: 20 return run_pipeline( 21 task=TaskType.RELATIVE_CAMERA_POSE, 22 primary_metric=PRIMARY_METRIC, 23 cfg=cfg, 24 compute_ts=False, 25 ) 26 27 28TASK_SPEC = TaskSpec( 29 task=TaskType.RELATIVE_CAMERA_POSE, 30 display_name="Relative Camera Pose", 31 description="6-DoF pose of frame B relative to frame A.", 32 primary_metric=PRIMARY_METRIC, 33 required_modalities=["rgb", "pose"], 34 higher_is_better=False, 35 run=run_relative_pose, 36) 37 38register_task(TASK_SPEC)
PRIMARY_METRIC =
'rotation_error_deg'
RelativePoseRunConfig(model: 'Optional[BenchmarkableModel]' = None, split: 'Difficulty | str' =
RelativePoseRunConfig( model: Optional[rpx_benchmark.adapters.BenchmarkableModel] = None, split: rpx_benchmark.api.Difficulty | str = <Difficulty.HARD: 'hard'>, repo_id: Optional[str] = None, cache_dir: Optional[str] = None, revision: Optional[str] = '51432e5d48895bbafb490ae7c5e34e0f6b7da7d6', batch_size: int = 1, require_cuda: bool = False, skip_flops: bool = False, max_samples: Optional[int] = None, manifest_path: Optional[str] = None, device: str = 'cuda', output_dir: Optional[str] = None, progress: Optional[Callable[[int, Optional[int], str], NoneType]] = None, metric_suite: Optional[rpx_benchmark.metrics.MetricSuite] = None, upload_to_box: bool = False, box_folder_id: Optional[str] = None)
def
run_relative_pose( cfg: RelativePoseRunConfig) -> Tuple[rpx_benchmark.metrics.registry.BenchmarkResult, rpx_benchmark.deployment.DeploymentReadinessReport, Dict[str, pathlib.Path]]:
TASK_SPEC =
TaskSpec(task=<TaskType.RELATIVE_CAMERA_POSE: 'relative_camera_pose'>, display_name='Relative Camera Pose', primary_metric='rotation_error_deg', required_modalities=['rgb', 'pose'], run=<function run_relative_pose>, higher_is_better=False, description='6-DoF pose of frame B relative to frame A.', temporal_stability_fn=None, geometric_coherence_fn=None)