LandmarkManager

class menpo.landmark.LandmarkManager[source]

Bases: MutableMapping, Transformable

Store for LandmarkGroup 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. LandmarkGroup instances are stored under string keys - these keys are refereed to as the group name. A special case is where there is a single unambiguous LandmarkGroup attached to a LandmarkManager - in this case None can be used as a key to access the sole group.

Note that all landmarks 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.
copy()[source]

Generate an efficient copy of this LandmarkManager.

Returns:type(self) – A copy of this object
get(k[, d]) → D[k] if k in D, else d. d defaults to None.
items() → list of D's (key, value) pairs, as 2-tuples
iteritems() → an iterator over the (key, value) items of D
iterkeys() → an iterator over the keys of D
itervalues() → an iterator over the values of D
keys() → list of D's keys
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() → list of D's values
view_widget(popup=False, browser_style='buttons', figure_size=(10, 8))[source]

Visualizes the landmark manager object using the visualize_landmarks widget.

Parameters:
  • popup (bool, optional) – If True, the widget will appear as a popup window.
  • browser_style ({buttons, slider}, optional) – It defines whether the selector of the landmark managers will have the form of plus/minus buttons or a slider.
  • figure_size ((int, int), optional) – The initial size of the rendered figure.
group_labels

All the labels for the landmark set.

Type:list of str
has_landmarks

Whether the object has landmarks or not

Type:int
n_dims

The total number of dimensions.

Type:int
n_groups

Total number of labels.

Type:int