py123d_detection.taxonomy

Mapping 123D box labels onto the class_names tuple of an mmdet3d config.

A Taxonomy turns a 123D label into one of its class names, or drops the box. Lookups go from most to least specific:

  1. native_map by qualified enum member ("AV2SensorBoxDetectionLabel.BICYCLIST"), for when the same member name exists in several datasets and only one should be overridden;

  2. native_map by bare member name ("VEHICLE_CAR");

  3. default_map by DefaultBoxDetectionLabel member ("VEHICLE"). Every 123D dataset implements to_default(), so a default-level taxonomy works for all of them, which is what cross-dataset merges rely on.

Labels that resolve to VOID, or to nothing, are dropped.

Some datasets box a rider separately from the vehicle they are on: Argoverse 2 and KITTI-360 annotate BICYCLIST next to BICYCLE, while nuScenes and Waymo annotate one object. MergeRule reconciles them by pairing the two boxes and emitting their hull, so the same scene yields the same objects whichever dataset it came from. A rule’s sources are intermediate class names, reachable from a label but absent from Taxonomy.class_names, which is what keeps a rule scoped to the datasets that need it. Anything still intermediate after merging is dropped.

Module Attributes

VOID

Target class name that drops a label.

NUSCENES_DETECTION

The standard nuScenes 10-class benchmark, in mmdet3d's class order.

GENERAL_3CLS

Cross-dataset vehicle / pedestrian / cyclist over the default labels.

COIN3D_3CLS

CoIn3D's unified classes, spelled with nuScenes names on purpose: the devkit's DetectionBox only accepts the ten nuScenes detection names, and reusing three of them lets any dataset be scored with the unmodified metric code.

MIXED_8CLS

Eight classes: the nuScenes ten with construction_vehicle folded into truck and barrier dropped.

MIXED2_3CLS

Three classes across datasets: everything that drives is vehicle, a motorcycle included, and only a bicycle stays separate.

MIXED3_1CLS

One class: everything that drives, a motorcycle and its rider included.

VEHICLE_1CLS

A single vehicle class over the default labels (VEHICLE and TRAIN).

DEFAULT_123D

Identity over DefaultBoxDetectionLabel, minus EGO.

TAXONOMIES

The values accepted by --taxonomy.

Functions

class_permutation(old_class_names, ...)

Indices that reorder rows laid out as old_class_names into new_class_names.

get_taxonomy(name)

remap_head_classes(state_dict, ...[, marker])

Reorder a trained classification head from one class order to another.

Classes

MergeRule(target, sources[, ...])

Combine a rider and its vehicle into one box.

Taxonomy(name, class_names[, native_map, ...])

An ordered class list plus the rules mapping 123D labels onto it.

py123d_detection.taxonomy.VOID = 'void'

Target class name that drops a label.

py123d_detection.taxonomy.NUSCENES_DETECTION = Taxonomy(name='nuscenes_detection_10cls')

The standard nuScenes 10-class benchmark, in mmdet3d’s class order. Native-level only, so any other dataset exported with it drops every box.

py123d_detection.taxonomy.GENERAL_3CLS = Taxonomy(name='general_3cls')

Cross-dataset vehicle / pedestrian / cyclist over the default labels.

py123d_detection.taxonomy.COIN3D_3CLS = Taxonomy(name='coin3d_3cls')

CoIn3D’s unified classes, spelled with nuScenes names on purpose: the devkit’s DetectionBox only accepts the ten nuScenes detection names, and reusing three of them lets any dataset be scored with the unmodified metric code. CoIn3D’s mapping (data_preprocess/README.md): nuScenes car/truck/trailer/bus/construction_vehicle -> car, pedestrian -> pedestrian, bicycle/motorcycle -> motorcycle; Lyft car/truck/bus/emergency_vehicle/other_vehicle -> car; Waymo VEHICLE/PEDESTRIAN/CYCLIST.

py123d_detection.taxonomy.MIXED_8CLS = Taxonomy(name='mixed_8cls')

Eight classes: the nuScenes ten with construction_vehicle folded into truck and barrier dropped. The thesis called this “mixed”.

py123d_detection.taxonomy.MIXED2_3CLS = Taxonomy(name='mixed2_3cls')

Three classes across datasets: everything that drives is vehicle, a motorcycle included, and only a bicycle stays separate. The thesis called this “mixed2”.

py123d_detection.taxonomy.MIXED3_1CLS = Taxonomy(name='mixed3_1cls')

One class: everything that drives, a motorcycle and its rider included. The thesis called this “mixed3” and used it to compare camera rigs, where a second class only adds a way for the comparison to move for a reason that is not the rig.

It is MIXED2_3CLS with pedestrian and bicycle dropped rather than VEHICLE_1CLS with a shorter class list: a motorcycle counts as a vehicle here, an Argoverse rider is merged onto the machine they ride, and a train does not count at all.

py123d_detection.taxonomy.VEHICLE_1CLS = Taxonomy(name='vehicle_1cls')

A single vehicle class over the default labels (VEHICLE and TRAIN). Simpler than MIXED3_1CLS: no dataset-native overrides, so a two-wheeler never counts.

py123d_detection.taxonomy.DEFAULT_123D = Taxonomy(name='default_123d')

Identity over DefaultBoxDetectionLabel, minus EGO.

py123d_detection.taxonomy.TAXONOMIES: Dict[str, Taxonomy] = {'coin3d_3cls': Taxonomy(name='coin3d_3cls'), 'default_123d': Taxonomy(name='default_123d'), 'general_3cls': Taxonomy(name='general_3cls'), 'mixed2_3cls': Taxonomy(name='mixed2_3cls'), 'mixed3_1cls': Taxonomy(name='mixed3_1cls'), 'mixed_8cls': Taxonomy(name='mixed_8cls'), 'nuscenes_detection_10cls': Taxonomy(name='nuscenes_detection_10cls'), 'vehicle_1cls': Taxonomy(name='vehicle_1cls')}

The values accepted by –taxonomy.