menpo/menpo — pull request #427 by jabooth (2014-09-04 14:48:53+00:00)
Title: Adds HDF5able serialization support to Menpo

Serialization of Menpo datatypes has long been on our wishlist (#164, see there for detailed discussion). This PR adds solid serialization support to Menpo in a fundamental way.

The actual meat of this solution is a separate package called [hdf5able](https://github.com/menpo/hdf5able). This package defines a standardized approach for serializing and de-serializing basic Python types to and from HDF5 files. It also provides a class called `HDF5able`. Any custom subclass of `HDF5able` can also be safely serialized to disk. This PR:

1. Adds `HDF5able` as a superclass of `Copyable`, making most Menpo types serializable, with no extra effort.
2. Classes that hold callables as variables (most notably feature functions in the `fit` package) need to specialize a few methods of `HDF5able` to be serializable. Support is added for `AAM` serialization in this PR. Future small PR's in Menpo can add support to classes as we go.
3. Adds `menpo.io.load(path)` and `menpo.io.save(path, objects)`. These are the new API for saving Menpo objects.

Note that because HDF5 is an open standard, any files saved out from Menpo can be easily inspected by any number of tools. Matlab also supports HDF5, so immediately Menpo data can be read into Matlab (we may right a small Matlab function to make this easier to encourage support).