Targetable

class menpo.base.Targetable[source]

Bases: object

Interface for objects that can produce a target PointCloud.

This could for instance be the result of an alignment or a generation of a PointCloud instance from a shape model.

Implementations must define sensible behavior for:

  • what a target is: see target
  • how to set a target: see set_target()
  • how to update the object after a target is set: see _sync_state_from_target()
  • how to produce a new target after the changes: see _new_target_from_state()

Note that _sync_target_from_state() needs to be triggered as appropriate by subclasses e.g. when from_vector_inplace is called. This will in turn trigger _new_target_from_state(), which each subclass must implement.

set_target(new_target)[source]

Update this object so that it attempts to recreate the new_target.

Parameters:

new_target : PointCloud

The new target that this object should try and regenerate.

n_dims[source]

The number of dimensions of the target.

Type:int
n_points[source]

The number of points on the target.

Type:int
target[source]

The current PointCloud that this object produces.

Type:PointCloud