mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
Don't resize when image is already scaled to network size
This commit is contained in:
parent
9a4b19c415
commit
e3904aebfd
@ -578,10 +578,12 @@ void free_detections(detection *dets, int n)
|
||||
|
||||
float *network_predict_image(network *net, image im)
|
||||
{
|
||||
image imr = letterbox_image(im, net->w, net->h);
|
||||
bool resize = im.w != net->w || im.h != net->h;
|
||||
image imr = resize ? letterbox_image(im, net->w, net->h) : im;
|
||||
set_batch_network(net, 1);
|
||||
float *p = network_predict(net, imr.data);
|
||||
free_image(imr);
|
||||
if(resize)
|
||||
free_image(imr);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user