yolo-v2只識別person

一.修改源代碼

(1)修改cfg/voc.dataide

classess=20    改爲 classes = 1函數

(2)修改data/voc.names測試

只留下person這一類spa

(3)修改examples/detector.ccode

1 void run_detector(int argc, char **argv)//該函數中,倒數第三行.line=542
2 int classes = option_find_int(options, "classes", 1);//最後一個參數修改爲1
3 
4 void test_detector(char *datacfg, char *cfgfile, char *weightfile, char *filename, float thresh)函數中
5 draw_detections(im, l.w*l.h*l.n, thresh, boxes, probs, names, alphabet, 1); //最後一個參數修改爲1。line=481

二.從新編譯和測試

(1)從新編譯blog

make clean圖片

makeio

(2)測試編譯

./darknet detect cfg/yolo.cfg yolo.weights /home/260158/pictures-data/mark-pic/video1/images/491.jpg class

上面爲個人圖片路徑

相關文章
相關標籤/搜索