rpx-benchmark 0.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. rpx_benchmark/__init__.py +286 -0
  2. rpx_benchmark/adapters/__init__.py +59 -0
  3. rpx_benchmark/adapters/base.py +1077 -0
  4. rpx_benchmark/adapters/batched_depth.py +344 -0
  5. rpx_benchmark/adapters/batched_multimodal.py +368 -0
  6. rpx_benchmark/adapters/depth/__init__.py +32 -0
  7. rpx_benchmark/adapters/depth/skeletons.py +103 -0
  8. rpx_benchmark/adapters/depth_scaffold.py +380 -0
  9. rpx_benchmark/adapters/video_depth/__init__.py +31 -0
  10. rpx_benchmark/adapters/video_depth/skeletons.py +84 -0
  11. rpx_benchmark/api.py +599 -0
  12. rpx_benchmark/ar_pose_audit.py +850 -0
  13. rpx_benchmark/box_upload.py +576 -0
  14. rpx_benchmark/cell_log.py +554 -0
  15. rpx_benchmark/cleanup.py +173 -0
  16. rpx_benchmark/cli_ux.py +616 -0
  17. rpx_benchmark/data/__init__.py +57 -0
  18. rpx_benchmark/data/clip_dataset.py +251 -0
  19. rpx_benchmark/data/esd.py +899 -0
  20. rpx_benchmark/data/esd_scoring.py +784 -0
  21. rpx_benchmark/data/features.py +201 -0
  22. rpx_benchmark/data/hf_bridge.py +294 -0
  23. rpx_benchmark/data/load.py +125 -0
  24. rpx_benchmark/data/torch_dataloader.py +85 -0
  25. rpx_benchmark/dataset_hub/__init__.py +138 -0
  26. rpx_benchmark/dataset_hub/cli.py +797 -0
  27. rpx_benchmark/dataset_hub/croissant.py +113 -0
  28. rpx_benchmark/dataset_hub/croissant_template.json +140 -0
  29. rpx_benchmark/dataset_hub/dataset_card.py +345 -0
  30. rpx_benchmark/dataset_hub/downloader.py +376 -0
  31. rpx_benchmark/dataset_hub/ego_layout.py +275 -0
  32. rpx_benchmark/dataset_hub/lossless_convert.py +609 -0
  33. rpx_benchmark/dataset_hub/manifest.py +503 -0
  34. rpx_benchmark/dataset_hub/mock.py +282 -0
  35. rpx_benchmark/dataset_hub/packer.py +488 -0
  36. rpx_benchmark/dataset_hub/recipes.py +261 -0
  37. rpx_benchmark/dataset_hub/scanner.py +231 -0
  38. rpx_benchmark/dataset_hub/split_manifests.py +717 -0
  39. rpx_benchmark/dataset_hub/staging.py +198 -0
  40. rpx_benchmark/dataset_hub/uploader.py +245 -0
  41. rpx_benchmark/decode_contracts.py +189 -0
  42. rpx_benchmark/deployment.py +687 -0
  43. rpx_benchmark/determinism.py +153 -0
  44. rpx_benchmark/evaluators.py +372 -0
  45. rpx_benchmark/exceptions.py +215 -0
  46. rpx_benchmark/hub.py +716 -0
  47. rpx_benchmark/jedi.py +261 -0
  48. rpx_benchmark/loader.py +584 -0
  49. rpx_benchmark/logging_utils.py +218 -0
  50. rpx_benchmark/metrics/__init__.py +76 -0
  51. rpx_benchmark/metrics/depth.py +163 -0
  52. rpx_benchmark/metrics/depth_alignment.py +282 -0
  53. rpx_benchmark/metrics/depth_paper.py +234 -0
  54. rpx_benchmark/metrics/depth_robotics.py +306 -0
  55. rpx_benchmark/metrics/depth_temporal.py +768 -0
  56. rpx_benchmark/metrics/detection.py +60 -0
  57. rpx_benchmark/metrics/grounding.py +49 -0
  58. rpx_benchmark/metrics/keypoints.py +59 -0
  59. rpx_benchmark/metrics/pose.py +48 -0
  60. rpx_benchmark/metrics/registry.py +347 -0
  61. rpx_benchmark/metrics/segmentation.py +44 -0
  62. rpx_benchmark/metrics/sparse_depth.py +52 -0
  63. rpx_benchmark/metrics/specs.py +349 -0
  64. rpx_benchmark/metrics/tracking.py +53 -0
  65. rpx_benchmark/metrics/tracking_paper.py +178 -0
  66. rpx_benchmark/metrics/video_depth.py +352 -0
  67. rpx_benchmark/model_profiler.py +340 -0
  68. rpx_benchmark/paper_depth_analysis.py +525 -0
  69. rpx_benchmark/paper_tracking_analysis.py +413 -0
  70. rpx_benchmark/phi.py +1129 -0
  71. rpx_benchmark/phi_jedi_summary.py +460 -0
  72. rpx_benchmark/pose_conventions.py +36 -0
  73. rpx_benchmark/pose_metrics.py +538 -0
  74. rpx_benchmark/pose_pairs.py +711 -0
  75. rpx_benchmark/profiler.py +864 -0
  76. rpx_benchmark/py.typed +0 -0
  77. rpx_benchmark/reports.py +212 -0
  78. rpx_benchmark/runner.py +667 -0
  79. rpx_benchmark/schemas.py +340 -0
  80. rpx_benchmark/tasks/__init__.py +119 -0
  81. rpx_benchmark/tasks/_pipeline.py +340 -0
  82. rpx_benchmark/tasks/_video_pipeline.py +581 -0
  83. rpx_benchmark/tasks/detection.py +56 -0
  84. rpx_benchmark/tasks/keypoint_matching.py +38 -0
  85. rpx_benchmark/tasks/monocular_depth.py +45 -0
  86. rpx_benchmark/tasks/registry.py +109 -0
  87. rpx_benchmark/tasks/relative_pose.py +38 -0
  88. rpx_benchmark/tasks/robot_vqa.py +496 -0
  89. rpx_benchmark/tasks/robot_vqa_v2.py +436 -0
  90. rpx_benchmark/tasks/segmentation.py +64 -0
  91. rpx_benchmark/tasks/sparse_depth.py +37 -0
  92. rpx_benchmark/tasks/tracking.py +38 -0
  93. rpx_benchmark/tasks/video_depth.py +156 -0
  94. rpx_benchmark/tasks/visual_grounding.py +37 -0
  95. rpx_benchmark/tasks/vqa_generation.py +417 -0
  96. rpx_benchmark/temporal_budget_sweep.py +367 -0
  97. rpx_benchmark/video_loader.py +560 -0
  98. rpx_benchmark/vqa/__init__.py +30 -0
  99. rpx_benchmark/vqa/canonical.py +85 -0
  100. rpx_benchmark/vqa/contract.py +352 -0
  101. rpx_benchmark/vqa/evaluate.py +89 -0
  102. rpx_benchmark/vqa/hub_rgb.py +347 -0
  103. rpx_benchmark/vqa/metrics.py +276 -0
  104. rpx_benchmark/vqa/outputs.py +378 -0
  105. rpx_benchmark/vqa/prompts.py +309 -0
  106. rpx_benchmark/vqa/roster.py +117 -0
  107. rpx_benchmark/vqa/sampling.py +87 -0
  108. rpx_benchmark-0.3.0.dist-info/METADATA +268 -0
  109. rpx_benchmark-0.3.0.dist-info/RECORD +112 -0
  110. rpx_benchmark-0.3.0.dist-info/WHEEL +5 -0
  111. rpx_benchmark-0.3.0.dist-info/licenses/LICENSE +21 -0
  112. rpx_benchmark-0.3.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,286 @@
