yolov3批量测试代码,网上查找了一篇,稍有些问题,这里贴出修改后代码。原理就是在原有的程序上加了批量的内容。
参考博客:https://blog.csdn.net/xczexcel/article/details/80585776
void batch_process(char *datacfg, char *cfgfile, char *weightfile, char *read_file, float thresh, float hier_thresh, char *save_file)
{
list *options = read_data_cfg(datacfg);
char *name_list = option_find_str(options, "names", "data/names.list");
char **names = get_labels(name_list);
image **alphabet = load_alphabet();
network net = parse_network_cfg_custom(cfgfile, 1);
if (weightfile) {
load_weights(&net, weightfile);
}
set_batch_network(&net, 1);
srand(2222222);
double time;
float nms = .45;
int max_len = 256;
char buf[256];
FILE *writer;
FILE *fp;
int len;
if ((writer = fopen(save_file, "w")) == NULL) {
printf("%s