X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=folding.cc;h=5d13bdbb101796c3397a8b2052e4ae18c269691f;hb=b8222ae1fb874f0783803f55e0bc4c4b9ffca8b2;hp=34c785cbc59c316ab407942e37e880bc97f39dbe;hpb=d922ad61d35e9a6996730bec24b16f8bf7bc426c;p=folded-ctf.git diff --git a/folding.cc b/folding.cc index 34c785c..5d13bdb 100644 --- a/folding.cc +++ b/folding.cc @@ -12,7 +12,9 @@ // You should have received a copy of the GNU General Public License // // along with this program. If not, see . // // // -// Written by Francois Fleuret, (C) IDIAP // +// Written by Francois Fleuret // +// (C) Idiap Research Institute // +// // // Contact for comments & bug reports // /////////////////////////////////////////////////////////////////////////// @@ -48,8 +50,6 @@ void check(bool condition, const char *message) { ////////////////////////////////////////////////////////////////////// int main(int argc, char **argv) { - char *new_argv[argc]; - int new_argc = 0; #ifdef DEBUG cout << endl; @@ -59,7 +59,11 @@ int main(int argc, char **argv) { cout << endl; #endif + char *new_argv[argc]; + int new_argc = 0; + cout << "-- ARGUMENTS ---------------------------------------------------------" << endl; + for(int i = 0; i < argc; i++) cout << (i > 0 ? " " : "") << argv[i] << (i < argc - 1 ? " \\" : "") << endl; @@ -144,19 +148,6 @@ int main(int argc, char **argv) { } - else if(strcmp(new_argv[c], "write-target-poses") == 0) { - check(main_pool, "No pool available."); - LabelledImage *image; - for(int p = 0; p < main_pool->nb_images(); p++) { - image = main_pool->grab_image(p); - for(int t = 0; t < image->nb_targets(); t++) { - cout << "IMAGE " << p << " TARGET " << t << endl; - image->get_target_pose(t)->print(&cout); - } - main_pool->release_image(p); - } - } - ////////////////////////////////////////////////////////////////////// else if(strcmp(new_argv[c], "train-detector") == 0) { @@ -176,25 +167,6 @@ int main(int argc, char **argv) { detector->compute_thresholds(validation_pool, global.wanted_true_positive_rate); } - else if(strcmp(new_argv[c], "check-hierarchy") == 0) { - cout << "-- CHECK HIERARCHY ---------------------------------------------------" << endl; - PoseCellHierarchy *h = new PoseCellHierarchy(hierarchy_pool); - cout << "Train incompatible poses " << h->nb_incompatible_poses(train_pool) << endl; - cout << "Validation incompatible poses " << h->nb_incompatible_poses(validation_pool) << endl; - delete h; - } - - ////////////////////////////////////////////////////////////////////// - - else if(strcmp(new_argv[c], "validate-detector") == 0) { - cout << "-- VALIDATE DETECTOR -------------------------------------------------" << endl; - - check(validation_pool, "No validation pool available."); - check(detector, "No detector."); - - print_decimated_error_rate(global.nb_levels - 1, validation_pool, detector); - } - ////////////////////////////////////////////////////////////////////// else if(strcmp(new_argv[c], "test-detector") == 0) { @@ -210,20 +182,6 @@ int main(int argc, char **argv) { } } - else if(strcmp(new_argv[c], "parse-images") == 0) { - cout << "-- PARSING IMAGES -----------------------------------------------------" << endl; - check(detector, "No detector."); - while(!cin.eof()) { - char image_name[buffer_size]; - cin.getline(image_name, buffer_size); - if(strlen(image_name) > 0) { - parse_scene(detector, image_name); - } - } - } - - ////////////////////////////////////////////////////////////////////// - else if(strcmp(new_argv[c], "sequence-test-detector") == 0) { cout << "-- SEQUENCE TEST DETECTOR --------------------------------------------" << endl; @@ -286,34 +244,6 @@ int main(int argc, char **argv) { write_pool_images_with_poses_and_referentials(train_pool, detector); } - else if(strcmp(new_argv[c], "produce-materials") == 0) { - cout << "-- PRODUCING MATERIALS -----------------------------------------------" << endl; - - check(hierarchy_pool, "No hierarchy pool available."); - check(test_pool, "No test pool available."); - - PoseCellHierarchy *hierarchy; - - cout << "Creating hierarchy" << endl; - - hierarchy = new PoseCellHierarchy(hierarchy_pool); - - LabelledImage *image; - for(int p = 0; p < test_pool->nb_images(); p++) { - image = test_pool->grab_image(p); - if(image->width() == 640 && image->height() == 480) { - PoseCellSet pcs; - hierarchy->add_root_cells(image, &pcs); - cout << "WE HAVE " << pcs.nb_cells() << " CELLS" << endl; - exit(0); - test_pool->release_image(p); - } - } - - delete hierarchy; - - } - ////////////////////////////////////////////////////////////////////// else {