menpo/landmark/base.py
def _new_group_with_only_labels(self, labels):
        """
        Deal with changing indices when you add and remove points. In this case
        we only deal with building a new dataset that keeps masks.

        Parameters
        ----------
        labels : list of `string`
            List of strings of the labels to keep

        Returns
        -------
        lmark_group : :map:`LandmarkGroup`
            The new landmark group with only the requested labels.
        """
        set_difference = set(labels).difference(self.labels)
        if len(set_difference) > 0:
            raise ValueError('Labels {0} do not exist in the landmark '
                             'group. Available labels are: {1}'.format(
                list(set_difference), self.labels))

        masks_to_keep = [self._labels_to_masks[l] for l in labels
                         if l in self._labels_to_masks]
        overlap = np.sum(masks_to_keep, axis=0) > 0
        masks_to_keep = [l[overlap] for l in masks_to_keep]

        return LandmarkGroup(self._pointcloud.from_mask(overlap),
                             OrderedDict(zip(labels, masks_to_keep)))

        Deal with changing indices when you add and remove points. In this case
        we only deal with building a new dataset that keeps masks.

        Parameters
        ----------
        labels : list of `string`
            List of strings of the labels to keep

        Returns
        -------
        lmark_group : :map:`LandmarkGroup`
            The new landmark group with only the requested labels.
        
Deal with changing indices when you add and remove points. In this case
we only deal with building a new dataset that keeps masks.

Parameters

labels : list of `string`
List of strings of the labels to keep

Returns

lmark_group : :map:`LandmarkGroup`
The new landmark group with only the requested labels.
Deal with changing indices when you add and remove points . In this case we only deal with building a new dataset that keeps masks . Parameters labels : list of ` string ` List of strings of the labels to keep Returns lmark_group : : map : ` LandmarkGroup ` The new landmark group with only the requested labels .
def _new_group_with_only_labels(self, labels):
        set_difference = set(labels).difference(self.labels)
        if len(set_difference) > 0:
            raise ValueError('Labels {0} do not exist in the landmark '
                             'group. Available labels are: {1}'.format(
                list(set_difference), self.labels))
        masks_to_keep = [self._labels_to_masks[l] for l in labels
                         if l in self._labels_to_masks]
        overlap = np.sum(masks_to_keep, axis=0) > 0
        masks_to_keep = [l[overlap] for l in masks_to_keep]
        return LandmarkGroup(self._pointcloud.from_mask(overlap),
                             OrderedDict(zip(labels, masks_to_keep)))
def _new_group_with_only_labels ( self , labels ) : set_difference = set ( labels ) . difference ( self . labels ) if len ( set_difference ) > 0 : raise ValueError ( 'Labels {0} do not exist in the landmark ' 'group. Available labels are: {1}' . format ( list ( set_difference ) , self . labels ) ) masks_to_keep = [ self . _labels_to_masks [ l ] for l in labels if l in self . _labels_to_masks ] overlap = np . sum ( masks_to_keep , axis = 0 ) > 0 masks_to_keep = [ l [ overlap ] for l in masks_to_keep ] return LandmarkGroup ( self . _pointcloud . from_mask ( overlap ) , OrderedDict ( zip ( labels , masks_to_keep ) ) )
Deal with changing indices when you add and remove points.
Deal with changing indices when you add and remove points .
"""
        Deal with changing indices when you add and remove points. In this case
        we only deal with building a new dataset that keeps masks.

        Parameters
        ----------
        labels : list of `string`
            List of strings of the labels to keep

        Returns
        -------
        lmark_group : :map:`LandmarkGroup`
            The new landmark group with only the requested labels.
        """
self
labels