99991 / matting Goto Github PK
View Code? Open in Web Editor NEWPython package for alpha matting. This repository has moved:
Home Page: https://github.com/pymatting/pymatting
License: Other
Python package for alpha matting. This repository has moved:
Home Page: https://github.com/pymatting/pymatting
License: Other
Hi, Thanks for your work! It's very nice!
I used your approach to estimate foreground and background.
But I find the time it costs is big. So I want to put it to GPU by Cupy or pytorch.
And then I want to know estimate_fb_ml()
function is base on which paper and "linear equation system" is what, and do you have some idea ?
Thank you very much !
Hello!
I'm running the code on a macOS, and always getting this error in alpha_matting.py (line 200): return L @ x + d * x
SyntaxError: invalid syntax
Do you have an idea on how I can fix this issue?
Thanks.
When running 'python setup.py install', I get the following output:
running install
building libmatting library
ichol.c: In function 'ichol':
ichol.c:48:5: warning: C++ style comments are not allowed in ISO C90
ichol.c:48:5: warning: (this will be reported only once per input file)
ichol.c:62:5: error: 'for' loop initial declarations are only allowed in C99 mode
ichol.c:62:5: note: use option -std=c99 or -std=gnu99 to compile your code
ichol.c:73:5: error: 'for' loop initial declarations are only allowed in C99 mode
ichol.c:76:9: error: 'for' loop initial declarations are only allowed in C99 mode
ichol.c:90:9: warning: ISO C90 forbids mixed declarations and code
ichol.c:98:13: error: 'for' loop initial declarations are only allowed in C99 mode
ichol.c:105:21: warning: ISO C90 forbids mixed declarations and code
ichol.c:123:17: warning: ISO C90 forbids mixed declarations and code
ichol.c:141:18: error: redefinition of 'idx'
ichol.c:76:18: note: previous definition of 'idx' was here
ichol.c:141:9: error: 'for' loop initial declarations are only allowed in C99 mode
ichol.c:152:13: warning: ISO C90 forbids mixed declarations and code
ichol.c:173:18: error: redefinition of 'idx'
ichol.c:141:18: note: previous definition of 'idx' was here
ichol.c:173:9: error: 'for' loop initial declarations are only allowed in C99 mode
ichol.c: In function 'backsub_L_csc_inplace':
ichol.c:229:5: error: 'for' loop initial declarations are only allowed in C99 mode
ichol.c:236:18: error: redefinition of 'k'
ichol.c:230:13: note: previous definition of 'k' was here
ichol.c:236:9: error: 'for' loop initial declarations are only allowed in C99 mode
ichol.c: In function 'backsub_LT_csc_inplace':
ichol.c:252:5: error: 'for' loop initial declarations are only allowed in C99 mode
ichol.c:255:9: error: 'for' loop initial declarations are only allowed in C99 mode
ichol.c:261:13: error: redefinition of 'k'
ichol.c:255:18: note: previous definition of 'k' was here
ichol.c:261:9: warning: ISO C90 forbids mixed declarations and code
ichol.c: In function 'backsub_L_csr_inplace':
ichol.c:275:5: error: 'for' loop initial declarations are only allowed in C99 mode
ichol.c:279:9: error: 'for' loop initial declarations are only allowed in C99 mode
ichol.c:285:13: error: redefinition of 'k'
ichol.c:279:18: note: previous definition of 'k' was here
ichol.c:285:9: warning: ISO C90 forbids mixed declarations and code
In file included from knn.c:2:0:
kdtree.h:12:1: warning: C++ style comments are not allowed in ISO C90
kdtree.h:12:1: warning: (this will be reported only once per input file)
knn.c:6:1: warning: C++ style comments are not allowed in ISO C90
knn.c:6:1: warning: (this will be reported only once per input file)
knn.c: In function 'knn':
knn.c:22:5: warning: ISO C90 forbids mixed declarations and code
knn.c:24:5: error: 'for' loop initial declarations are only allowed in C99 mode
knn.c:24:5: note: use option -std=c99 or -std=gnu99 to compile your code
knn.c:28:5: warning: ISO C90 forbids mixed declarations and code
knn.c:37:14: error: redefinition of 'i'
knn.c:24:14: note: previous definition of 'i' was here
knn.c:37:5: error: 'for' loop initial declarations are only allowed in C99 mode
knn.c:43:9: error: 'for' loop initial declarations are only allowed in C99 mode
In file included from kdtree.c:1:0:
kdtree.h:12:1: warning: C++ style comments are not allowed in ISO C90
kdtree.h:12:1: warning: (this will be reported only once per input file)
kdtree.c: In function 'kdtree_point_distance':
kdtree.c:19:5: error: 'for' loop initial declarations are only allowed in C99 mode
kdtree.c:19:5: note: use option -std=c99 or -std=gnu99 to compile your code
kdtree.c: In function 'kdtree_partition':
kdtree.c:40:9: warning: C++ style comments are not allowed in ISO C90
kdtree.c:40:9: warning: (this will be reported only once per input file)
kdtree.c:45:13: error: 'for' loop initial declarations are only allowed in C99 mode
kdtree.c:51:13: warning: ISO C90 forbids mixed declarations and code
kdtree.c: In function 'kdtree_init':
kdtree.c:70:5: warning: ISO C90 forbids mixed declarations and code
kdtree.c:78:5: error: 'for' loop initial declarations are only allowed in C99 mode
kdtree.c:85:5: error: 'for' loop initial declarations are only allowed in C99 mode
kdtree.c:88:9: error: 'for' loop initial declarations are only allowed in C99 mode
kdtree.c:108:9: error: 'for' loop initial declarations are only allowed in C99 mode
kdtree.c:117:9: warning: ISO C90 forbids mixed declarations and code
kdtree.c:127:9: warning: ISO C90 forbids mixed declarations and code
kdtree.c: In function 'kdtree_cell_distance':
kdtree.c:163:5: error: 'for' loop initial declarations are only allowed in C99 mode
kdtree.c: In function 'kdtree_find_knn':
kdtree.c:178:5: warning: ISO C90 forbids mixed declarations and code
kdtree.c:193:9: error: 'for' loop initial declarations are only allowed in C99 mode
kdtree.c:203:13: error: 'for' loop initial declarations are only allowed in C99 mode
boxfilter.c:5:1: warning: C++ style comments are not allowed in ISO C90
boxfilter.c:5:1: warning: (this will be reported only once per input file)
boxfilter.c: In function 'boxfilter':
boxfilter.c:40:5: warning: ISO C90 forbids mixed declarations and code
boxfilter.c:44:5: error: 'for' loop initial declarations are only allowed in C99 mode
boxfilter.c:44:5: note: use option -std=c99 or -std=gnu99 to compile your code
boxfilter.c:46:9: error: 'for' loop initial declarations are only allowed in C99 mode
boxfilter.c:53:5: warning: ISO C90 forbids mixed declarations and code
boxfilter.c:57:14: error: redefinition of 'i'
boxfilter.c:43:9: note: previous definition of 'i' was here
boxfilter.c:57:5: error: 'for' loop initial declarations are only allowed in C99 mode
boxfilter.c:61:9: error: 'for' loop initial declarations are only allowed in C99 mode
boxfilter.c:76:21: error: 'for' loop initial declarations are only allowed in C99 mode
boxfilter.c:89:18: error: redefinition of 'j'
boxfilter.c:61:18: note: previous definition of 'j' was here
boxfilter.c:89:9: error: 'for' loop initial declarations are only allowed in C99 mode
boxfilter.c:113:18: error: redefinition of 'j'
boxfilter.c:89:18: note: previous definition of 'j' was here
boxfilter.c:113:9: error: 'for' loop initial declarations are only allowed in C99 mode
labelexpand.c: In function 'label_expand':
labelexpand.c:17:5: error: 'for' loop initial declarations are only allowed in C99 mode
labelexpand.c:17:5: note: use option -std=c99 or -std=gnu99 to compile your code
labelexpand.c:25:9: error: 'for' loop initial declarations are only allowed in C99 mode
labelexpand.c:26:13: error: 'for' loop initial declarations are only allowed in C99 mode
ERROR: Failed to compile libmatting. Only vcycle method will be available.
running build
running build_py
creating build
creating build\lib
creating build\lib\matting
copying matting\alpha_matting.py -> build\lib\matting
copying matting\boxfilter.py -> build\lib\matting
copying matting\closed_form_laplacian.py -> build\lib\matting
copying matting\foreground_background.py -> build\lib\matting
copying matting\guided_filter.py -> build\lib\matting
copying matting\ichol.py -> build\lib\matting
copying matting\ifm_matting.py -> build\lib\matting
copying matting\knn.py -> build\lib\matting
copying matting\knn_laplacian.py -> build\lib\matting
copying matting\lkm.py -> build\lib\matting
copying matting\load_libmatting.py -> build\lib\matting
copying matting\util.py -> build\lib\matting
copying matting\vcycle.py -> build\lib\matting
copying matting\__about__.py -> build\lib\matting
copying matting\__init__.py -> build\lib\matting
copying matting\__main__.py -> build\lib\matting
running install_lib
running install_egg_info
running egg_info
creating matting.egg-info
writing matting.egg-info\PKG-INFO
writing dependency_links to matting.egg-info\dependency_links.txt
writing requirements to matting.egg-info\requires.txt
writing top-level names to matting.egg-info\top_level.txt
writing manifest file 'matting.egg-info\SOURCES.txt'
reading manifest file 'matting.egg-info\SOURCES.txt'
writing manifest file 'matting.egg-info\SOURCES.txt'
removing 'C:\Users\usr\AppData\Local\Continuum\anaconda3\Lib\site-packages\matting-0.0.1-py3.7.egg-info' (and everything under it)
Copying matting.egg-info to C:\Users\usr\AppData\Local\Continuum\anaconda3\Lib\site-packages\matting-0.0.1-py3.7.egg-info
running install_scripts
cleanup
I saw elsewhere you mentioned that vcycle should still work without the libmatting library, but when I run 'from matting import vcycle' I get the following error:
from matting import vcycle
Traceback (most recent call last):
File "<ipython-input-2-c1031d670d07>", line 1, in <module>
from matting import vcycle
File "C:\Users\usr\Desktop\matting\matting\__init__.py", line 2, in <module>
from .alpha_matting import alpha_matting, METHODS, PRECONDITIONERS
File "C:\Users\usr\Desktop\matting\matting\alpha_matting.py", line 3, in <module>
from .knn_laplacian import knn_laplacian
File "C:\Users\usr\Desktop\matting\matting\knn_laplacian.py", line 383, in <module>
from .knn import knn
File "C:\Users\usr\Desktop\matting\matting\knn.py", line 5, in <module>
library = load_libmatting()
File "C:\Users\usr\Desktop\matting\matting\load_libmatting.py", line 24, in load_libmatting
raise Exception("Failed to find libmatting library. Checked paths:\n%s", "\n".join(paths))
Any advice?
Thanks!
how to run on windows platform?
Thank you!
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!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.