py123detection.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.

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.

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

get_taxonomy(name)

Classes

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

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

py123detection.taxonomy.VOID = 'void'

Target class name that drops a label.

class py123detection.taxonomy.Taxonomy(name, class_names, native_map=<factory>, default_map=<factory>)[source]

Bases: object

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

name: str

Identifier stored in the exported metadata, e.g. "nuscenes_detection_10cls".

class_names: Tuple[str, ...]

Ordered class names. The index of a name is its label id in the mmdet3d config.

native_map: Mapping[str, str]

Dataset-native (optionally qualified) enum member name -> class name or VOID.

default_map: Mapping[str, str]

DefaultBoxDetectionLabel member name -> class name or VOID.

resolve(label)[source]

Class name for a 123D label, or None if the box should be dropped.

Return type:

Optional[str]

label_id(class_name)[source]
Return type:

int

property class_ids: Dict[str, int]
py123detection.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.

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

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

py123detection.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.

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

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

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

Identity over DefaultBoxDetectionLabel, minus EGO.

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

The values accepted by –taxonomy.

py123detection.taxonomy.get_taxonomy(name)[source]
Return type:

Taxonomy