rpx_benchmark.tasks.sparse_depth
Sparse depth: predict depth at a set of pixel locations.
1"""Sparse depth: predict depth at a set of pixel locations.""" 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 = "sparse_rmse" 12 13 14@dataclass 15class SparseDepthRunConfig(TaskRunConfig): 16 pass 17 18 19def run_sparse_depth(cfg: SparseDepthRunConfig) -> PipelineResult: 20 return run_pipeline( 21 task=TaskType.SPARSE_DEPTH, 22 primary_metric=PRIMARY_METRIC, 23 cfg=cfg, 24 ) 25 26 27TASK_SPEC = TaskSpec( 28 task=TaskType.SPARSE_DEPTH, 29 display_name="Sparse Depth", 30 description="Predict depth at a given set of pixel locations.", 31 primary_metric=PRIMARY_METRIC, 32 required_modalities=["rgb", "depth", "sparse_depth"], 33 higher_is_better=False, 34 run=run_sparse_depth, 35) 36 37register_task(TASK_SPEC)
PRIMARY_METRIC =
'sparse_rmse'
SparseDepthRunConfig(model: 'Optional[BenchmarkableModel]' = None, split: 'Difficulty | str' =
SparseDepthRunConfig( 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_sparse_depth( cfg: SparseDepthRunConfig) -> Tuple[rpx_benchmark.metrics.registry.BenchmarkResult, rpx_benchmark.deployment.DeploymentReadinessReport, Dict[str, pathlib.Path]]:
TASK_SPEC =
TaskSpec(task=<TaskType.SPARSE_DEPTH: 'sparse_depth'>, display_name='Sparse Depth', primary_metric='sparse_rmse', required_modalities=['rgb', 'depth', 'sparse_depth'], run=<function run_sparse_depth>, higher_is_better=False, description='Predict depth at a given set of pixel locations.', temporal_stability_fn=None, geometric_coherence_fn=None)