Git Product home page Git Product logo

bayesian-matting's People

Contributors

brandon-hastings avatar marcoforte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bayesian-matting's Issues

dead loop in bayesian_matting.py

For some image the code will result in dead loop,cause len(f_weights) < minN or len(b_weights) < minN in code bayesian_matting.py.

numpy.linalg.linalg.LinAlgError: Array must not contain infs or NaNs

I converted the code for python 2.7 by replacing @ with np.matmul and removing nopython=True from the jit decorators. I am getting the following error when I try to run the demo:

bayesian_matting.py:182: RuntimeWarning: invalid value encountered in divide
f, b, alphaT = solve(mu_f, sigma_f, mu_b, sigma_b, p, 0.01, alpha_init, 50, 1e-6)
/mnt/c/Users/Yannis/Desktop/429_project/source/bayesian-matting-master/orchard_bouman_clust.py:18: RuntimeWarning: invalid value encountered in divide
self.mu = np.einsum('ij,i->j', self.X, w)/W
/mnt/c/Users/Yannis/Desktop/429_project/source/bayesian-matting-master/orchard_bouman_clust.py:21: RuntimeWarning: invalid value encountered in divide
self.cov = (np.matmul(t.T,t))/W + 1e-5*np.eye(3)
Traceback (most recent call last):
File "bayesian_matting.py", line 204, in
main()
File "bayesian_matting.py", line 195, in main
alpha = bayesian_matte(img, trimap)
File "bayesian_matting.py", line 177, in bayesian_matte
mu_f, sigma_f = clustFunc(f_pixels, f_weights)
File "/mnt/c/Users/Yannis/Desktop/429_project/source/bayesian-matting-master/orchard_bouman_clust.py", line 36, in clustFunc
nodes = split(nodes)
File "/mnt/c/Users/Yannis/Desktop/429_project/source/bayesian-matting-master/orchard_bouman_clust.py", line 50, in split
C_b = Node(C_i.X[np.logical_not(idx)], C_i.w[np.logical_not(idx)])
File "/mnt/c/Users/Yannis/Desktop/429_project/source/bayesian-matting-master/orchard_bouman_clust.py", line 23, in init
V, D = np.linalg.eig(self.cov)
File "/mnt/c/Users/Yannis/Desktop/429_project/source/venv/local/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 1128, in eig
_assertFinite(a)
File "/mnt/c/Users/Yannis/Desktop/429_project/source/venv/local/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 217, in _assertFinite
raise LinAlgError("Array must not contain infs or NaNs")
numpy.linalg.linalg.LinAlgError: Array must not contain infs or NaNs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.