-
Notifications
You must be signed in to change notification settings - Fork 0
/
dataset.h
49 lines (29 loc) · 1.4 KB
/
dataset.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
#ifndef DATASET_H
#define DATASET_H
#include "header.hpp"
#include "imageProcessing.hpp" //Main class
typedef vector<pair<string,int> > PathsLabels;
class Dataset
{
public:
Dataset();
// Call this constructor to initialize an object with rootPath. rootPath is the path where you have the description.txt
Dataset(string rootPath);
void setRootPath(string path);
string getRootPath();
// Call this function to fill the test and training pathlabel vectors!!
bool createDataPaths(float percentage);
// Returns a vector of path and label pairs for testing. You can use the paths to read the images and labels to calculate the accuracy of SVM. You should first call the createDataPaths function to fill the vectors
vector<pair<string,int> > getTestPathsLabels();
// Returns a vector of path and label pairs for training. You can use the paths to read the images and labels to prepare labels Mat for SVM. You should first call the createDataPaths function to fill the vectors
vector<pair<string,int> > getTrainingPathsLabels();
private:
bool readDescriptionFile();
string rootPath;
vector<pair<int,string> > classNumberNames;
vector<pair<int,string> > classNumTrainingNames;
vector<pair<int,string> > classNumTestNames;
vector<pair<string,int> > trainingPathsAndLabels;
vector<pair<string,int> > testPathsAndLabels;
};
#endif // DATASET_H