diff --git a/demo/demo/map.cpp b/demo/demo/map.cpp index a5d7efa..db98726 100644 --- a/demo/demo/map.cpp +++ b/demo/demo/map.cpp @@ -19,8 +19,6 @@ #include - - void convertFilename(std::string &filename,const std::string l_folder, const std::string i_folder, const std::string l_ext,const std::string i_ext) { filename.replace(filename.find(l_folder),l_folder.length(),i_folder); @@ -36,7 +34,7 @@ int main(int argc, char *argv[]) bool show = false; bool write_dets = false; bool write_res_on_file = true; - int n_images = 5000; + int n_images = 50; bool verbose; int classes, map_points, map_levels; @@ -66,24 +64,12 @@ int main(int argc, char *argv[]) IoU_thresh, conf_thresh, verbose); std::ofstream times, memory; - std::string name; - if(write_res_on_file) - { - 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: "<init(net, n_classes); - - std::ifstream all_labels(labels_path); std::string l_filename; std::vector images; @@ -128,8 +111,7 @@ int main(int argc, char *argv[]) cv::namedWindow("detection", cv::WINDOW_NORMAL); int images_done; - for (images_done=0 ; std::getline(all_labels, l_filename) && images_done < n_images ; ++images_done) - { + for (images_done=0 ; std::getline(all_labels, l_filename) && images_done < n_images ; ++images_done) { std::cout </ / / / tk::dnn::BoundingBox b; @@ -187,8 +168,7 @@ int main(int argc, char *argv[]) // read and save groundtruth labels std::ifstream labels(l_filename); - for(std::string line; std::getline(labels, line); ) - { + for(std::string line; std::getline(labels, line); ){ std::istringstream in(line); tk::dnn::BoundingBox b; in >> b.cl >> b.x >> b.y >> b.w >> b.h; @@ -202,40 +182,32 @@ int main(int argc, char *argv[]) images.push_back(f); - if(show) - { + if(show){ cv::imshow("detection", frame); cv::waitKey(0); } - getMemUsage(vm, rss); vm_total += vm; rss_total += rss; } + std::cout << "Avg VM[MB]: " << vm_total/images_done/1024.0 << ";Avg RSS[MB]: " << rss_total/images_done/1024.0 << std::endl; - std::cout<<"Done."<