Code Monkey home page Code Monkey logo

guided-filter-pytorch's People

Contributors

perrying 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

Watchers

 avatar

guided-filter-pytorch's Issues

error when using 'guidedfilter2d_color'

Thanks for the author to share this code. But I meet some error here, when I run this demo:

        target = torch.randn((2, 1, 10, 10))
        net = GuidedFilter2d(radius=4, eps=1e-4)
        res = net(target, im)
        print(res.shape)

I got the error information as below:

Traceback (most recent call last):
  File "/projects/guided-filter-pytorch-master/guided-filter-pytorch-master/guided_filter.py", line 204, in <module>
    demo()
  File "/projects/guided-filter-pytorch-master/guided-filter-pytorch-master/guided_filter.py", line 187, in demo
    res = net(target, im)
  File "D:\anaconda3.5.0.0\envs\torch1\lib\site-packages\torch\nn\modules\module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/projects/guided-filter-pytorch-master/guided-filter-pytorch-master/guided_filter.py", line 17, in forward
    return guidedfilter2d_color(guide, x, self.r, self.eps)
  File "/projects/guided-filter-pytorch-master/guided-filter-pytorch-master/guided_filter.py", line 117, in guidedfilter2d_color
    mean_a = torch.stack([boxfilter2d(a[:, i], radius) for i in range(3)], 1) / N
RuntimeError: The size of tensor a (3) must match the size of tensor b (2) at non-singleton dimension 1

But there is no problem when I change the image to gray and run this code. So I'm now running the gray version of this code. All in all, thank you very much for the sharing the code

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.