Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] Alternatives to hog for faster runtime #19

Closed
Seon82 opened this issue Apr 7, 2021 · 4 comments
Closed

[Suggestion] Alternatives to hog for faster runtime #19

Seon82 opened this issue Apr 7, 2021 · 4 comments

Comments

@Seon82
Copy link

Seon82 commented Apr 7, 2021

The new version of the program runs significantly slower than the previous version (with the speedup provided by #18). A bit of profiling reveals the hog method as the main culprit.
I've implemented a few alternative algorithms I thought might show similar results, and benchmarked the time necessary to do a fit_transform using these different methods. I feel like the 2x2 sobel could be a pretty solid alternative to hog, what do you think?

(All benchmarks run with dither="naive", palette=6 and boost=True)

There's a small mistake in the labels, 3x3 sobel is in fact 2x2 and vice-versa

Factor 6

pyxelate_robocop_med

Factor 10

pyxelate_br_small
Factor 6

pyxelate_br_med
Factor 3

pyxelate_br_large

Factor 10

pyxelate_corgi_small
Factor 6

pyxelate_corgi_med

Factor 10

pyxelate_palms_small

Factor 6

pyxelate_palms_med

@Seon82 Seon82 changed the title [Suggestion] Alternatives to hog for faster runtimes [Suggestion] Alternatives to hog for faster runtime Apr 7, 2021
@sedthh
Copy link
Owner

sedthh commented Apr 8, 2021

That's a really good idea. I am happy with the top row so it definitely worths a try!
Could you make examples with 3x3 sobel as well, and images where the edge detector is called multiple times (similarly to depth > 1)?

Thank you in advance!

@Seon82
Copy link
Author

Seon82 commented Apr 8, 2021

Just noticed a mistake in the labels for the images above, 2x2 sobel is in fact 3x3 and vice-versa. But there are already some 3x3 sobel examples above.
Will look into the different depths asap!

@Seon82
Copy link
Author

Seon82 commented Apr 8, 2021

Depth 2

br_depth2

Depth 3

br_depth3
palms_depth3

@sedthh
Copy link
Owner

sedthh commented Apr 8, 2021

I love it! Could you maybe add both 2x2 and 3x3 as choices to be set s hyperparameters with Pyx() with 3x3 as default? The 3x3 looks better but 2x2 is just so much faster, it will worth the tradeoff for rendering animations later!
Pyx(sobel=3)

This is great!

@Seon82 Seon82 closed this as completed Apr 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants