menpo.math.from_matrix(matrix, template)[source]

Create a generator from a matrix given a template Vectorizable objects as a template. The from_vector method will be used to reconstruct each object.

If you want a list, warp the returned value in list().

  • matrix ((n_items, n_features) ndarray) – A matrix whereby every row represents the data of a vectorizable object.

  • template (Vectorizable) – The template object to use to reconstruct each row of the matrix with.


vectorizables (generator of Vectorizable) – Every row of the matrix becomes an element of the list.