YOLO学习-API尝试

YOLO-V2实现识别单类

源码修改

修改cfg/voc.data

classess=20 改成 classes = 1
YOLO学习-API尝试_第1张图片

修改data/voc.names

只留下person这一类
2

修改examples/detector.c

  1. 修改run_detector函数
void run_detector(int argc, char **argv)//该函数中,第line=849行
int classes = option_find_int(options, "classes", 1);//最后一个参数修改成1

YOLO学习-API尝试_第2张图片
2.修改test_detector函数

void test_detector(char *datacfg, char *cfgfile, char *weightfile, char *filename, float thresh, float hier_thresh, char *outfile, int fullscreen)
//函数中,第line=604行
draw_detections(im, dets, nboxes, thresh, names, alphabet, l.classes); //l.classes改成 1 

YOLO学习-API尝试_第3张图片

重新编译和测试

  1. 编译
make clean
make
  1. 测试
./darknet detect cfg/yolov3.cfg  cfg/yolov3.weights /home/it/Yolo/crop001007.png 

参考文献

YOLO2论文介绍
YOLOV2回顾
YOLO-V2识别单物体
YOLO-V2代码详解
yolo v2文件结构和源码的简单梳理
yolo-v2只识别person
YOLO 9000论文翻译

你可能感兴趣的:(python,深度学习)