class menpo.landmark.LandmarkManager[source]

Bases: MutableMapping, Transformable

Store for PointCloud or :LabelledPointUndirectedGraph instances associated with an object.

Every Landmarkable instance has an instance of this class available at the .landmarks property. It is through this class that all access to landmarks attached to instances is handled. In general the LandmarkManager provides a dictionary-like interface for storing landmarks. The LandmarkManager will contain instances of PointCloud or LabelledPointUndirectedGraph or subclasses thereof. LabelledPointUndirectedGraph is unique in it’s ability to include labels that refer to subsets of the underlying points that represent interesting semantic labels. These PointCloud or LabelledPointUndirectedGraph (or subclasses) are stored under string keys - these keys are refereed to as the group name. A special case is where there is a single unambiguous group attached to a LandmarkManager - in this case None can be used as a key to access this sole group.

Note that all groups stored on a Landmarkable in it’s attached LandmarkManager are automatically transformed and copied with their parent object.

clear() → None. Remove all items from D.

Generate an efficient copy of this LandmarkManager.


type(self) – A copy of this object

get(k[, d]) → D[k] if k in D, else d. d defaults to None.
items() → a set-like object providing a view on D's items

Yield only items (group, PointCloud) where the key matches a given glob.


glob_pattern (str) – A glob pattern e.g. ‘frontal_face_*’


item ((group, PointCloud)) – Tuple of (str, PointCloud) where the group matches the glob.

keys() → a set-like object providing a view on D's keys

Yield only landmark group names (keys) matching a given glob.


glob_pattern (str) – A glob pattern e.g. ‘frontal_face_*’


keys (group labels that match the glob pattern)

pop(k[, d]) → v, remove specified key and return the corresponding value.

If key is not found, d is returned if given, otherwise KeyError is raised.

popitem() → (k, v), remove and return some (key, value) pair

as a 2-tuple; but raise KeyError if D is empty.

setdefault(k[, d]) → D.get(k,d), also set D[k]=d if k not in D
update([E, ]**F) → None. Update D from mapping/iterable E and F.

If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v

values() → an object providing a view on D's values
property group_labels

All the labels for the landmark set sorted by insertion order.


list of str

property has_landmarks

Whether the object has landmarks or not



property n_dims

The total number of dimensions.



property n_groups

Total number of labels.