Libmatting is not a valid Win32 library
Closed this issue · 3 comments
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!
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)
Thanks so much I'll take a look!
Glad to hear about the fork plan, awesome work!
Closing this issue, you were absolutely right, Python was running in 32-bit, should have double checked before I posted the issue.
Much appreciated!