From c36befaf2bac420c125f6354bb24f0c84dfb41b8 Mon Sep 17 00:00:00 2001 From: Micaela Verucchi Date: Wed, 8 Apr 2020 09:35:54 +0200 Subject: [PATCH] Minor fix on output file name in map demo Signed-off-by: Micaela Verucchi --- demo/demo/map.cpp | 22 ++++++++++++++++++---- tests/mobilenetv2ssd/mobilenetv2ssd.cpp | 2 +- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/demo/demo/map.cpp b/demo/demo/map.cpp index e32c302..a5d7efa 100644 --- a/demo/demo/map.cpp +++ b/demo/demo/map.cpp @@ -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: "<