1. 程式人生 > >YOLO-V3 視訊檢測函式流程解讀 demo()

YOLO-V3 視訊檢測函式流程解讀 demo()

對demo函式的理解:

demo.h的宣告:

void demo(char *cfgfile, char *weightfile, float thresh, float hier_thresh, int cam_index, const char *filename, char **names, int classes, int frame_skip, char *prefix, char *out_filename, int http_stream_port, int dont_show, int ext_output);

YOLO-V3的demo命令的函式執行路徑:detector.c中的 else if(0==strcmp(argv[2], "demo")  --> demo.c中的void demo()

detector.c中的demo呼叫:

demo(cfg, weights, thresh, hier_thresh, cam_index, filename, names, classes, frame_skip, prefix, out_filename,
            http_stream_port, dont_show, ext_output);

demo.c中的demos定義: 

void demo(char *cfgfile, char *weightfile, float thresh, float hier_thresh, int cam_index, const char *filename, char **names, int classes,
    int frame_skip, char *prefix, char *out_filename, int http_stream_port, int dont_show, int ext_output)

對於引數prefix,frame——skip,out_filename需要研究下

 

20181018工作節點:追溯show_img圖片的處理函式。

 detector.c中的run_detector函式:

 find_arg():從輸入的命令(argv[])中遍歷,找到*arg的字串後,return 1,否則return 0;

 

demo() 命令中的引數意義

命令帶 “ -http_port 8090" 引數後,會把結果視訊傳到 localhost:8090 地址 ,同時彈出demo視窗。

命令中帶有”-prefix name“會在目錄下儲存處理後的每一幀圖片,命名為:name_ 00000001.jpg