py123d_detection.mmcv_export.writer

Writing the infos to a pickle that the training environment can read.

Conversion needs py123d (Python >= 3.9), while mmdetection3d setups are usually on Python 3.8 and numpy 1.x. Three things break a pickle across that gap:

  1. Pickle protocol 5 is unreadable before Python 3.8, so the default is 4.

  2. Any custom class (pathlib.Path, a 123D enum, …) only unpickles where it is importable. validate_portable() rejects everything but built-ins and numpy arrays before writing.

  3. Arrays pickled under numpy 2 fail to load under numpy 1 (No module named 'numpy._core'). Either install numpy<2 for the conversion, or write array_format="portable", which stores arrays as nested lists and needs py123d_detection.mmcv.plugin to rebuild them.

Functions

build_metadata(taxonomy_name, class_names, ...)

The metadata block stored next to the infos.

dump_infos(infos, output_path, metadata[, ...])

Write {'infos': ..., 'metadata': ...} for mmdetection3d.

inspect_pickle(path)

(metadata, number of infos) of an exported pickle.

numpy_compatibility_warnings(array_format)

to_portable_arrays(obj)

Recursively replace numpy arrays and scalars with lists and Python numbers.

validate_portable(obj[, path])

Raise PortabilityError on the first value that needs more than built-ins and numpy to unpickle.

Classes

WriteResult(path, num_infos, size_bytes, ...)

Exceptions

PortabilityError

The payload holds something that would not unpickle in a clean environment.