yolo-v2只識別person


一.修改源代碼

(1)修改cfg/voc.data

classess=20    改成 classes = 1

(2)修改data/voc.names

只留下person這一類

(3)修改examples/detector.c

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)重新編譯

make clean

make

(2)測試

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

上面為我的圖片路徑

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM