AlexeyAB
2018-04-19 c2c8595b083ec3586a99bb913b8a986e81e3a42a
Fixed detection and validate(recall, map) for .png and .bmp images.
3 files modified
17 ■■■■ changed files
build/darknet/x64/partial.cmd 3 ●●●●● patch | view | raw | blame | history
src/data.c 1 ●●●● patch | view | raw | blame | history
src/detector.c 13 ●●●● patch | view | raw | blame | history
build/darknet/x64/partial.cmd
@@ -15,6 +15,9 @@
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
src/data.c
@@ -302,6 +302,7 @@
    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;
src/detector.c
@@ -460,6 +460,9 @@
        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 @@
                ++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 @@
            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 @@
        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);