-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfigReader.h
97 lines (80 loc) · 2.11 KB
/
ConfigReader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// =========================================================================================
// Structured Class-Label in Random Forests. This is a re-implementation of
// the work we presented at ICCV'11 in Barcelona, Spain.
//
// In case of using this code, please cite the following paper:
// P. Kontschieder, S. Rota Bulò, H. Bischof and M. Pelillo.
// Structured Class-Labels in Random Forests for Semantic Image Labelling. In (ICCV), 2011.
//
// Implementation by Peter Kontschieder and Samuel Rota Bulò
// October 2013
//
// =========================================================================================
#ifndef CONFIGREADER_H_
#define CONFIGREADER_H_
#pragma once
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
namespace vision
{
enum FOREST_TYPE
{
CLASS
};
enum ENERGY_TYPE
{
ENTROPY, STRUCTLABEL
};
enum RUN_TYPE
{
TRAIN, TEST, EVAL
};
enum TRAIN_TYPE
{
STD, INTERLEAVED
};
enum SAMPLING_TYPE
{
HOMOGENEOUS, STRIDE
};
enum FEATURES2NDSTAGE_TYPE
{
HOT1, OURS
};
class ConfigReader
{
public:
/* tree and forest specifics */
FOREST_TYPE forestType;
ENERGY_TYPE energyType;
RUN_TYPE runType;
TRAIN_TYPE trainType;
SAMPLING_TYPE samplingType;
FEATURES2NDSTAGE_TYPE features2ndStage;
int numTrees, maxProbeOffset;
/* file, folder and experiment specifics */
string imageFolder, groundTruthFolder, featureFolder, feature2ndStageFolder;
string treeFolder, outputFolder, tree2ndStageFolder, output2ndStageFolder;
string listImages, listTestImageNumbers, listTrainingImageNumbersPrefix;
vector<string> imageFilenames;
// vector<string> allTestFilenames;
double samplingParam, rescaleFactor;
double lambda;
int maxDepth, minNumSamples, numNodeTests, numLabels;
int labelPatchWidth, labelPatchHeight, jointProbDim;
bool useWeights;
/////////////////////////////////////////////////////
ConfigReader();
bool readConfigFile(string cfgFile);
vector<string> readFilenames(string filename);
~ConfigReader()
{
}
};
} /* namespace vision */
#endif /* CONFIGREADER_H_ */