1 #ifndef CURFIL_EXPORT_HPP
2 #define CURFIL_EXPORT_HPP
4 #include <boost/property_tree/ptree.hpp>
7 #include "random_forest_image.h"
31 const std::string& trainingFolder,
bool verbose);
47 template<
class TreeEnsemble>
48 void writeJSON(
const TreeEnsemble& ensemble)
const {
50 CURFIL_INFO(
"writing tree files to " << outputFolder <<
" (verbose: " << verbose <<
")");
52 for (
size_t treeNr = 0; treeNr < ensemble.getTrees().size(); treeNr++) {
53 writeJSON(*(ensemble.getTree(treeNr)), treeNr);
56 CURFIL_INFO(
"wrote JSON files to " << outputFolder);
60 static std::string spaces(
int level);
62 static void writeXY(boost::property_tree::ptree& pt,
const std::string& name,
const XY& xy);
64 static void writeFeatureDetails(boost::property_tree::ptree& pt,
const ImageFeatureFunction& feature);
66 static std::vector<std::map<std::string, std::string> > parseProcCpuInfo();
68 static int getPhysicalCores();
70 static int getPhysicalCpus();
73 static boost::property_tree::ptree toPropertyTree(
const std::vector<T>& input) {
74 boost::property_tree::ptree propertyTree;
75 for (
const auto& v : input) {
76 propertyTree.push_back(std::make_pair(
"", boost::lexical_cast<std::string>(v)));
81 static boost::property_tree::ptree getProcessorModelNames();
83 void writeTree(boost::property_tree::ptree& pt,
const RandomTree<PixelInstance, ImageFeatureFunction>& tree)
const;
85 void writeTree(boost::property_tree::ptree& pt,
const RandomTreeImage& tree)
const;
89 const boost::posix_time::ptime date;
90 const TrainingConfiguration& configuration;
91 const std::string outputFolder;
92 const std::string trainingFolder;