import_landmark_file

menpo.io.import_landmark_file(filepath, group=None, asset=None)[source]

Single landmark file importer.

If a landmark file is found at filepath, returns a dictionary of landmarks where keys are the group names and the values are PointCloud or subclasses. If the optional group argument is supplied then a single group with the given name is returned rather than a dictionary

Parameters
  • filepath (pathlib.Path or str) – A relative or absolute filepath to an landmark file.

  • group (str, optional) – The name of the landmark group to return from the landmark dictionary. If None, then a dictionary is returned where keys are the group names and the values are PointCloud or subclasses.

  • asset (object, optional) – The object the landmark belongs to (useful for things like rescaling)

Returns

landmarks (dict {str: PointCloud} or PointCloud) – Dictionary mapping landmark groups to PointCloud or subclasses OR PointCloud or subclass if group == None