vak.common.labels.to_set#

vak.common.labels.to_set(labels_list: list[ndarray | list]) set[source]#

Given a list of labels from annotations, return the set of (unique) labels.

Parameters:

labels_list (list) – Of labels from annotations, either a list of numpy.ndarrays or a list of lists.

Returns:

labelset – Unique set of labels found in labels_list.

Return type:

set

Examples

>>> labels_list = [voc.annot.labels for voc in vds.voc_list]
>>> labelset = to_set(labels_list)
>>> print(labelset)
{'a', 'b', 'c', 'd', 'e'}