Joseph Redmon
2016-09-12 5c067dc44785a761a0243d8cd634e3ac17d548ad
src/detector.c
@@ -51,6 +51,11 @@
    args.d = &buffer;
    args.type = DETECTION_DATA;
    args.angle = net.angle;
    args.exposure = net.exposure;
    args.saturation = net.saturation;
    args.hue = net.hue;
    pthread_t load_thread = load_data_in_thread(args);
    clock_t time;
    //while(i*imgs < N*120){
@@ -112,8 +117,18 @@
            int box_index = index * (classes + 5);
            boxes[index].x = (predictions[box_index + 0] + col + .5) / side * w;
            boxes[index].y = (predictions[box_index + 1] + row + .5) / side * h;
            if(0){
                boxes[index].x = (logistic_activate(predictions[box_index + 0]) + col) / side * w;
                boxes[index].y = (logistic_activate(predictions[box_index + 1]) + row) / side * h;
            }
            boxes[index].w = pow(logistic_activate(predictions[box_index + 2]), (square?2:1)) * w;
            boxes[index].h = pow(logistic_activate(predictions[box_index + 3]), (square?2:1)) * h;
            if(1){
                boxes[index].x = ((col + .5)/side + predictions[box_index + 0] * .5) * w;
                boxes[index].y = ((row + .5)/side + predictions[box_index + 1] * .5) * h;
                boxes[index].w = (exp(predictions[box_index + 2]) * .5) * w;
                boxes[index].h = (exp(predictions[box_index + 3]) * .5) * h;
            }
            for(j = 0; j < classes; ++j){
                int class_index = index * (classes + 5) + 5;
                float prob = scale*predictions[class_index+j];
@@ -232,6 +247,9 @@
            free_image(val_resized[t]);
        }
    }
    for(j = 0; j < classes; ++j){
        fclose(fps[j]);
    }
    fprintf(stderr, "Total Detection Time: %f Seconds\n", (double)(time(0) - start));
}