Joseph Redmon
2015-11-26 0305fb4d99cf1efc7d4aa4d2ee2d65d54500d437
src/yolo_kernels.cu
@@ -20,6 +20,8 @@
extern "C" void convert_yolo_detections(float *predictions, int classes, int num, int square, int side, int w, int h, float thresh, float **probs, box *boxes, int only_objectness);
extern "C" void draw_yolo(image im, int num, float thresh, box *boxes, float **probs);
extern "C" char *voc_names[];
static float **probs;
static box *boxes;
static network net;
@@ -57,11 +59,11 @@
    printf("\033[1;1H");
    printf("\nFPS:%.0f\n",fps);
    printf("Objects:\n\n");
    draw_yolo(det, l.side*l.side*l.n, thresh, boxes, probs);
    draw_detections(det, l.side*l.side*l.n, thresh, boxes, probs, voc_names, 0, 20);
    return 0;
}
extern "C" void demo_yolo(char *cfgfile, char *weightfile, float thresh)
extern "C" void demo_yolo(char *cfgfile, char *weightfile, float thresh, int cam_index)
{
    printf("YOLO demo\n");
    net = parse_network_cfg(cfgfile);
@@ -72,7 +74,7 @@
    srand(2222222);
    cv::VideoCapture cam(0);
    cv::VideoCapture cam(cam_index);
    cap = cam;
    if(!cap.isOpened()) error("Couldn't connect to webcam.\n");
@@ -118,7 +120,7 @@
    }
}
#else
extern "C" void demo_yolo(char *cfgfile, char *weightfile, float thresh){
extern "C" void demo_yolo(char *cfgfile, char *weightfile, float thresh, int cam_index){
    fprintf(stderr, "YOLO demo needs OpenCV for webcam images.\n");
}
#endif