Giter Club home page Giter Club logo

Comments (5)

zvezdochiot avatar zvezdochiot commented on June 16, 2024 1

IplImage * output_ipl_img = inpaint(inp, ori_ipl_img, (int**)mask, 2);

I did not find the release of memory allocated for the image after it was written to the media.

PS: Fresh yes.

from patchmatch_inpainting.

zvezdochiot avatar zvezdochiot commented on June 16, 2024

I modified it slightly so as not to mess with an array of useless files:

int main(int argc, char** argv)
{
	char image_path[100];
	char mask_path[100];
	char masked_path[100];
	char output_path[100];

	double psnr_mean[3] = {0,};
	double ssim_mean[3] = {0,};
	double time_mean[3] = {0,};

	double psnr_total = 0.0;
	double ssim_total = 0.0;
	double time_total = 0.0;

	for(int i = 0; i < 6000; ++i)
	{
		for(int j = 0; j < 3; ++j)
		{
			sprintf(image_path, "../image_files/inpainting/image/image_%05d.png", j);
			sprintf(mask_path, "../image_files/inpainting/mask/mask_%05d.png", j);
			sprintf(masked_path, "../image_files/inpainting/masked_image/masked_image_%05d.png", j);
			sprintf(output_path, "../image_files/inpainting/output/output_%05d.png", j);

			process(image_path, mask_path, output_path, &psnr_total, &ssim_total, &time_total);
			psnr_mean[j] = psnr_total/6000.0;
			ssim_mean[j] = ssim_total/6000.0;
			time_mean[j] = time_total/6000.0;
		}
	}

	for(int i = 0; i < 3; ++i)
	{
		printf("[%02d%% - %02d%%] average psnr: %lf\taverage ssim: %lf\taverage time: %lf\n", i*10, (i+1)*10, psnr_mean[i], ssim_mean[i], time_mean[i]);
	}

	return 0;
}

Really, eats memory. Will seek.

from patchmatch_inpainting.

zvezdochiot avatar zvezdochiot commented on June 16, 2024

Maybe add?:

    cvReleaseImage(& output_ipl_img);

from patchmatch_inpainting.

ZQPei avatar ZQPei commented on June 16, 2024

Cool!
Do the memory leaking problem solved now?
I don't test, cause I dont have opencv install on my laptop now.

from patchmatch_inpainting.

zvezdochiot avatar zvezdochiot commented on June 16, 2024

@ZQPei . He eats a lot. But it does not grow as before. I will wait for the tests. If all is well, do a new release (0.2). (This is important to me, I am also a maintainer).

from patchmatch_inpainting.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.