Commit 4801502a authored by Vlad Shakhuro's avatar Vlad Shakhuro

labelling -> labels

parent edeef0fd
...@@ -61,14 +61,14 @@ static bool read_overlap(const char *str, double *overlap) ...@@ -61,14 +61,14 @@ static bool read_overlap(const char *str, double *overlap)
return true; return true;
} }
static bool read_labelling(const string& path, static bool read_labels(const string& path,
vector<string>& filenames, vector< vector<Rect> >& labelling) vector<string>& filenames, vector< vector<Rect> >& labels)
{ {
string labelling_path = path + "/gt.txt"; string labels_path = path + "/gt.txt";
string filename, line; string filename, line;
int x1, y1, x2, y2; int x1, y1, x2, y2;
char delim; char delim;
ifstream ifs(labelling_path.c_str()); ifstream ifs(labels_path.c_str());
if( !ifs.good() ) if( !ifs.good() )
return false; return false;
...@@ -77,13 +77,13 @@ static bool read_labelling(const string& path, ...@@ -77,13 +77,13 @@ static bool read_labelling(const string& path,
stringstream stream(line); stringstream stream(line);
stream >> filename; stream >> filename;
filenames.push_back(path + "/" + filename); filenames.push_back(path + "/" + filename);
vector<Rect> filename_labelling; vector<Rect> filename_labels;
while( stream >> x1 >> y1 >> x2 >> y2 >> delim ) while( stream >> x1 >> y1 >> x2 >> y2 >> delim )
{ {
filename_labelling.push_back(Rect(x1, y1, x2, y2)); filename_labels.push_back(Rect(x1, y1, x2, y2));
} }
labelling.push_back(filename_labelling); labels.push_back(filename_labels);
filename_labelling.clear(); filename_labels.clear();
} }
return true; return true;
} }
...@@ -95,8 +95,8 @@ int main(int argc, char *argv[]) ...@@ -95,8 +95,8 @@ int main(int argc, char *argv[])
{ {
printf("Usage: %s OPTIONS, where OPTIONS are:\n" printf("Usage: %s OPTIONS, where OPTIONS are:\n"
"\n" "\n"
"--path <path> - path to dir with data and labelling\n" "--path <path> - path to dir with data and labels\n"
" (labelling should have name gt.txt)\n" " (labels should have name gt.txt)\n"
"\n" "\n"
"--feature_count <count> - number of features to generate\n" "--feature_count <count> - number of features to generate\n"
"\n" "\n"
...@@ -182,10 +182,10 @@ int main(int argc, char *argv[]) ...@@ -182,10 +182,10 @@ int main(int argc, char *argv[])
b.train(Mat(), Mat()); b.train(Mat(), Mat());
ICFDetector detector; ICFDetector detector;
vector<string> filenames; vector<string> filenames;
vector< vector<Rect> > labelling; vector< vector<Rect> > labels;
read_labelling(path, filenames, labelling); read_labels(path, filenames, labels);
detector.train(filenames, labelling, params); detector.train(filenames, labels, params);
} }
catch( const char *err ) catch( const char *err )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment