Change README.md, add config.yaml, refactoring

Signed-off-by: xavier <micaelaverucchi@gmail.com>
This commit is contained in:
xavier
2020-02-11 11:25:42 +01:00
parent b5c0baa99d
commit 1936e54870
6 changed files with 73 additions and 42 deletions
+15
View File
@@ -76,6 +76,21 @@ float boxIoU(const BoundingBox &a, const BoundingBox &b)
return I / U;
}
void readParams(char* config_filename, int& classes, int& map_points,
int& map_levels, float& map_step, float& IoU_thresh,
float& conf_thresh, bool& verbose)
{
YAML::Node config = YAML::LoadFile(config_filename);
classes = config["classes"].as<int>();
map_points = config["map_points"].as<int>();
map_levels = config["map_levels"].as<int>();
map_step = config["map_step"].as<float>();
IoU_thresh = config["IoU_thresh"].as<float>();
conf_thresh = config["conf_thresh"].as<float>();
verbose = config["verbose"].as<bool>();
}
/* Credits to https://github.com/AlexeyAB/darknet/blob/master/src/detector.c*/
double computeMap(std::vector<Frame> &images,const int classes,const float IoU_thresh, const float conf_thresh, const int map_points, const bool verbose)
{