mirror of https://github.com/AlexeyAB/darknet.git
added free_alphabet function; this function used for free alphabet. (#1805)
This commit is contained in:
parent
30b044abd6
commit
ac4e765a4a
|
@ -374,10 +374,9 @@ void test_coco(char *cfgfile, char *weightfile, char *filename, float thresh)
|
||||||
show_image(im, "predictions");
|
show_image(im, "predictions");
|
||||||
free_image(im);
|
free_image(im);
|
||||||
free_image(sized);
|
free_image(sized);
|
||||||
|
free_alphabet(alphabet);
|
||||||
wait_until_press_key_cv();
|
wait_until_press_key_cv();
|
||||||
destroy_all_windows_cv();
|
destroy_all_windows_cv();
|
||||||
|
|
||||||
if (filename) break;
|
if (filename) break;
|
||||||
}
|
}
|
||||||
free(boxes);
|
free(boxes);
|
||||||
|
|
|
@ -413,14 +413,7 @@ void demo(char *cfgfile, char *weightfile, float thresh, float hier_thresh, int
|
||||||
|
|
||||||
free_ptrs((void **)names, net.layers[net.n - 1].classes);
|
free_ptrs((void **)names, net.layers[net.n - 1].classes);
|
||||||
|
|
||||||
const int nsize = 8;
|
free_alphabet(alphabet);
|
||||||
for (j = 0; j < nsize; ++j) {
|
|
||||||
for (i = 32; i < 127; ++i) {
|
|
||||||
free_image(alphabet[j][i]);
|
|
||||||
}
|
|
||||||
free(alphabet[j]);
|
|
||||||
}
|
|
||||||
free(alphabet);
|
|
||||||
free_network(net);
|
free_network(net);
|
||||||
//cudaProfilerStop();
|
//cudaProfilerStop();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1778,17 +1778,7 @@ void test_detector(char *datacfg, char *cfgfile, char *weightfile, char *filenam
|
||||||
free_ptrs((void**)names, net.layers[net.n - 1].classes);
|
free_ptrs((void**)names, net.layers[net.n - 1].classes);
|
||||||
free_list_contents_kvp(options);
|
free_list_contents_kvp(options);
|
||||||
free_list(options);
|
free_list(options);
|
||||||
|
free_alphabet(alphabet);
|
||||||
int i;
|
|
||||||
const int nsize = 8;
|
|
||||||
for (j = 0; j < nsize; ++j) {
|
|
||||||
for (i = 32; i < 127; ++i) {
|
|
||||||
free_image(alphabet[j][i]);
|
|
||||||
}
|
|
||||||
free(alphabet[j]);
|
|
||||||
}
|
|
||||||
free(alphabet);
|
|
||||||
|
|
||||||
free_network(net);
|
free_network(net);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
13
src/image.c
13
src/image.c
|
@ -280,6 +280,19 @@ image **load_alphabet()
|
||||||
return alphabets;
|
return alphabets;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void free_alphabet(image **alphabet)
|
||||||
|
{
|
||||||
|
int i, j;
|
||||||
|
const int nsize = 8;
|
||||||
|
for (j = 0; j < nsize; ++j) {
|
||||||
|
for (i = 32; i < 127; ++i) {
|
||||||
|
free_image(alphabet[j][i]);
|
||||||
|
}
|
||||||
|
free(alphabet[j]);
|
||||||
|
}
|
||||||
|
free(alphabet);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Creates array of detections with prob > thresh and fills best_class for them
|
// Creates array of detections with prob > thresh and fills best_class for them
|
||||||
|
|
|
@ -88,6 +88,7 @@ image load_image(char *filename, int w, int h, int c);
|
||||||
image load_image_stb_resize(char *filename, int w, int h, int c);
|
image load_image_stb_resize(char *filename, int w, int h, int c);
|
||||||
//LIB_API image load_image_color(char *filename, int w, int h);
|
//LIB_API image load_image_color(char *filename, int w, int h);
|
||||||
image **load_alphabet();
|
image **load_alphabet();
|
||||||
|
void free_alphabet(image **alphabet);
|
||||||
|
|
||||||
//float get_pixel(image m, int x, int y, int c);
|
//float get_pixel(image m, int x, int y, int c);
|
||||||
//float get_pixel_extend(image m, int x, int y, int c);
|
//float get_pixel_extend(image m, int x, int y, int c);
|
||||||
|
|
|
@ -328,11 +328,11 @@ void test_yolo(char *cfgfile, char *weightfile, char *filename, float thresh)
|
||||||
|
|
||||||
free_image(im);
|
free_image(im);
|
||||||
free_image(sized);
|
free_image(sized);
|
||||||
|
free_alphabet(alphabet);
|
||||||
wait_until_press_key_cv();
|
wait_until_press_key_cv();
|
||||||
destroy_all_windows_cv();
|
destroy_all_windows_cv();
|
||||||
|
|
||||||
if (filename) break;
|
if (filename) break;
|
||||||
}
|
}
|
||||||
free(boxes);
|
free(boxes);
|
||||||
for(j = 0; j < l.side*l.side*l.n; ++j) {
|
for(j = 0; j < l.side*l.side*l.n; ++j) {
|
||||||
|
|
Loading…
Reference in New Issue