build_mapping_from_labels#

ethograph.labels.converters.build_mapping_from_labels(string_labels)[source]#

Build a name->id mapping from a list of unique string labels.

Sorts labels alphabetically; 0 is reserved for ‘background’.

Return type:

dict[str, int]