AlexeyAB
2018-03-30 9fbd1936ebed466aad50c52989b92d5e3fedc099
small_object can be used in [net] in cfg-file for objects 1x1 pix on FullHD image
5 files modified
12 ■■■■ changed files
src/data.c 6 ●●●● patch | view | raw | blame | history
src/detector.c 2 ●●● patch | view | raw | blame | history
src/layer.h 1 ●●●● patch | view | raw | blame | history
src/network.h 1 ●●●● patch | view | raw | blame | history
src/parser.c 2 ●●● patch | view | raw | blame | history
src/data.c
@@ -308,8 +308,8 @@
    box_label *boxes = read_boxes(labelpath, &count);
    if (small_object == 1) {
        for (i = 0; i < count; ++i) {
            if (boxes[i].w < 0.01) boxes[i].w = 0.01;
            if (boxes[i].h < 0.01) boxes[i].h = 0.01;
            if (boxes[i].w < 0.001F) boxes[i].w = 0.001F;
            if (boxes[i].h < 0.001F) boxes[i].h = 0.001F;
        }
    }
    randomize_boxes(boxes, count);
@@ -326,7 +326,7 @@
        id = boxes[i].id;
        // not detect small objects
        if ((w < 0.001 || h < 0.001)) continue;
        if ((w < 0.001F || h < 0.001F)) continue;
        truth[i*5+0] = x;
        truth[i*5+1] = y;
src/detector.c
@@ -88,7 +88,7 @@
    args.classes = classes;
    args.jitter = jitter;
    args.num_boxes = l.max_boxes;
    args.small_object = l.small_object;
    args.small_object = net.small_object;
    args.d = &buffer;
    args.type = DETECTION_DATA;
    args.threads = 64;  // 8
src/layer.h
@@ -78,7 +78,6 @@
    int out_h, out_w, out_c;
    int n;
    int max_boxes;
    int small_object;
    int groups;
    int size;
    int side;
src/network.h
@@ -57,6 +57,7 @@
    float exposure;
    float saturation;
    float hue;
    int small_object;
    int gpu_index;
    tree *hierarchy;
src/parser.c
@@ -311,7 +311,6 @@
    l.log = option_find_int_quiet(options, "log", 0);
    l.sqrt = option_find_int_quiet(options, "sqrt", 0);
    l.small_object = option_find_int_quiet(options, "small_object", 0);
    l.softmax = option_find_int(options, "softmax", 0);
    l.focal_loss = option_find_int_quiet(options, "focal_loss", 0);
    //l.max_boxes = option_find_int_quiet(options, "max",30);
@@ -622,6 +621,7 @@
    net->max_crop = option_find_int_quiet(options, "max_crop",net->w*2);
    net->min_crop = option_find_int_quiet(options, "min_crop",net->w);
    net->small_object = option_find_int_quiet(options, "small_object", 0);
    net->angle = option_find_float_quiet(options, "angle", 0);
    net->aspect = option_find_float_quiet(options, "aspect", 1);
    net->saturation = option_find_float_quiet(options, "saturation", 1);