MapillaryLabels

Contents

MapillaryLabels#

class rapidtools.data_sources.MapillaryLabels[source]#

Bases: object

Namespace of official Mapillary segmentation label strings.

Attribute names are upper-snake-case versions of the label with the -- separators replaced by _. Every attribute value is the exact string Mapillary uses in its detections.value field.

Example

Look up a label by constant:

>>> MapillaryLabels.NATURE_SKY
'nature--sky'

Enumerate the complete vocabulary:

>>> labels = [
...     v for k, v in vars(MapillaryLabels).items()
...     if not k.startswith('__') and isinstance(v, str)
... ]
>>> 'construction--flat--road' in labels
True