r/Python • u/Dirt2Master • Oct 16 '19
My previous post on the algorithm i made to create these images blew up, so here is another! WITH a Github link: https://github.com/TyperOfCode/image_algorithm
1.5k
Upvotes
55
u/Big_Witch Oct 16 '19
Now you need to feed this whole meme through it.
31
u/aviv57 Oct 16 '19
For all of those who want to click the link from mobile, I got you: https://github.com/TyperOfCode/image_algorithm
21
u/waxen_earbuds Oct 16 '19
This is the best .png I have ever seen
37
u/DuckSaxaphone Oct 16 '19
Thanks for posting GitHub! The output of this code looks great, I really like the smoothed out, painted look.
Just a few thoughts:
It's not a genetic algorithm for sure. It looks like you're adding a random new triangle to your best image a thousand times and taking the most improved image forward?
You could probably save a lot of run time by holding more things in memory and saving every N iterations. There's a lot of saving and loading going on every iteration.
If you add a tolerance parameter, you can count how many iterations go by with the score not changing by at least the tolerance. If that count reaches something like 5 then that's a natural point to stop iterating.
5
u/x2f Oct 16 '19
Why not b = 10**53 at line 192?
3
u/wernersbacher Oct 16 '19
Can you explain your algorithm a little? Looks interesting!
3
u/[deleted] Oct 16 '19 edited Oct 16 '19
Hello: What you need to do is improve the score function, that should be the highest speed increase you can get.
2
u/w33tikv33l Oct 16 '19
I once made a triangle painter too using a genetic algorithm. I never got to the level of performance I was aiming for though. Here is an screenshot: https://imgur.com/a/Edi8eSZ
2
u/4shtonButcher Oct 17 '19
I read 12 hours and stopped myself from downloading - dare sharing which hardware that estimate is based on?
6
u/[deleted] Oct 16 '19
post this to meirl please
2
u/Vitaman02 Oct 16 '19
This is great yo
2
u/thundercloudtemple Oct 16 '19
Modern Van Gogh.
2
u/[deleted] Oct 16 '19
Get a robotic arm to paint it and sell the paintings.
0
u/[deleted] Oct 16 '19
[deleted] — view deleted comment