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

Test failing #24

Open
NicolaGugole opened this issue Aug 16, 2023 · 2 comments
Open

Test failing #24

NicolaGugole opened this issue Aug 16, 2023 · 2 comments

Comments

@NicolaGugole
Copy link

Hi Marco!
Really interesting repo, would like to try it using trimaps.

Unfortunately, when following your instructions I get an unclear error on your basic test:

INFO:root:Computing Matting Laplacian.
Traceback (most recent call last):
File "/home/wizard/mambaforge/envs/matting/bin/closed-form-matting", line 8, in
sys.exit(main())
File "/home/wizard/mambaforge/envs/matting/lib/python3.5/site-packages/closed_form_matting/closed_form_matting.py", line 192, in main
alpha = closed_form_matting_with_trimap(image, trimap)
File "/home/wizard/mambaforge/envs/matting/lib/python3.5/site-packages/closed_form_matting/closed_form_matting.py", line 150, in closed_form_matting_with_trimap
return closed_form_matting_with_prior(image, trimap, trimap_confidence * consts_map, consts_map)
File "/home/wizard/mambaforge/envs/matting/lib/python3.5/site-packages/closed_form_matting/closed_form_matting.py", line 133, in closed_form_matting_with_prior
laplacian = compute_laplacian(image, ~consts_map if consts_map is not None else None)
File "/home/wizard/mambaforge/envs/matting/lib/python3.5/site-packages/closed_form_matting/closed_form_matting.py", line 108, in compute_laplacian
L = scipy.sparse.csr_matrix((nz_indsVal, nz_indsCol, np.arange(0, nz_indsVal.shape[0] + 1, win_size)), shape=(hw, hw))
File "/home/wizard/mambaforge/envs/matting/lib/python3.5/site-packages/scipy/sparse/compressed.py", line 108, in init
self.check_format(full_check=False)
File "/home/wizard/mambaforge/envs/matting/lib/python3.5/site-packages/scipy/sparse/compressed.py", line 172, in check_format
"".format(len(self.indptr), major_dim + 1))
ValueError: index pointer size (385039) should be (44416)

To reproduce:

git clone https://github.com/MarcoForte/closed-form-matting.git

cd closed-form-matting/

pip install .

closed-form-matting ./testdata/source.png -t ./testdata/trimap.png  -o output_alpha.png
@vadimkantorov
Copy link

Same error :(

@vadimkantorov
Copy link

I think the last commit added returning laplacian as CSR, but didn't test it: d5d8b05

By commenting out L = scipy.sparse.csr_matrix..., the code starts working again

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