diff --git a/src/yolo.c b/src/yolo.c index 86b132b0..319694b4 100644 --- a/src/yolo.c +++ b/src/yolo.c @@ -10,6 +10,7 @@ #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]; void train_yolo(char *cfgfile, char *weightfile) { @@ -343,7 +344,7 @@ void test_yolo(char *cfgfile, char *weightfile, char *filename, float thresh) 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, 0, 20); + draw_detections(im, l.side*l.side*l.n, thresh, boxes, probs, voc_names, voc_labels, 20); show_image(im, "predictions"); show_image(sized, "resized"); @@ -403,6 +404,13 @@ void demo_yolo(char *cfgfile, char *weightfile, float thresh, int cam_index) void run_yolo(int argc, char **argv) { + int i; + for(i = 0; i < 20; ++i){ + char buff[256]; + sprintf(buff, "data/labels/%s.png", voc_names[i]); + voc_labels[i] = load_image_color(buff, 0, 0); + } + float thresh = find_float_arg(argc, argv, "-thresh", .2); int cam_index = find_int_arg(argc, argv, "-c", 0); if(argc < 4){