Esempio n. 1
0
bob::ip::gabor::JetStatistics::JetStatistics(bob::io::base::HDF5File& hdf5){
  m_meanAbs.reference(hdf5.readArray<double,1>("MeanAbs"));
  m_varAbs.reference(hdf5.readArray<double,1>("VarAbs"));
  m_meanPhase.reference(hdf5.readArray<double,1>("MeanPhase"));
  m_varPhase.reference(hdf5.readArray<double,1>("VarPhase"));
  if (hdf5.hasGroup("Transform")){
    hdf5.cd("Transform");
    m_gwt.reset(new bob::ip::gabor::Transform(hdf5));
    hdf5.cd("..");
  }
}
Esempio n. 2
0
void bob::learn::em::GMMMachine::save(bob::io::base::HDF5File& config) const {
  int64_t v = static_cast<int64_t>(m_n_gaussians);
  config.set("m_n_gaussians", v);
  v = static_cast<int64_t>(m_n_inputs);
  config.set("m_n_inputs", v);

  for(size_t i=0; i<m_n_gaussians; ++i) {
    std::ostringstream oss;
    oss << "m_gaussians" << i;

    if (!config.hasGroup(oss.str())) config.createGroup(oss.str());
    config.cd(oss.str());
    m_gaussians[i]->save(config);
    config.cd("..");
  }

  config.setArray("m_weights", m_weights);
}