Skip to content

Commit

Permalink
计算recall修改
Browse files Browse the repository at this point in the history
  • Loading branch information
LU-K-Brant committed Apr 4, 2019
1 parent aa02ea9 commit 82947a8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions detector.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,14 +494,16 @@ void validate_detector(char *datacfg, char *cfgfile, char *weightfile, char *out
fprintf(stderr, "Total Detection Time: %f Seconds\n", what_time_is_it_now() - start);
}

void validate_detector_recall(char *cfgfile, char *weightfile)
void validate_detector_recall(char *datacfg, char *cfgfile, char *weightfile)
{
network *net = load_network(cfgfile, weightfile, 0);
set_batch_network(net, 1);
fprintf(stderr, "Learning Rate: %g, Momentum: %g, Decay: %g\n", net->learning_rate, net->momentum, net->decay);
srand(time(0));

list *plist = get_paths("data/coco_val_5k.list");
list *options = read_data_cfg(datacfg);
char *valid_images = option_find_str(options, "valid", "data/train.list");
list *plist = get_paths(valid_images);
char **paths = (char **)list_to_array(plist);

layer l = net->layers[net->n-1];
Expand Down Expand Up @@ -939,7 +941,7 @@ void run_detector(int argc, char **argv)
else if(0==strcmp(argv[2], "train")) train_detector(datacfg, cfg, weights, gpus, ngpus, clear);
else if(0==strcmp(argv[2], "valid")) validate_detector(datacfg, cfg, weights, outfile);
else if(0==strcmp(argv[2], "valid2")) validate_detector_flip(datacfg, cfg, weights, outfile);
else if(0==strcmp(argv[2], "recall")) validate_detector_recall(cfg, weights);
else if(0==strcmp(argv[2], "recall")) validate_detector_recall(datacfg, cfg, weights);
else if(0==strcmp(argv[2], "demo")) {
list *options = read_data_cfg(datacfg);
int classes = option_find_int(options, "classes", 20);
Expand Down

0 comments on commit 82947a8

Please sign in to comment.