99991 / matting

Python package for alpha matting. This repository has moved:
https://github.com/pymatting/pymatting
Other
47 stars 10 forks source link

Libmatting is not a valid Win32 library #2

Closed fonsleenaars closed 5 years ago

fonsleenaars commented 5 years ago

Hey! This looks like a great library and was trying to get the examples running, I followed your Windows install instructions and ran into the Failed to find libmatting library..

After digging into the code I output the OSError that you catch right before this error is printed and it tells me:

[WinError 193] %1 is not a valid Win32 application

I thought maybe I had to run through VCC/vcvars64.bat as you suggested but that unfortunately gave me the same results. Have you encountered this issue by any chance?

Thanks!

99991 commented 5 years ago

Might be a 32/64-Bit issue. Make sure that both the python distribution and the compiled dll are 64 bit.

To check python:

import sys
print("32-Bit :(" if sys.maxsize < 2**32 else "64-Bit :)")'

I currently don't have a windows computer so I can't test compilation with vcc, but installing and compiling with TDM-GCC should be much more reliable.

This library will be forked within about a week and the fork will use a new loading mechanism, so your problem might be solved in a few days. Fork has been delayed indefinitely.

But if you just need something working right now, this should default to the closed-form alpha matting method and vcycle preconditioner which do not depend on libmatting:

alpha = alpha_matting(image, trimap, print_info=True)
fonsleenaars commented 5 years ago

Thanks so much I'll take a look!

Glad to hear about the fork plan, awesome work!

fonsleenaars commented 5 years ago

Closing this issue, you were absolutely right, Python was running in 32-bit, should have double checked before I posted the issue.

Much appreciated!