perrying / guided-filter-pytorch Goto Github PK
View Code? Open in Web Editor NEWPyTorch implementation of Guided Image Filtering
License: MIT License
PyTorch implementation of Guided Image Filtering
License: MIT License
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
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.