Joseph Redmon
2016-01-28 913d355ec1cf34aad71fdd75202fc3b0309e63a0
src/yolo.c
@@ -10,11 +10,11 @@
#endif
char *voc_names[] = {"aeroplane", "bicycle", "bird", "boat", "bottle", "bus", "car", "cat", "chair", "cow", "diningtable", "dog", "horse", "motorbike", "person", "pottedplant", "sheep", "sofa", "train", "tvmonitor"};
image voc_labels[80];
image voc_labels[20];
void train_yolo(char *cfgfile, char *weightfile)
{
    char *train_images = "data/voc.0712.trainval";
    char *train_images = "/data/voc/train.txt";
    char *backup_directory = "/home/pjreddie/backup/";
    srand(time(0));
    data_seed = time(0);
@@ -255,9 +255,8 @@
    int i=0;
    float thresh = .001;
    int nms = 0;
    float iou_thresh = .5;
    float nms_thresh = .5;
    float nms = 0;
    int total = 0;
    int correct = 0;
@@ -271,7 +270,7 @@
        char *id = basecfg(path);
        float *predictions = network_predict(net, sized.data);
        convert_yolo_detections(predictions, classes, l.n, square, side, 1, 1, thresh, probs, boxes, 1);
        if (nms) do_nms(boxes, probs, side*side*l.n, 1, nms_thresh);
        if (nms) do_nms(boxes, probs, side*side*l.n, 1, nms);
        char *labelpath = find_replace(path, "images", "labels");
        labelpath = find_replace(labelpath, "JPEGImages", "labels");
@@ -344,8 +343,10 @@
        printf("%s: Predicted in %f seconds.\n", input, sec(clock()-time));
        convert_yolo_detections(predictions, l.classes, l.n, l.sqrt, l.side, 1, 1, thresh, probs, boxes, 0);
        if (nms) do_nms_sort(boxes, probs, l.side*l.side*l.n, l.classes, nms);
        draw_detections(im, l.side*l.side*l.n, thresh, boxes, probs, voc_names, voc_labels, 20);
        //draw_detections(im, l.side*l.side*l.n, thresh, boxes, probs, voc_names, voc_labels, 20);
        draw_detections(im, l.side*l.side*l.n, thresh, boxes, probs, voc_names, 0, 20);
        show_image(im, "predictions");
        save_image(im, "predictions");
        show_image(sized, "resized");
        free_image(im);