py123d_detection.mmcv.export.tokens

What goes into info['token'].

123D stamps every frame with a deterministic UUID derived from (split, log_name, timestamp_us), which is enough for training but is not the nuScenes sample_token that the official nuScenes evaluation keys on. NuScenesTokenResolver restores those by joining on (log_name, timestamp_us). For datasets without native frame tokens, LogTimestampTokenResolver writes "{log_name}/{timestamp_us}", which an independent converter can reproduce.

Functions

build_nuscenes_token_map(dataroot[, versions])

Index a nuScenes install as "{scene_name}:{sample_timestamp_us}" -> sample_token.

dump_nuscenes_token_map(dataroot, output_path)

Write the token map to JSON so exports run without the devkit.

Classes

LogTimestampTokenResolver()

MappingTokenResolver(mapping[, strict])

Looks tokens up in a "{log_name}:{timestamp_us}" -> token mapping.

NuScenesTokenResolver(dataroot[, versions, ...])

Restores nuScenes sample_token values from the devkit database.

TokenResolver()

Default resolver: the 123D frame UUID.

class py123d_detection.mmcv.export.tokens.TokenResolver[source]

Bases: object

Default resolver: the 123D frame UUID.

name = 'uuid'
resolve(dataset, split, log_name, timestamp_us, uuid)[source]
Return type:

str

class py123d_detection.mmcv.export.tokens.LogTimestampTokenResolver[source]

Bases: TokenResolver

name = 'log_timestamp'
resolve(dataset, split, log_name, timestamp_us, uuid)[source]
Return type:

str

class py123d_detection.mmcv.export.tokens.MappingTokenResolver(mapping, strict=False)[source]

Bases: TokenResolver

Looks tokens up in a "{log_name}:{timestamp_us}" -> token mapping.

Frames missing from the mapping fall back to the 123D UUID, or raise when strict is set.

name = 'mapping'
classmethod from_json(path, strict=False)[source]

Load a mapping written by dump_nuscenes_token_map().

Return type:

MappingTokenResolver

resolve(dataset, split, log_name, timestamp_us, uuid)[source]
Return type:

str

class py123d_detection.mmcv.export.tokens.NuScenesTokenResolver(dataroot, versions=None, strict=False)[source]

Bases: MappingTokenResolver

Restores nuScenes sample_token values from the devkit database.

Leave strict off for interpolated (10 Hz) 123D logs, whose non-keyframes have no token.

name = 'nuscenes'
py123d_detection.mmcv.export.tokens.build_nuscenes_token_map(dataroot, versions=None)[source]

Index a nuScenes install as "{scene_name}:{sample_timestamp_us}" -> sample_token.

Parameters:

versions (Optional[List[str]]) – Database versions to index. Defaults to every v1.0-* folder present.

Return type:

Dict[str, str]

py123d_detection.mmcv.export.tokens.dump_nuscenes_token_map(dataroot, output_path)[source]

Write the token map to JSON so exports run without the devkit. Returns the token count.

Return type:

int