Minor fix on output file name in map demo

Signed-off-by: Micaela Verucchi <micaelaverucchi@gmail.com>
This commit is contained in:
Micaela Verucchi
2020-04-08 09:35:54 +02:00
parent cf3fbeddbd
commit c36befaf2b
2 changed files with 19 additions and 5 deletions
+18 -4
View File
@@ -66,9 +66,24 @@ int main(int argc, char *argv[])
IoU_thresh, conf_thresh, verbose);
std::ofstream times, memory;
std::string name;
if(write_res_on_file)
{
times.open("times"+std::string(net)+".csv");
std::string str = net;
name = net;
std::string delim = "/";
std::size_t current, previous = 0;
current = str.find(delim);
if (current != std::string::npos) {
while (current != std::string::npos) {
name = str.substr(previous, current - previous);
previous = current + 1;
current = str.find(delim, previous);
}
name = str.substr(previous, current - previous);
}
std::cout<<"name: "<<name<<std::endl;
times.open("times"+name+".csv");
memory.open("memory.csv", std::ios_base::app);
memory<<net<<";";
}
@@ -206,12 +221,11 @@ int main(int argc, char *argv[])
//compute mAP
double AP = tk::dnn::computeMapNIoULevels(images,classes,IoU_thresh,conf_thresh, map_points, map_step, map_levels, verbose, write_res_on_file, net);
double AP = tk::dnn::computeMapNIoULevels(images,classes,IoU_thresh,conf_thresh, map_points, map_step, map_levels, verbose, write_res_on_file, name);
std::cout<<"mAP "<<IoU_thresh<<":"<<IoU_thresh+map_step*(map_levels-1)<<" = "<<AP<<std::endl;
//compute average precision, recall and f1score
tk::dnn::computeTPFPFN(images,classes,IoU_thresh,conf_thresh, verbose, write_res_on_file, net);
tk::dnn::computeTPFPFN(images,classes,IoU_thresh,conf_thresh, verbose, write_res_on_file, name);
std::cout << "Avg VM[MB]: " << vm_total/images_done/1024.0 << ";Avg RSS[MB]: " << rss_total/images_done/1024.0 << std::endl;
if(write_res_on_file)
+1 -1
View File
@@ -134,7 +134,7 @@ const char *regression_header5 = "../tests/mobilenetv2ssd/layers/regression_head
int main()
{
downloadWeightsifDoNotExist(input_bin, "./tests/mobilenetv2ssd", "https://cloud.hipert.unimore.it/s/B6mj33k7beECXsY/download");
downloadWeightsifDoNotExist(input_bin, "../tests/mobilenetv2ssd", "https://cloud.hipert.unimore.it/s/B6mj33k7beECXsY/download");
int classes = 21;