Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to handle target images of bigger size (in MB) #1

Open
Hiteshsaai opened this issue May 18, 2020 · 2 comments
Open

Unable to handle target images of bigger size (in MB) #1

Hiteshsaai opened this issue May 18, 2020 · 2 comments

Comments

@Hiteshsaai
Copy link

Hiteshsaai commented May 18, 2020

I am trying to scrape a part of one image and mask it in another image to check its capability of blending, , but it failed to mask the image due to memory allocation error, is there any way to pull this off for bigger size images ?? below i am attaching the error from CLI.

Please move the object to desired location to apparate.

Blending ...
Traceback (most recent call last):
File "main.py", line 82, in
poisson_blend_result = poisson_edit(source, target, target_mask, offset)
File "C:\Users\i29140\Documents\poisson-image-editing\poisson_image_editing.py", line 56, in poisson_edit
mat_A = laplacian_matrix(y_range, x_range)
File "C:\Users\i29140\Documents\poisson-image-editing\poisson_image_editing.py", line 25, in laplacian_matrix
mat_A = scipy.sparse.block_diag([mat_D] * n).tolil()
File "C:\Program Files (x86)\Python37-32\lib\site-packages\scipy\sparse\construct.py", line 677, in block_diag
return bmat(rows, format=format, dtype=dtype)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\scipy\sparse\construct.py", line 608, in bmat
data = np.empty(nnz, dtype=dtype)
MemoryError: Unable to allocate 363. MiB for an array with shape (47610792,) and data type float64

@Hiteshsaai Hiteshsaai changed the title Unable to target images of bigger size (in MB) Unable to handle target images of bigger size (in MB) May 18, 2020
@Hiteshsaai
Copy link
Author

@PPPW can you help me with the issue

@Siddharth1698
Copy link

Try to resize all images to 600 height. It works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants