py123detection.mmcv_export.sensors

Turning 123D sensor payloads into the file paths mmdetection3d reads.

123D stores a sensor stream either as a relative path into the original dataset (camera_store_option="path") or as embedded data (JPEG/PNG bytes, MP4 frames, binary point clouds). mmdet3d needs a file on disk either way:

reference

Join the stored relative path onto the dataset’s sensor root. No copies; only works for path-backed logs.

extract

Decode the payload through the scene API and write it under extract_root. Needed for embedded payloads, and usable to materialize a self-contained copy of path-backed logs.

auto references where a path is stored and extracts otherwise.

Classes

PathStyle(value)

SensorMode(value)

SensorResolver(config)

Resolves camera and lidar payloads for one export run.

SensorResolverConfig([camera_mode, ...])

Exceptions

class py123detection.mmcv_export.sensors.SensorMode(value)[source]

Bases: str, Enum

AUTO = 'auto'
REFERENCE = 'reference'
EXTRACT = 'extract'
class py123detection.mmcv_export.sensors.PathStyle(value)[source]

Bases: str, Enum

ABSOLUTE = 'absolute'
RELATIVE = 'relative'
class py123detection.mmcv_export.sensors.SensorResolverConfig(camera_mode=SensorMode.AUTO, lidar_mode=SensorMode.AUTO, path_style=PathStyle.ABSOLUTE, relative_to=None, extract_root=None, sensor_roots=<factory>, lidar_features=5, jpeg_quality=95)[source]

Bases: object

camera_mode: SensorMode = 'auto'
lidar_mode: SensorMode = 'auto'
path_style: PathStyle = 'absolute'
relative_to: Path | None = None
extract_root: Path | None = None
sensor_roots: Dict[str, Path]

Per-dataset sensor roots, e.g. {"nuscenes": Path("/data/nuscenes")}.

Datasets not listed fall back to py123d’s get_dataset_paths(), which reads NUSCENES_DATA_ROOT and friends from the environment.

lidar_features: int = 5

Float32 values per point in extracted lidar files. 5 is nuScenes’ (x, y, z, intensity, ring), what LoadPointsFromFile(load_dim=5) expects; features 123D lacks are zero-filled.

jpeg_quality: int = 95
exception py123detection.mmcv_export.sensors.SensorExtractionError[source]

Bases: RuntimeError

class py123detection.mmcv_export.sensors.SensorResolver(config)[source]

Bases: object

Resolves camera and lidar payloads for one export run.

resolve_camera(scene, iteration, camera_id, camera_name)[source]
Return type:

str

resolve_lidar(scene, iteration, lidar_id, ego_to_lidar=None)[source]

Path of the point cloud at one iteration, or None if there is none.

Parameters:

ego_to_lidar (Optional[ndarray]) – Applied to extracted points, which 123D hands out in the ego frame. None keeps the ego frame. Ignored for referenced files.

Return type:

Optional[str]