diff --git a/src/coco.c b/src/coco.c index 8c386a224bd..605e9ac1355 100644 --- a/src/coco.c +++ b/src/coco.c @@ -320,6 +320,7 @@ void validate_coco_recall(char *cfgfile, char *weightfile) //if (fps) free(fps); if (id) free(id); + free(truth); free_image(orig); free_image(sized); } diff --git a/src/detector.c b/src/detector.c index 73b7bedc158..c6bc788b96f 100644 --- a/src/detector.c +++ b/src/detector.c @@ -308,6 +308,15 @@ void train_detector(char *datacfg, char *cfgfile, char *weightfile, int *gpus, i if (mean_average_precision > 0) printf("\n Last accuracy mAP@%0.2f = %2.2f %%, best = %2.2f %% ", iou_thresh, mean_average_precision * 100, best_map * 100); } + #ifndef WIN32 + if (mean_average_precision > 0.0) { + printf("\033]2;%d/%d: loss=%0.1f map=%0.2f best=%0.2f hours left=%0.1f\007", iteration, net.max_batches, loss, mean_average_precision, best_map, avg_time); + } + else { + printf("\033]2;%d/%d: loss=%0.1f hours left=%0.1f\007", iteration, net.max_batches, loss, avg_time); + } + #endif + if (net.cudnn_half) { if (iteration < net.burn_in * 3) fprintf(stderr, "\n Tensor Cores are disabled until the first %d iterations are reached.\n", 3 * net.burn_in); else fprintf(stderr, "\n Tensor Cores are used.\n"); @@ -902,6 +911,7 @@ void validate_detector_recall(char *datacfg, char *cfgfile, char *weightfile) } //fprintf(stderr, " %s - %s - ", paths[i], labelpath); fprintf(stderr, "%5d %5d %5d\tRPs/Img: %.2f\tIOU: %.2f%%\tRecall:%.2f%%\n", i, correct, total, (float)proposals / (i + 1), avg_iou * 100 / total, 100.*correct / total); + free(truth); free(id); free_image(orig); free_image(sized); @@ -970,13 +980,13 @@ float validate_detector_map(char *datacfg, char *cfgfile, char *weightfile, floa list *plist = get_paths(valid_images); char **paths = (char **)list_to_array(plist); + list *plist_dif = NULL; char **paths_dif = NULL; if (difficult_valid_images) { - list *plist_dif = get_paths(difficult_valid_images); + plist_dif = get_paths(difficult_valid_images); paths_dif = (char **)list_to_array(plist_dif); } - layer l = net.layers[net.n - 1]; int k; for (k = 0; k < net.n; ++k) { @@ -1181,6 +1191,8 @@ float validate_detector_map(char *datacfg, char *cfgfile, char *weightfile, floa //if(errors_in_this_image > 0) fwrite(buff, sizeof(char), strlen(buff), reinforcement_fd); free_detections(dets, nboxes); + free(truth); + free(truth_dif); free(id); free_image(val[t]); free_image(val_resized[t]); @@ -1274,7 +1286,6 @@ float validate_detector_map(char *datacfg, char *cfgfile, char *weightfile, floa free(truth_flags); - double mean_average_precision = 0; for (i = 0; i < classes; ++i) { @@ -1362,7 +1373,14 @@ float validate_detector_map(char *datacfg, char *cfgfile, char *weightfile, floa free(detections); free(truth_classes_count); free(detection_per_class_count); - + free(paths); + free(paths_dif); + free_list_contents(plist); + free_list(plist); + if (plist_dif) { + free_list_contents(plist_dif); + free_list(plist_dif); + } free(avg_iou_per_class); free(tp_for_thresh_per_class); free(fp_for_thresh_per_class); @@ -1484,6 +1502,7 @@ void calc_anchors(char *datacfg, int num_of_clusters, int width, int height, int printf("\r loaded \t image: %d \t box: %d", i + 1, number_of_boxes); } free(buff); + free(truth); } printf("\n all loaded. \n"); printf("\n calculating k-means++ ..."); diff --git a/src/yolo.c b/src/yolo.c index 384c487291e..dd5e2a161de 100644 --- a/src/yolo.c +++ b/src/yolo.c @@ -277,6 +277,7 @@ void validate_yolo_recall(char *cfgfile, char *weightfile) fprintf(stderr, "%5d %5d %5d\tRPs/Img: %.2f\tIOU: %.2f%%\tRecall:%.2f%%\n", i, correct, total, (float)proposals/(i+1), avg_iou*100/total, 100.*correct/total); free(id); + free(truth); free_image(orig); free_image(sized); }