darknet yolo vs2013怎么使用cpu版本

你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
YOLO项目官网用的是darknet但是一直装不上去啊,caffe上有没有实现YOLO呢?
官网上的可以实现啊
要回复问题请先或
在读研究生,DL入门菜鸟
浏览: 2752
关注: 3 人1970人阅读
YOLO(10)
作者配置时的环境
visual studio 2013
显卡 GTX 960M
Opencv 2.4.9
1、 新建vs工程
2、 将工程设置为Release x64 模式
3、然后再工程添加这三个文件夹,命名为c,h,cu。然后分别添加.cu .c .h 文件, 这个地方需要注意,添加的文件的位置在darknet下的src中,但是并不需要添加所有的.cu .c .h。如图是Makefile里面的截图,里面显示需要添加的文件。
4、接下来是添加包含目录,分别是cuda7.5,opencv,pthread的inlcude
5、同理,按照下图添加lib路径
6、同理,按图添cuda7.5,opencv,pthread的lib
7、接下来这个要注意,在预编译的地方添加GPU和OPENCV
8、接下来就是修改源码的一些可能出现的问题
在使用inline的文件的最前面添加这样的一句话
#define inline __inline
编译的时候会出现包结构体的错误,这个时候将结构体变量的定义放在函数体的最前面
9、编译通过之后就可以进行测试:
可以在vs命令参数中输入: yolo demo yolo-tiny.cfg(添加路径) yolo-tiny.weights(路径)
或者 yolo demo yolo-tiny.cfg(添加路径) yolo-tiny.weights(路径)
10、存在的问题:
这样编译之后,作者的摄像头读取的方式不能时候,暂时想到的问题是多线程的问题,现在还没解决。
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:13098次
排名:千里之外
原创:67篇
评论:58条
(7)(15)(15)(17)(1)(9)(10)OpenCV(21)
Deep Learing(11)
程序实践(31)
#include &network.h&
#include &detection_layer.h&
#include &cost_layer.h&
#include &utils.h&
#include &parser.h&
#include &box.h&
#ifdef OPENCV
#include &opencv2/highgui/highgui_c.h&
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[20];
void train_yolo(char *cfgfile, char *weightfile)
char *train_images = &data/train.txt&;
char *backup_directory = &/home/yjy/darknet/backup&;
srand(time(0));
data_seed = time(0);
char *base = basecfg(cfgfile);
printf(&%s\n&, base);
float avg_loss = -1;
network net = parse_network_cfg(cfgfile);
if(weightfile){
load_weights(&net, weightfile);
printf(&Learning Rate: %g, Momentum: %g, Decay: %g\n&, net.learning_rate, net.momentum, net.decay);
int imgs = net.batch*net.
int i = *net.seen/
data train,
layer l = net.layers[net.n - 1];
int side = l.
int classes = l.
float jitter = l.
list *plist = get_paths(train_images);
//int N = plist-&
char **paths = (char **)list_to_array(plist);
load_args args = {0};
args.w = net.w;
args.h = net.h;
args.paths =
args.m = plist-&
args.classes =
args.jitter =
args.num_boxes =
args.d = &
args.type = REGION_DATA;
pthread_t load_thread = load_data_in_thread(args);
//while(i*imgs & N*120){
while(get_current_batch(net) & net.max_batches){
time=clock();
pthread_join(load_thread, 0);
load_thread = load_data_in_thread(args);
printf(&Loaded: %lf seconds\n&, sec(clock()-time));
time=clock();
float loss = train_network(net, train);
if (avg_loss & 0) avg_loss =
avg_loss = avg_loss*.9 + loss*.1;
printf(&%d: %f, %f avg, %f rate, %lf seconds, %d images\n&, i, loss, avg_loss, get_current_rate(net), sec(clock()-time), i*imgs);
if(i%1000==0 || i == 600){
char buff[256];
sprintf(buff, &%s/%s_%d.weights&, backup_directory, base, i);
save_weights(net, buff);
free_data(train);
char buff[256];
sprintf(buff, &%s/%s_final.weights&, backup_directory, base);
save_weights(net, buff);
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)
int i,j,n;
//int per_cell = 5*num+
for (i = 0; i & side* ++i){
int row = i /
int col = i %
for(n = 0; n & ++n){
int index = i*num +
int p_index = side*side*classes + i*num +
float scale = predictions[p_index];
int box_index = side*side*(classes + num) + (i*num + n)*4;
boxes[index].x = (predictions[box_index + 0] + col) / side *
boxes[index].y = (predictions[box_index + 1] + row) / side *
boxes[index].w = pow(predictions[box_index + 2], (square?2:1)) *
boxes[index].h = pow(predictions[box_index + 3], (square?2:1)) *
for(j = 0; j & ++j){
int class_index = i*
float prob = scale*predictions[class_index+j];
probs[index][j] = (prob & thresh) ? prob : 0;
if(only_objectness){
probs[index][0] =
void print_yolo_detections(FILE **fps, char *id, box *boxes, float **probs, int total, int classes, int w, int h)
for(i = 0; i & ++i){
float xmin = boxes[i].x - boxes[i].w/2.;
float xmax = boxes[i].x + boxes[i].w/2.;
float ymin = boxes[i].y - boxes[i].h/2.;
float ymax = boxes[i].y + boxes[i].h/2.;
if (xmin & 0) xmin = 0;
if (ymin & 0) ymin = 0;
if (xmax & w) xmax =
if (ymax & h) ymax =
for(j = 0; j & ++j){
if (probs[i][j]) fprintf(fps[j], &%s %f %f %f %f %f\n&, id, probs[i][j],
xmin, ymin, xmax, ymax);
void validate_yolo(char *cfgfile, char *weightfile)
network net = parse_network_cfg(cfgfile);
if(weightfile){
load_weights(&net, weightfile);
set_batch_network(&net, 1);
fprintf(stderr, &Learning Rate: %g, Momentum: %g, Decay: %g\n&, net.learning_rate, net.momentum, net.decay);
srand(time(0));
char *base = &results/comp4_det_test_&;
list *plist = get_paths(&data/voc.2007.test&);
//list *plist = get_paths(&data/voc.2012.test&);
char **paths = (char **)list_to_array(plist);
layer l = net.layers[net.n-1];
int classes = l.
int square = l.
int side = l.
FILE **fps = calloc(classes, sizeof(FILE *));
for(j = 0; j & ++j){
char buff[1024];
snprintf(buff, 1024, &%s%s.txt&, base, voc_names[j]);
fps[j] = fopen(buff, &w&);
box *boxes = calloc(side*side*l.n, sizeof(box));
float **probs = calloc(side*side*l.n, sizeof(float *));
for(j = 0; j & side*side*l.n; ++j) probs[j] = calloc(classes, sizeof(float *));
int m = plist-&
float thresh = .001;
int nms = 1;
float iou_thresh = .5;
int nthreads = 2;
image *val = calloc(nthreads, sizeof(image));
image *val_resized = calloc(nthreads, sizeof(image));
image *buf = calloc(nthreads, sizeof(image));
image *buf_resized = calloc(nthreads, sizeof(image));
pthread_t *thr = calloc(nthreads, sizeof(pthread_t));
load_args args = {0};
args.w = net.w;
args.h = net.h;
args.type = IMAGE_DATA;
for(t = 0; t & ++t){
args.path = paths[i+t];
args.im = &buf[t];
args.resized = &buf_resized[t];
thr[t] = load_data_in_thread(args);
time_t start = time(0);
for(i = i & m+ i += nthreads){
fprintf(stderr, &%d\n&, i);
for(t = 0; t & nthreads && i+t-nthreads & ++t){
pthread_join(thr[t], 0);
val[t] = buf[t];
val_resized[t] = buf_resized[t];
for(t = 0; t & nthreads && i+t & ++t){
args.path = paths[i+t];
args.im = &buf[t];
args.resized = &buf_resized[t];
thr[t] = load_data_in_thread(args);
for(t = 0; t & nthreads && i+t-nthreads & ++t){
char *path = paths[i+t-nthreads];
char *id = basecfg(path);
float *X = val_resized[t].
float *predictions = network_predict(net, X);
int w = val[t].w;
int h = val[t].h;
convert_yolo_detections(predictions, classes, l.n, square, side, w, h, thresh, probs, boxes, 0);
if (nms) do_nms_sort(boxes, probs, side*side*l.n, classes, iou_thresh);
print_yolo_detections(fps, id, boxes, probs, side*side*l.n, classes, w, h);
free_image(val[t]);
free_image(val_resized[t]);
fprintf(stderr, &Total Detection Time: %f Seconds\n&, (double)(time(0) - start));
void validate_yolo_recall(char *cfgfile, char *weightfile)
network net = parse_network_cfg(cfgfile);
if(weightfile){
load_weights(&net, weightfile);
set_batch_network(&net, 1);
fprintf(stderr, &Learning Rate: %g, Momentum: %g, Decay: %g\n&, net.learning_rate, net.momentum, net.decay);
srand(time(0));
char *base = &results/comp4_det_test_&;
list *plist = get_paths(&data/voc.2007.test&);
char **paths = (char **)list_to_array(plist);
layer l = net.layers[net.n-1];
int classes = l.
int square = l.
int side = l.
FILE **fps = calloc(classes, sizeof(FILE *));
for(j = 0; j & ++j){
char buff[1024];
snprintf(buff, 1024, &%s%s.txt&, base, voc_names[j]);
fps[j] = fopen(buff, &w&);
box *boxes = calloc(side*side*l.n, sizeof(box));
float **probs = calloc(side*side*l.n, sizeof(float *));
for(j = 0; j & side*side*l.n; ++j) probs[j] = calloc(classes, sizeof(float *));
int m = plist-&
float thresh = .001;
float iou_thresh = .5;
float nms = 0;
int total = 0;
int correct = 0;
int proposals = 0;
float avg_iou = 0;
for(i = 0; i & ++i){
char *path = paths[i];
image orig = load_image_color(path, 0, 0);
image sized = resize_image(orig, net.w, net.h);
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);
char *labelpath = find_replace(path, &images&, &labels&);
labelpath = find_replace(labelpath, &JPEGImages&, &labels&);
labelpath = find_replace(labelpath, &.jpg&, &.txt&);
labelpath = find_replace(labelpath, &.JPEG&, &.txt&);
int num_labels = 0;
box_label *truth = read_boxes(labelpath, &num_labels);
for(k = 0; k & side*side*l.n; ++k){
if(probs[k][0] & thresh){
for (j = 0; j & num_ ++j) {
box t = {truth[j].x, truth[j].y, truth[j].w, truth[j].h};
float best_iou = 0;
for(k = 0; k & side*side*l.n; ++k){
float iou = box_iou(boxes[k], t);
if(probs[k][0] & thresh && iou & best_iou){
best_iou =
avg_iou += best_
if(best_iou & iou_thresh){
fprintf(stderr, &%5d %5d %5d\tRPs/Img: %.2f\tIOU: %.2f%%\tRecall:%.2f%%\n&, i, correct, total, (float)proposals/(i+1), avg_iou*100/total, 100.*correct/total);
free_image(orig);
free_image(sized);
void test_yolo(char *cfgfile, char *weightfile, char *filename, float thresh)
network net = parse_network_cfg(cfgfile);
if(weightfile){
load_weights(&net, weightfile);
detection_layer l = net.layers[net.n-1];
set_batch_network(&net, 1);
srand(2222222);
char buff[256];
char *input =
float nms=.5;
box *boxes = calloc(l.side*l.side*l.n, sizeof(box));
float **probs = calloc(l.side*l.side*l.n, sizeof(float *));
for(j = 0; j & l.side*l.side*l.n; ++j) probs[j] = calloc(l.classes, sizeof(float *));
if(filename){
strncpy(input, filename, 256);
printf(&Enter Image Path: &);
fflush(stdout);
input = fgets(input, 256, stdin);
if(!input)
strtok(input, &\n&);
image im = load_image_color(input,0,0);
image sized = resize_image(im, net.w, net.h);
float *X = sized.
time=clock();
float *predictions = network_predict(net, X);
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);
show_image(im, &predictions&);
show_image(sized, &resized&);
free_image(im);
free_image(sized);
#ifdef OPENCV
cvWaitKey(0);
cvDestroyAllWindows();
if (filename)
#ifdef OPENCV
image ipl_to_image(IplImage* src);
#include &opencv2/highgui/highgui_c.h&
#include &opencv2/imgproc/imgproc_c.h&
void demo_swag(char *cfgfile, char *weightfile, float thresh)
network net = parse_network_cfg(cfgfile);
if(weightfile){
load_weights(&net, weightfile);
detection_layer layer = net.layers[net.n-1];
CvCapture *capture = cvCaptureFromCAM(-1);
//CvCapture *capture = cvCreateFileCapture(-1);
set_batch_network(&net, 1);
srand(2222222);
IplImage* frame = cvQueryFrame(capture);
image im = ipl_to_image(frame);
cvReleaseImage(&frame);
rgbgr_image(im);
image sized = resize_image(im, net.w, net.h);
float *X = sized.
float *predictions = network_predict(net, X);
draw_swag(im, predictions, layer.side, layer.n, &predictions&, thresh);
free_image(im);
free_image(sized);
cvWaitKey(10);
void demo_swag(char *cfgfile, char *weightfile, float thresh){}
#ifdef OPENCV
#include &stdio.h&
#include &cv.h&
#include &highgui.h&
#include &opencv2/highgui/highgui_c.h&
#include &opencv2/imgproc/imgproc_c.h&
void video_yolo(char *cfgfile, char *weightfile, float thresh)
network net = parse_network_cfg(cfgfile);
if(weightfile){
load_weights(&net, weightfile);
detection_layer layer = net.layers[net.n-1];
printf(&the first!&);
cvNamedWindow(&edges&,1);
CvCapture *cap = cvCreateFileCapture(&aa.avi&);
set_batch_network(&net, 1);
srand(2222222);
frame = cvQueryFrame(cap);
if (!frame)
cvShowImage(&edges&, frame);
if(cvWaitKey(30) &= 0)
cvReleaseCapture(&cap);
cvDestroyWindow(&edges&);
void demo_yolo(char *cfgfile, char *weightfile, float thresh, int cam_index);
#ifndef GPU
void demo_yolo(char *cfgfile, char *weightfile, float thresh, int cam_index)
fprintf(stderr, &Darknet must be compiled with CUDA for YOLO demo.\n&);
void run_yolo(int argc, char **argv)
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){
fprintf(stderr, &usage: %s %s [train/test/valid] [cfg] [weights (optional)]\n&, argv[0], argv[1]);
char *cfg = argv[3];
char *weights = (argc & 4) ? argv[4] : 0;
char *filename = (argc & 5) ? argv[5]: 0;
if(0==strcmp(argv[2], &test&)) test_yolo(cfg, weights, filename, thresh);
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_yolo(cfg, weights, thresh, cam_index);
else if(0==strcmp(argv[2], &video&)) video_yolo(cfg, weights, thresh);
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:42281次
积分:1008
积分:1008
排名:千里之外
原创:54篇
转载:21篇
(2)(3)(1)(3)(6)(4)(3)(2)(4)(4)(1)(4)(1)(2)(2)(1)(4)(8)(1)(1)(8)(6)&注:1.本博文持续更新中,文章较长,可以收藏方便下次阅读。2.本人原创,谢绝转载。
1.YOLO: You Only Look Once:Unified, Real-Time Object Detection
YOLO是一个可以一次性预测多个Box位置和类别的卷积神经网络,能够实现端到端的目标检测和识别,其最大的优势就是速度快。事实上,目标检测的本质就是回归,因此一个实现回归功能的CNN并不需要复杂的设计过程。YOLO没有选择滑窗或提取proposal的方式训练网络,而是直接选用整图训练模型。这样做的好处在于可以更好的区分目标和背景区域,相比之下,采用proposal训练方式的Fast-R-CNN常常把背景区域误检为特定目标。当然,YOLO在提升检测速度的同时牺牲了一些精度。下图所示是YOLO检测系统流程:1.将图像Resize到448*448;2.运行CNN;3.非极大抑制优化检测结果。有兴趣的童鞋可以按照/darknet/install/的说明安装测试一下YOLO的scoring流程,非常容易上手。接下来将重点介绍YOLO的原理。
1.1 一体化检测方案
YOLO的设计理念遵循端到端训练和实时检测。YOLO将输入图像划分为S*S个网络,如果一个物体的中心落在某网格(cell)内,则相应网格负责检测该物体。在训练和测试时,每个网络预测B个bounding boxes,每个bounding box对应5个预测参数,即bounding box的中心点坐标(x,y),宽高(w,h),和置信度评分。这里的置信度评分(Pr(Object)*IOU(pred|truth))综合反映基于当前模型bounding box内存在目标的可能性Pr(Object)和bounding box预测目标位置的准确性IOU(pred|truth)。如果bouding box内不存在物体,则Pr(Object)=0。如果存在物体,则根据预测的bounding box和真实的bounding box计算IOU,同时会预测存在物体的情况下该物体属于某一类的后验概率Pr(Class_i|Object)。假定一共有C类物体,那么每一个网格只预测一次C类物体的条件类概率Pr(Class_i|Object), i=1,2,...,C;每一个网格预测B个bounding box的位置。即这B个bounding box共享一套条件类概率Pr(Class_i|Object), i=1,2,...,C。基于计算得到的Pr(Class_i|Object),在测试时可以计算某个bounding box类相关置信度:Pr(Class_i|Object)*Pr(Object)*IOU(pred|truth)=Pr(Class_i)*IOU(pred|truth)。如果将输入图像划分为7*7网格(S=7),每个网格预测2个bounding box (B=2),有20类待检测的目标(C=20),则相当于最终预测一个长度为S*S*(B*5+C)=7*7*30的向量,从而完成检测+识别任务,整个流程可以通过下图理解。
1.1.1 网络设计
YOLO网络设计遵循了GoogleNet的思想,但与之有所区别。YOLO使用了24个级联的卷积(conv)层和2个全连接(fc)层,其中conv层包括3*3和1*1两种Kernel,最后一个fc层即YOLO网络的输出,长度为S*S*(B*5+C)=7*7*30.此外,作者还设计了一个简化版的YOLO-small网络,包括9个级联的conv层和2个fc层,由于conv层的数量少了很多,因此YOLO-small速度比YOLO快很多。如下图所示我们给出了YOLO网络的架构。
1.1.2 训练
作者训练YOLO网络是分步骤进行的:首先,作者从上图网络中取出前20个conv层,然后自己添加了一个average pooling层和一个fc层,用1000类的ImageNet数据与训练。在ImageNet2012上用224*224d的图像训练后得到的top5准确率是88%。然后,作者在20个预训练好的conv层后添加了4个新的conv层和2个fc层,并采用随即参数初始化这些新添加的层,在fine-tune新层时,作者选用448*448图像训练。最后一个fc层可以预测物体属于不同类的概率和bounding box中心点坐标x,y和宽高w,h。Boundingbox的宽高是相对于图像宽高归一化后得到的,Bounding box的中心位置坐标是相对于某一个网格的位置坐标进行过归一化,因此x,y,w,h均介于0到1之间。
在设计Loss函数时,有两个主要的问题:1.对于最后一层长度为7*7*30长度预测结果,计算预测loss通常会选用平方和误差。然而这种Loss函数的位置误差和分类误差是1:1的关系。2.整个图有7*7个网格,大多数网格实际不包含物体(当物体的中心位于网格内才算包含物体),如果只计算Pr(Class_i),很多网格的分类概率为0,网格loss呈现出稀疏矩阵的特性,使得Loss收敛效果变差,模型不稳定。为了解决上述问题,作者采用了一系列方案:
1.增加bounding box坐标预测的loss权重,降低bounding box分类的loss权重。坐标预测和分类预测的权重分别是&coord=5,&noobj=0.5.
2.平方和误差对于大和小的bounding box的权重是相同的,作者为了降低不同大小bounding box宽高预测的方差,采用了平方根形式计算宽高预测loss,即sqrt(w)和sqrt(h)。
训练Loss组成形式较为复杂,这里不作列举,如有兴趣可以参考作者原文慢慢理解体会。
1.1.3 测试
作者选用PASAL VOC图像测试训练得到的YOLO网络,每幅图会预测得到98个(7*7*2)个bouding box及相应的类概率。通常一个cell可以直接预测出一个物体对应的bounding box,但是对于某些尺寸较大或靠近图像边界的物体,需要多个网格预测的结果通过非极大抑制处理生成。虽然YOLO对于非极大抑制的依赖不及R-CNN和DPM,但非极大抑制确实可以将mAP提高2到3个点。
1.2 方法对比
作者将YOLO目标检测与识别方法与其他几种经典方案进行比较可知:
DPM(Deformable parts models): DPM是一种基于滑窗方式的目标检测方法,基本流程包括几个独立的环节:特征提取,区域划分,基于高分值区域预测bounding box。YOLO采用端到端的训练方式,将特征提取、候选框预测,非极大抑制及目标识别连接在一起,实现了更快更准的检测模型。
R-CNN:R-CNN方案分需要先用SeletiveSearch方法提取proposal,然后用CNN进行特征提取,最后用SVM训练分类器。如此方案,诚繁琐也!YOLO精髓思想与其类似,但是通过共享卷积特征的方式提取proposal和目标识别。另外,YOLO用网格对proposal进行空间约束,避免在一些区域重复提取Proposal,相较于SeletiveSearch提取2000个proposal进行R-CNN训练,YOLO只需要提取98个proposal,这样训练和测试速度怎能不快?
Fast-R-CNN、Faster-R-CNN、Fast-DPM: Fast-R-CNN和Faster-R-CNN分别替换了SVMs训练和SelectiveSeach提取proposal的方式,在一定程度上加速了训练和测试速度,但其速度依然无法和YOLO相比。同理,将DPM优化在GPU上实现也无出YOLO之右。
1.3.1 实时检测识别系统对比
1.3.2 VOC2007准确率比较
1.3.3 Fast-R-CNN和YOLO错误分析
如图所示,不同区域分别表示不同的指标:
Correct:正确检测和识别的比例,即分类正确且IOU&0.5
Localization:分类正确,但0.1&IOU&0.5
Similar:类别相似,IOU&0.1
Other:分类错误,IOU&0.1
Background: 对于任何目标IOU&0.1
可以看出,YOLO在定位目标位置时准确度不及Fast-R-CNN。YOLO的error中,目标定位错误占据的比例最大,比Fast-R-CNN高出了10个点。但是,YOLO在定位识别背景时准确率更高,可以看出Fast-R-CNN假阳性很高(Background=13.6%,即认为某个框是目标,但是实际里面不含任何物体)。
1.3.4 VOC2012准确率比较
由于YOLO在目标检测和识别是处理背景部分优势更明显,因此作者设计了Fast-R-CNN+YOLO检测识别模式,即先用R-CNN提取得到一组bounding box,然后用YOLO处理图像也得到一组bounding box。对比这两组bounding box是否基本一致,如果一致就用YOLO计算得到的概率对目标分类,最终的bouding box的区域选取二者的相交区域。Fast-R-CNN的最高准确率可以达到71.8%,采用Fast-R-CNN+YOLO可以将准确率提升至75.0%。这种准确率的提升是基于YOLO在测试端出错的情况不同于Fast-R-CNN。虽然Fast-R-CNN_YOLO提升了准确率,但是相应的检测识别速度大大降低,因此导致其无法实时检测。
使用VOC2012测试不同算法的mean Average Precision,YOLO的mAP=57.9%,该数值与基于VGG16的RCNN检测算法准确率相当。对于不同大小图像的测试效果进行研究,作者发现:YOLO在检测小目标时准确率比R-CNN低大约8~10%,在检测大目标是准确率高于R-CNN。采用Fast-R-CNN+YOLO的方式准确率最高,比Fast-R-CNN的准确率高了2.3%。
YOLO是一种支持端到端训练和测试的卷积神经网络,在保证一定准确率的前提下能图像中多目标的检测与识别。
[1] Redmon J, Divvala S, Girshick R, et al. You only look once: Unified, real-time object detection. In CVPR 2016
[2] Najibi M, Rastegari M, Davis L S. G-CNN: an Iterative Grid Based Object Detector. In CVPR 2016
[3] Gidaris S, Komodakis N. LocNet: Improving Localization Accuracy for Object Detection. In CVPR 2016
阅读(...) 评论()

我要回帖

更多关于 yolo darknet 训练 的文章

 

随机推荐