Don't free resized image if it's a reference

Fixes: a95bc3f5b6
Signed-off-by: Juuso Alasuutari <juuso.alasuutari@gmail.com>
This commit is contained in:
Juuso Alasuutari 2020-06-12 00:17:31 +03:00
parent 1f6a6cd71c
commit 5691b812b4
1 changed files with 5 additions and 1 deletions

View File

@ -862,9 +862,13 @@ void predict_classifier(char *datacfg, char *cfgfile, char *weightfile, char *fi
if(net.hierarchy) printf("%d, %s: %f, parent: %s \n",index, names[index], predictions[index], (net.hierarchy->parent[index] >= 0) ? names[net.hierarchy->parent[index]] : "Root"); if(net.hierarchy) printf("%d, %s: %f, parent: %s \n",index, names[index], predictions[index], (net.hierarchy->parent[index] >= 0) ? names[net.hierarchy->parent[index]] : "Root");
else printf("%s: %f\n",names[index], predictions[index]); else printf("%s: %f\n",names[index], predictions[index]);
} }
free_image(cropped); free_image(cropped);
if (resized.data != im.data) {
free_image(resized);
}
free_image(im); free_image(im);
free_image(resized);
if (filename) break; if (filename) break;
} }
free(indexes); free(indexes);