Lego-generator icon indicating copy to clipboard operation
Lego-generator copied to clipboard

Make image2image faster by broadcasting

Open Luvata opened this issue 4 years ago • 0 comments

Thanks for your nice repo, the idea and your code base is really friendly and easy to understand. This pull request slightly improve the speed of your lego-nization algorithm by replacing for loop with broadcasting. Run benchmark on my Air M1 show that the speed is nearly ~3X faster on input.jpg The output image is nearly identical (because of rounding number, it's < 1% different)

Screen Shot 2021-05-11 at 17 23 47

Luvata avatar May 11 '21 10:05 Luvata