22#ifndef EOS_COEFFICIENTS_HPP
23#define EOS_COEFFICIENTS_HPP
25#include "cereal/cereal.hpp"
26#include "cereal/archives/json.hpp"
33namespace morphablemodel {
44 std::ofstream file(filename);
47 throw std::runtime_error(
"Error opening file for writing: " + filename);
49 cereal::JSONOutputArchive output_archive(file);
50 output_archive(cereal::make_nvp(
"shape_coefficients", coefficients));
62 std::vector<float> coefficients;
63 std::ifstream file(filename);
66 throw std::runtime_error(
"Error opening file for reading: " + filename);
68 cereal::JSONInputArchive input_archive(file);
69 input_archive(cereal::make_nvp(
"shape_coefficients", coefficients));
void save_coefficients(std::vector< float > coefficients, std::string filename)
Definition: coefficients.hpp:42
std::vector< float > load_coefficients(std::string filename)
Definition: coefficients.hpp:60
Namespace containing all of eos's 3D model fitting functionality.