|
|
|
@ -22,7 +22,7 @@ int check_mistakes = 0; |
|
|
|
|
|
|
|
|
|
static int coco_ids[] = { 1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,17,18,19,20,21,22,23,24,25,27,28,31,32,33,34,35,36,37,38,39,40,41,42,43,44,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,67,70,72,73,74,75,76,77,78,79,80,81,82,84,85,86,87,88,89,90 }; |
|
|
|
|
|
|
|
|
|
void train_detector(char *datacfg, char *cfgfile, char *weightfile, int *gpus, int ngpus, int clear, int dont_show, int calc_map, int mjpeg_port, int show_imgs, int benchmark_layers) |
|
|
|
|
void train_detector(char *datacfg, char *cfgfile, char *weightfile, int *gpus, int ngpus, int clear, int dont_show, int calc_map, int mjpeg_port, int show_imgs, int benchmark_layers, char* chart_path) |
|
|
|
|
{ |
|
|
|
|
list *options = read_data_cfg(datacfg); |
|
|
|
|
char *train_images = option_find_str(options, "train", "data/train.txt"); |
|
|
|
@ -150,7 +150,7 @@ void train_detector(char *datacfg, char *cfgfile, char *weightfile, int *gpus, i |
|
|
|
|
int img_size = 1000; |
|
|
|
|
char windows_name[100]; |
|
|
|
|
sprintf(windows_name, "chart_%s.png", base); |
|
|
|
|
img = draw_train_chart(windows_name, max_img_loss, net.max_batches, number_of_lines, img_size, dont_show); |
|
|
|
|
img = draw_train_chart(windows_name, max_img_loss, net.max_batches, number_of_lines, img_size, dont_show, chart_path); |
|
|
|
|
#endif //OPENCV
|
|
|
|
|
if (net.track) { |
|
|
|
|
args.track = net.track; |
|
|
|
@ -1635,6 +1635,7 @@ void run_detector(int argc, char **argv) |
|
|
|
|
// and for recall mode (extended output table-like format with results for best_class fit)
|
|
|
|
|
int ext_output = find_arg(argc, argv, "-ext_output"); |
|
|
|
|
int save_labels = find_arg(argc, argv, "-save_labels"); |
|
|
|
|
char* chart_path = find_char_arg(argc, argv, "-chart", 0); |
|
|
|
|
if (argc < 4) { |
|
|
|
|
fprintf(stderr, "usage: %s %s [train/test/valid/demo/map] [data] [cfg] [weights (optional)]\n", argv[0], argv[1]); |
|
|
|
|
return; |
|
|
|
@ -1673,7 +1674,7 @@ void run_detector(int argc, char **argv) |
|
|
|
|
if (weights[strlen(weights) - 1] == 0x0d) weights[strlen(weights) - 1] = 0; |
|
|
|
|
char *filename = (argc > 6) ? argv[6] : 0; |
|
|
|
|
if (0 == strcmp(argv[2], "test")) test_detector(datacfg, cfg, weights, filename, thresh, hier_thresh, dont_show, ext_output, save_labels, outfile, letter_box, benchmark_layers); |
|
|
|
|
else if (0 == strcmp(argv[2], "train")) train_detector(datacfg, cfg, weights, gpus, ngpus, clear, dont_show, calc_map, mjpeg_port, show_imgs, benchmark_layers); |
|
|
|
|
else if (0 == strcmp(argv[2], "train")) train_detector(datacfg, cfg, weights, gpus, ngpus, clear, dont_show, calc_map, mjpeg_port, show_imgs, benchmark_layers, chart_path); |
|
|
|
|
else if (0 == strcmp(argv[2], "valid")) validate_detector(datacfg, cfg, weights, outfile); |
|
|
|
|
else if (0 == strcmp(argv[2], "recall")) validate_detector_recall(datacfg, cfg, weights); |
|
|
|
|
else if (0 == strcmp(argv[2], "map")) validate_detector_map(datacfg, cfg, weights, thresh, iou_thresh, map_points, letter_box, NULL); |
|
|
|
|