| | |
| | | |
| | | #ifdef OPENCV |
| | | #include "opencv2/highgui/highgui_c.h" |
| | | #include "opencv2/imgproc/imgproc_c.h" |
| | | #include "opencv2/core/version.hpp" |
| | | #ifndef CV_VERSION_EPOCH |
| | | #include "opencv2/videoio/videoio_c.h" |
| | | #endif |
| | | #endif |
| | | |
| | | char *voc_names[] = {"aeroplane", "bicycle", "bird", "boat", "bottle", "bus", "car", "cat", "chair", "cow", "diningtable", "dog", "horse", "motorbike", "person", "pottedplant", "sheep", "sofa", "train", "tvmonitor"}; |
| | |
| | | |
| | | void test_yolo(char *cfgfile, char *weightfile, char *filename, float thresh) |
| | | { |
| | | image *alphabet = load_alphabet(); |
| | | image **alphabet = load_alphabet(); |
| | | network net = parse_network_cfg(cfgfile); |
| | | if(weightfile){ |
| | | load_weights(&net, weightfile); |
| | |
| | | |
| | | void run_yolo(int argc, char **argv) |
| | | { |
| | | char *out_filename = find_char_arg(argc, argv, "-out_filename", 0); |
| | | char *prefix = find_char_arg(argc, argv, "-prefix", 0); |
| | | float thresh = find_float_arg(argc, argv, "-thresh", .2); |
| | | int cam_index = find_int_arg(argc, argv, "-c", 0); |
| | |
| | | else if(0==strcmp(argv[2], "train")) train_yolo(cfg, weights); |
| | | else if(0==strcmp(argv[2], "valid")) validate_yolo(cfg, weights); |
| | | else if(0==strcmp(argv[2], "recall")) validate_yolo_recall(cfg, weights); |
| | | else if(0==strcmp(argv[2], "demo")) demo(cfg, weights, thresh, cam_index, filename, voc_names, 20, frame_skip, prefix); |
| | | else if(0==strcmp(argv[2], "demo")) demo(cfg, weights, thresh, cam_index, filename, voc_names, 20, frame_skip, prefix, out_filename); |
| | | } |