abiusx / clpatchmatch Goto Github PK
View Code? Open in Web Editor NEWOpenCL (realtime) implementation of patch match image processing algorithm (Python and C)
OpenCL (realtime) implementation of patch match image processing algorithm (Python and C)
Please let me know the license information for using this code.
Hello!
I think this straightforward port to parallel implementation is not correct.
Because (x, y) patch must be computed from (x+dir, y+dir) patches that already processed.
But in your code I cannot find any synchronizations.
Thanks,
Andrey.
I can run multiple times and sometimes get error:
pyopencl.RuntimeError: clEnqueueReadBuffer failed: out of resources
after one or more iterations using the bike_a.png and bike_b.png files and main in demo mode straight from github. Sometimes it runs to completion and sometimes it stops part way through with above error.
Output on fail case:
Please wait a few seconds...
('file 0 = ', 'bike_a.png', ' file 1 = ', 'bike_b.png')
('img shape = ', (175, 239, 3))
('iteration', 1)
('mean block difference:', 11.847692226259401)
('iteration', 2)
('mean block difference:', 1.4053478590557273)
('iteration', 3)
('mean block difference:', 1.0751794090974331)
('iteration', 4)
('mean block difference:', 0.92336860183560998)
('iteration', 5)
('mean block difference:', 0.84552383540750564)
Traceback (most recent call last):
File "main.py", line 195, in <module>
patchmatch.match(files,Demo=True)
File "main.py", line 186, in match
self.execute();
File "main.py", line 116, in execute
cl.enqueue_read_buffer(self.queue, self.outputBuf, c).wait()
File "/usr/lib/python2.7/dist-packages/pyopencl/__init__.py", line 860, in new_func
return func(*args, **kwargs)
pyopencl.RuntimeError: clEnqueueReadBuffer failed: out of resources
When it runs successfully I get the following output:
Please wait a few seconds...
('file 0 = ', 'bike_a.png', ' file 1 = ', 'bike_b.png')
('img shape = ', (175, 239, 3))
('iteration', 1)
('mean block difference:', 11.847692226259401)
('iteration', 2)
('mean block difference:', 1.4053478590557273)
('iteration', 3)
('mean block difference:', 1.0751713650301336)
('iteration', 4)
('mean block difference:', 0.92228370782616687)
('iteration', 5)
('mean block difference:', 0.84449662336199371)
('iteration', 6)
('mean block difference:', 0.78995643332834575)
('iteration', 7)
('mean block difference:', 0.75182238942455692)
('iteration', 8)
('mean block difference:', 0.72269540056274861)
('iteration', 9)
('mean block difference:', 0.70064447195375668)
('iteration', 10)
('mean block difference:', 0.68212381211217721)
('iteration', 11)
('mean block difference:', 0.6671923072248922)
('iteration', 12)
('mean block difference:', 0.65498817675593513)
('iteration', 13)
('mean block difference:', 0.64466970594863771)
('iteration', 14)
('mean block difference:', 0.63470502613937019)
('iteration', 15)
('mean block difference:', 0.62660883279387825)
('iteration', 16)
('mean block difference:', 0.61789773527170389)
('iteration', 17)
('mean block difference:', 0.61108444301768117)
('iteration', 18)
('mean block difference:', 0.60394420541486304)
('iteration', 19)
('mean block difference:', 0.59827319833725168)
('iteration', 20)
('mean block difference:', 0.59298303466078317)
('randomfill', ':', 0.003, 'seconds')
('execute', ':', 0.137, 'seconds')
('init', ':', 0.519, 'seconds')
Done.
Hey hey,
when i run it the only thing i see is
Segmentation fault (core dumped)
any hints?
Hi,
I am considering using this code and was wondering what license it is under?
Thank You,
YL
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.