1
+ """RPX — choose and rank perception models for robot learning.
2
+
3
+ ``rpx_benchmark`` is the RPX benchmark toolkit: **dataset loaders,
4
+ task-specific metrics, hardware-agnostic profiling, and an adapter
5
+ protocol for plugging your model in**. The toolkit deliberately
6
+ ships no models — bring your own.
7
+
8
+ Bring your model as a :class:`BenchmarkableModel` (easiest: wrap a
9
+ numpy callable via ``make_numpy_<task>_model(fn)``; for full control
10
+ implement your own :class:`InputAdapter` / :class:`OutputAdapter`
11
+ pair). Hand it to the relevant ``run_<task>(config)`` entry point.
12
+
13
+ See the top-level README and the online documentation for the full
14
+ tour.
15
+ """
16
+
17
+ from . import exceptions, hub, logging_utils, metrics # noqa: F401 — side-effect registrations
18
+ from .adapters import (
19
+ BatchedDepthBenchmarkModel,
20
+ BatchedRelativePoseBenchmarkModel,
21
+ BatchedSegmentationBenchmarkModel,
22
+ BatchedTaskBenchmarkModel,
23
+ BenchmarkableModel,
24
+ InputAdapter,
25
+ OutputAdapter,
26
+ PreparedInput,
27
+ make_numpy_depth_model,
28
+ make_numpy_detection_model,
29
+ make_numpy_grounding_model,
30
+ make_numpy_keypoint_model,
31
+ make_numpy_mask_model,
32
+ make_numpy_pose_model,
33
+ make_numpy_sparse_depth_model,
34
+ make_numpy_tracking_model,
35
+ make_numpy_video_depth_model,
36
+ )
37
+ from .api import (
38
+ ESD_WEIGHTS,
39
+ BenchmarkModel,
40
+ DepthGroundTruth,
41
+ DepthPrediction,
42
+ DetectionGroundTruth,
43
+ DetectionPrediction,
44
+ Difficulty,
45
+ KeypointCorrespondenceGroundTruth,
46
+ KeypointCorrespondencePrediction,
47
+ Phase,
48
+ RelativePoseGroundTruth,
49
+ RelativePosePrediction,
50
+ Sample,
51
+ SegmentationGroundTruth,
52
+ SegmentationPrediction,
53
+ SparseDepthGroundTruth,
54
+ SparseDepthPrediction,
55
+ TaskType,
56
+ Tracklet,
57
+ TrackletGroundTruth,
58
+ TrackletPrediction,
59
+ VisualGroundingGroundTruth,
60
+ VisualGroundingPrediction,
61
+ )
62
+ from .cell_log import (
63
+ FIXED_COLUMNS,
64
+ cell_from_metrics,
65
+ cells_from_per_sample,
66
+ metric_col,
67
+ metric_keys,
68
+ read_cells,
69
+ write_cells,
70
+ )
71
+ from .deployment import (
72
+ DeploymentReadinessReport,
73
+ ESDResult,
74
+ OperatingPoint,
75
+ StackGeometricCoherenceResult,
76
+ StateTransitionRobustnessResult,
77
+ TemporalStabilityResult,
78
+ WeightedPhaseScore,
79
+ compute_esd,
80
+ compute_sgc,
81
+ compute_str,
82
+ compute_temporal_stability_depth,
83
+ compute_temporal_stability_seg,
84
+ compute_weighted_phase_score,
85
+ )
86
+ from .determinism import RPX_SEED, deterministic, seed_all
87
+ from .evaluators import BenchmarkResult, MetricSuite
88
+ from .exceptions import (
89
+ AdapterError,
90
+ ConfigError,
91
+ DatasetError,
92
+ DownloadError,
93
+ ManifestError,
94
+ MetricError,
95
+ ModelError,
96
+ RPXError,
97
+ )
98
+ from .hub import (
99
+ DEFAULT_REPO_ID,
100
+ DEFAULT_REVISION,
101
+ TASK_MODALITIES,
102
+ download_split,
103
+ fetch_manifest,
104
+ load,
105
+ mount,
106
+ )
107
+ from .loader import RPXDataset
108
+ from .logging_utils import configure_logging, get_logger
109
+ from .profiler import (
110
+ REFERENCE_GPUS,
111
+ EfficiencyMetadata,
112
+ GPUSpec,
113
+ LatencyProfiler,
114
+ MemoryProfiler,
115
+ RooflineBound,
116
+ SystemCard,
117
+ count_parameters,
118
+ estimate_memory_traffic_gb,
119
+ profile_model,
120
+ )
121
+ from .reports import format_markdown_summary, write_json
122
+ from .runner import BenchmarkRunner
123
+ from .tasks.detection import (
124
+ ObjectDetectionRunConfig,
125
+ run_object_detection,
126
+ run_open_vocab_detection,
127
+ )
128
+ from .tasks.keypoint_matching import KeypointMatchingRunConfig, run_keypoint_matching
129
+ from .tasks.monocular_depth import MonocularDepthRunConfig, run_monocular_depth
130
+ from .tasks.relative_pose import RelativePoseRunConfig, run_relative_pose
131
+ from .tasks.segmentation import SegmentationRunConfig, run_segmentation
132
+ from .tasks.sparse_depth import SparseDepthRunConfig, run_sparse_depth
133
+ from .tasks.tracking import ObjectTrackingRunConfig, run_object_tracking
134
+ from .tasks.video_depth import VideoDepthRunConfig, run_video_depth
135
+ from .tasks.visual_grounding import VisualGroundingRunConfig, run_visual_grounding
136
+
137
+ # Optional subpackages that require extras. We import them best-effort
138
+ # so `import rpx_benchmark` works without pydantic or datasets
139
+ # installed; users who want strict validation or the HF datasets
140
+ # bridge install the corresponding extras and then use `rpx.schemas`
141
+ # / `rpx.data` directly.
142
+ try:
143
+ from . import schemas # noqa: F401
144
+ except ImportError:
145
+ pass
146
+ try:
147
+ from . import data # noqa: F401
148
+ except ImportError:
149
+ pass
150
+
151
+ __all__ = [
152
+ # Enums
153
+ "TaskType",
154
+ "Phase",
155
+ "Difficulty",
156
+ "ESD_WEIGHTS",
157
+ # Data contracts
158
+ "Sample",
159
+ "DepthGroundTruth",
160
+ "DepthPrediction",
161
+ "DetectionGroundTruth",
162
+ "DetectionPrediction",
163
+ "SegmentationGroundTruth",
164
+ "SegmentationPrediction",
165
+ "Tracklet",
166
+ "TrackletGroundTruth",
167
+ "TrackletPrediction",
168
+ "VisualGroundingGroundTruth",
169
+ "VisualGroundingPrediction",
170
+ "RelativePoseGroundTruth",
171
+ "RelativePosePrediction",
172
+ "SparseDepthGroundTruth",
173
+ "SparseDepthPrediction",
174
+ "KeypointCorrespondenceGroundTruth",
175
+ "KeypointCorrespondencePrediction",
176
+ # Model base
177
+ "BenchmarkModel",
178
+ # Core harness
179
+ "RPXDataset",
180
+ "MetricSuite",
181
+ "BenchmarkResult",
182
+ "BenchmarkRunner",
183
+ # Per-axis components (Axis 2 — scene-change robustness)
184
+ "DeploymentReadinessReport",
185
+ "OperatingPoint",
186
+ "ESDResult",
187
+ "StackGeometricCoherenceResult",
188
+ "StateTransitionRobustnessResult",
189
+ "TemporalStabilityResult",
190
+ "WeightedPhaseScore",
191
+ "compute_esd",
192
+ "compute_sgc",
193
+ "compute_str",
194
+ "compute_temporal_stability_depth",
195
+ "compute_temporal_stability_seg",
196
+ "compute_weighted_phase_score",
197
+ # Profiler
198
+ "EfficiencyMetadata",
199
+ "GPUSpec",
200
+ "LatencyProfiler",
201
+ "MemoryProfiler",
202
+ "REFERENCE_GPUS",
203
+ "RooflineBound",
204
+ "SystemCard",
205
+ "estimate_memory_traffic_gb",
206
+ "profile_model",
207
+ "count_parameters",
208
+ # Cell log (per-(model, scene, phase) artefact every task uses)
209
+ "FIXED_COLUMNS",
210
+ "cell_from_metrics",
211
+ "cells_from_per_sample",
212
+ "metric_col",
213
+ "metric_keys",
214
+ "read_cells",
215
+ "write_cells",
216
+ # Hub
217
+ "hub",
218
+ "DEFAULT_REPO_ID",
219
+ "DEFAULT_REVISION",
220
+ "TASK_MODALITIES",
221
+ "download_split",
222
+ "fetch_manifest",
223
+ "load",
224
+ "mount",
225
+ # Adapters (framework)
226
+ "BenchmarkableModel",
227
+ "InputAdapter",
228
+ "OutputAdapter",
229
+ "PreparedInput",
230
+ "make_numpy_depth_model",
231
+ "make_numpy_video_depth_model",
232
+ "make_numpy_detection_model",
233
+ "make_numpy_grounding_model",
234
+ "make_numpy_keypoint_model",
235
+ "make_numpy_mask_model",
236
+ "make_numpy_pose_model",
237
+ "make_numpy_sparse_depth_model",
238
+ "make_numpy_tracking_model",
239
+ # Batched-dispatch wrappers (true GPU batching, not stock per-sample loop)
240
+ "BatchedTaskBenchmarkModel",
241
+ "BatchedDepthBenchmarkModel",
242
+ "BatchedSegmentationBenchmarkModel",
243
+ "BatchedRelativePoseBenchmarkModel",
244
+ # Task runners
245
+ "MonocularDepthRunConfig",
246
+ "run_monocular_depth",
247
+ "VideoDepthRunConfig",
248
+ "run_video_depth",
249
+ "SegmentationRunConfig",
250
+ "run_segmentation",
251
+ "ObjectDetectionRunConfig",
252
+ "run_object_detection",
253
+ "run_open_vocab_detection",
254
+ "VisualGroundingRunConfig",
255
+ "run_visual_grounding",
256
+ "RelativePoseRunConfig",
257
+ "run_relative_pose",
258
+ "KeypointMatchingRunConfig",
259
+ "run_keypoint_matching",
260
+ "SparseDepthRunConfig",
261
+ "run_sparse_depth",
262
+ "ObjectTrackingRunConfig",
263
+ "run_object_tracking",
264
+ "format_markdown_summary",
265
+ "write_json",
266
+ # Exceptions
267
+ "exceptions",
268
+ "RPXError",
269
+ "ConfigError",
270
+ "DatasetError",
271
+ "ManifestError",
272
+ "DownloadError",
273
+ "ModelError",
274
+ "AdapterError",
275
+ "MetricError",
276
+ # Logging
277
+ "logging_utils",
278
+ "get_logger",
279
+ "configure_logging",
280
+ # Determinism
281
+ "seed_all",
282
+ "deterministic",
283
+ "RPX_SEED",
284
+ # Plugin systems
285
+ "metrics",
286
+ ]
@@ -0,0 +1,59 @@
1
+ """Formal adapter framework for bringing models into the RPX benchmark.
2
+
3
+ The contract is intentionally minimal: preprocess the RPX ``Sample`` into
4
+ whatever the model wants, invoke the model, postprocess the output into
5
+ the RPX prediction contract. Users composing their own adapter stack
6
+ only need to touch the *model* -- the input and output adapters shipped
7
+ here handle the plumbing for common model families.
8
+
9
+ See :mod:`rpx_benchmark.adapters.base` for the core types and
10
+ the repository script ``scripts/depth_models/hf_pipeline.py`` for a
11
+ Hugging Face depth-pipeline wrapper.
12
+ """
13
+
14
+ from .base import (
15
+ BenchmarkableModel,
16
+ InputAdapter,
17
+ ModelInvoker,
18
+ OutputAdapter,
19
+ PreparedInput,
20
+ default_invoker,
21
+ make_numpy_depth_model,
22
+ make_numpy_detection_model,
23
+ make_numpy_grounding_model,
24
+ make_numpy_keypoint_model,
25
+ make_numpy_mask_model,
26
+ make_numpy_pose_model,
27
+ make_numpy_sparse_depth_model,
28
+ make_numpy_tracking_model,
29
+ make_numpy_video_depth_model,
30
+ )
31
+ from .batched_depth import BatchedDepthBenchmarkModel
32
+ from .batched_multimodal import (
33
+ BatchedRelativePoseBenchmarkModel,
34
+ BatchedSegmentationBenchmarkModel,
35
+ BatchedTaskBenchmarkModel,
36
+ )
37
+
38
+ __all__ = [
39
+ "BatchedDepthBenchmarkModel",
40
+ "BatchedRelativePoseBenchmarkModel",
41
+ "BatchedSegmentationBenchmarkModel",
42
+ "BatchedTaskBenchmarkModel",
43
+ "BenchmarkableModel",
44
+ "InputAdapter",
45
+ "ModelInvoker",
46
+ "OutputAdapter",
47
+ "PreparedInput",
48
+ "default_invoker",
49
+ # Per-task numpy fast paths
50
+ "make_numpy_depth_model",
51
+ "make_numpy_detection_model",
52
+ "make_numpy_grounding_model",
53
+ "make_numpy_keypoint_model",
54
+ "make_numpy_mask_model",
55
+ "make_numpy_pose_model",
56
+ "make_numpy_sparse_depth_model",
57
+ "make_numpy_tracking_model",
58
+ "make_numpy_video_depth_model",
59
+ ]