Fixed detection and validate(recall, map) for .png and .bmp images.

pull/675/head
AlexeyAB 7 years ago
parent eccfccdaf7
commit c2c8595b08
  1. 3
      build/darknet/x64/partial.cmd
  2. 1
      src/data.c
  3. 13
      src/detector.c

@ -15,6 +15,9 @@ darknet.exe partial cfg/yolov2-tiny.cfg yolov2-tiny.weights yolov2-tiny.conv.13
darknet.exe partial cfg/yolo-voc.cfg yolo-voc.weights yolo-voc.conv.23 23
darknet.exe partial cfg/yolov2.cfg yolov2.weights yolov2.conv.23 23
darknet.exe partial cfg/yolo9000.cfg yolo9000.weights yolo9000.conv.22 22

@ -302,6 +302,7 @@ void fill_truth_detection(char *path, int num_boxes, float *truth, int classes,
find_replace(labelpath, "raw", "labels", labelpath);
find_replace(labelpath, ".jpg", ".txt", labelpath);
find_replace(labelpath, ".png", ".txt", labelpath);
find_replace(labelpath, ".bmp", ".txt", labelpath);
find_replace(labelpath, ".JPG", ".txt", labelpath);
find_replace(labelpath, ".JPEG", ".txt", labelpath);
int count = 0;

@ -460,6 +460,9 @@ void validate_detector_recall(char *datacfg, char *cfgfile, char *weightfile)
find_replace(path, "images", "labels", labelpath);
find_replace(labelpath, "JPEGImages", "labels", labelpath);
find_replace(labelpath, ".jpg", ".txt", labelpath);
find_replace(labelpath, ".png", ".txt", labelpath);
find_replace(labelpath, ".bmp", ".txt", labelpath);
find_replace(labelpath, ".JPG", ".txt", labelpath);
find_replace(labelpath, ".JPEG", ".txt", labelpath);
int num_labels = 0;
@ -484,7 +487,7 @@ void validate_detector_recall(char *datacfg, char *cfgfile, char *weightfile)
++correct;
}
}
fprintf(stderr, " %s - %s - ", paths[i], labelpath);
//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(id);
free_image(orig);
@ -614,8 +617,10 @@ void validate_detector_map(char *datacfg, char *cfgfile, char *weightfile, float
find_replace(path, "images", "labels", labelpath);
find_replace(labelpath, "JPEGImages", "labels", labelpath);
find_replace(labelpath, ".jpg", ".txt", labelpath);
find_replace(labelpath, ".JPEG", ".txt", labelpath);
find_replace(labelpath, ".png", ".txt", labelpath);
find_replace(labelpath, ".bmp", ".txt", labelpath);
find_replace(labelpath, ".JPG", ".txt", labelpath);
find_replace(labelpath, ".JPEG", ".txt", labelpath);
int num_labels = 0;
box_label *truth = read_boxes(labelpath, &num_labels);
int i, j;
@ -861,8 +866,10 @@ void calc_anchors(char *datacfg, int num_of_clusters, int width, int height, int
find_replace(path, "images", "labels", labelpath);
find_replace(labelpath, "JPEGImages", "labels", labelpath);
find_replace(labelpath, ".jpg", ".txt", labelpath);
find_replace(labelpath, ".JPEG", ".txt", labelpath);
find_replace(labelpath, ".png", ".txt", labelpath);
find_replace(labelpath, ".bmp", ".txt", labelpath);
find_replace(labelpath, ".JPG", ".txt", labelpath);
find_replace(labelpath, ".JPEG", ".txt", labelpath);
int num_labels = 0;
box_label *truth = read_boxes(labelpath, &num_labels);
//printf(" new path: %s \n", labelpath);

Loading…
Cancel
Save