

def indices_to_masks(labels_to_indices, n_points):
    '\n    Take a dictionary of labels to indices and convert it to a dictionary\n    that maps labels to masks. This dictionary is the correct format for\n    constructing a :map:`LandmarkGroup`.\n\n    Parameters\n    ----------\n    labels_to_indices : `ordereddict` {`str` -> `int ndarray`}\n        For each label, the indices in to the pointcloud that belong to the\n        label.\n    n_points : `int`\n        Number of points in the pointcloud that is being masked.\n    '
    if (not isinstance(labels_to_indices, OrderedDict)):
        raise ValueError('Must provide an OrderedDict to maintain the semantic meaning of the labels.')
    masks = OrderedDict()
    for label in labels_to_indices:
        indices = labels_to_indices[label]
        mask = np.zeros(n_points, dtype=np.bool)
        mask[mask] = True
        masks[label] = mask
    return masks

dataset/ETHPy150Open menpo/menpo/menpo/landmark/base.py indices_to_masks/VarMisuse@71/305 `indices`->`mask`