py123detection.mmcv_export.export

One-call export: 123D sources in, an mmdetection3d .pkl out:

from py123detection import Source
from py123detection.mmcv_export import export_to_mmdet3d

export_to_mmdet3d(
    Source(data_root="/data/py123d", splits=["nuscenes-mini_train"]),
    output_path="/data/nuscenes/py123d_infos_train.pkl",
)

Several sources are merged into one pickle, which is how cross-dataset training (as in CoIn3D) consumes multiple datasets.

Functions

check_timestamp_ordering(infos)

Warning message if sorting by timestamp would split a log apart, else None.

export_to_mmdet3d(sources, output_path[, ...])

Export one or more 123D sources into a single mmdetection3d info pickle.

Classes

ExportReport(write, stats, metadata[, ...])

class py123detection.mmcv_export.export.ExportReport(write, stats, metadata, per_source_frames=<factory>, ordering_warning=None)[source]

Bases: object

write: WriteResult
stats: ExportStats
metadata: Dict[str, Any]
per_source_frames: Dict[str, int]
ordering_warning: str | None = None
summary()[source]
Return type:

str

py123detection.mmcv_export.export.check_timestamp_ordering(infos)[source]

Warning message if sorting by timestamp would split a log apart, else None.

NuScenesDataset.load_annotations sorts all infos by timestamp. That is harmless within one dataset, but merged datasets with overlapping timestamps get their logs interleaved, which breaks sequence samplers and temporal models.

Return type:

Optional[str]

py123detection.mmcv_export.export.export_to_mmdet3d(sources, output_path, config=None, version='py123d-v1.0', array_format='numpy', pickle_protocol=4, disjoint_timestamps=False, progress=True)[source]

Export one or more 123D sources into a single mmdetection3d info pickle.

Parameters:
  • version (str) – Stored as metadata['version'], which mmdet3d reads back.

  • array_format (str) – "numpy" or "portable", see dump_infos().

  • disjoint_timestamps (bool) – Offset each source’s timestamps so mmdet3d’s timestamp sort cannot interleave datasets.

Return type:

ExportReport