| | |
| | | load_weights(&net, weightfile); |
| | | } |
| | | set_batch_network(&net, 1); |
| | | fuse_conv_batchnorm(net); |
| | | srand(time(0)); |
| | | |
| | | //list *plist = get_paths("data/coco_val_5k.list"); |
| | |
| | | ++total; |
| | | box t = { truth[j].x, truth[j].y, truth[j].w, truth[j].h }; |
| | | float best_iou = 0; |
| | | for (k = 0; k < l.w*l.h*l.n; ++k) { |
| | | for (k = 0; k < nboxes; ++k) { |
| | | float iou = box_iou(dets[k].bbox, t); |
| | | if (dets[k].objectness > thresh && iou > best_iou) { |
| | | best_iou = iou; |
| | |
| | | load_weights(&net, weightfile); |
| | | } |
| | | set_batch_network(&net, 1); |
| | | fuse_conv_batchnorm(net); |
| | | srand(time(0)); |
| | | |
| | | list *plist = get_paths(valid_images); |
| | |
| | | int nboxes = 0; |
| | | int letterbox = (args.type == LETTERBOX_DATA); |
| | | float hier_thresh = 0; |
| | | detection *dets = get_network_boxes(&net, 1, 1, thresh, hier_thresh, 0, 1, &nboxes, letterbox); |
| | | detection *dets = get_network_boxes(&net, 1, 1, thresh, hier_thresh, 0, 0, &nboxes, letterbox); |
| | | if (nms) do_nms_sort_v3(dets, nboxes, l.classes, nms); |
| | | |
| | | char labelpath[4096]; |
| | |
| | | { |
| | | anchors_t a = *(anchors_t *)pa; |
| | | anchors_t b = *(anchors_t *)pb; |
| | | float diff = b.w - a.w; |
| | | float diff = b.w*b.h - a.w*a.h; |
| | | if (diff < 0) return 1; |
| | | else if (diff > 0) return -1; |
| | | return 0; |
| | |
| | | load_weights(&net, weightfile); |
| | | } |
| | | set_batch_network(&net, 1); |
| | | fuse_conv_batchnorm(net); |
| | | srand(2222222); |
| | | clock_t time; |
| | | char buff[256]; |
| | |
| | | demo(cfg, weights, thresh, hier_thresh, cam_index, filename, names, classes, frame_skip, prefix, out_filename, |
| | | http_stream_port, dont_show); |
| | | } |
| | | else printf(" There isn't such command: %s", argv[2]); |
| | | } |