Commit 50c059c3 authored by Patrik Huber's avatar Patrik Huber

Save only the orthonormal basis

And compute the rescaled basis when loading a model.
parent 4662c59c
......@@ -3,7 +3,7 @@
*
* File: include/eos/morphablemodel/MorphableModel.hpp
*
* Copyright 2014, 2015 Patrik Huber
* Copyright 2014-2017 Patrik Huber
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
......@@ -289,9 +289,12 @@ private:
template<class Archive>
void serialize(Archive& archive)
{
archive(CEREAL_NVP(mean), CEREAL_NVP(rescaled_pca_basis), CEREAL_NVP(orthonormal_pca_basis), CEREAL_NVP(eigenvalues), CEREAL_NVP(triangle_list));
// Note: If the files are too big, We could split this in save/load, only
// store one of the bases, and calculate the other one when loading.
archive(CEREAL_NVP(mean), CEREAL_NVP(orthonormal_pca_basis), CEREAL_NVP(eigenvalues), CEREAL_NVP(triangle_list));
// If we're loading, we have to recompute the rescaled basis, so that it's available (we don't store it anymore):
if (Archive::is_loading::value)
{
rescaled_pca_basis = rescale_pca_basis(orthonormal_pca_basis, eigenvalues);
}
};
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment