Skip to content

KIDJourney/ga_circlepuzzle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ga_circlepuzzle

Use genetic algorithm to fit circles to image.

Inspired by GA_engine.

example

chrome 0.png 8000.png 16000.png 24000.png 32000.png 40000.png 48000.png

Usage

usage: transform.py [-h] [--max_loop MAX_LOOP] [--save_pre_loop SAVE_PRE_LOOP]
                    [--mutate_rate MUTATE_RATE] [--mutate_speed MUTATE_SPEED]
                    [--circle_nums CIRCLE_NUMS]
                    target output

Extend

You can write your class which implement mutate, _mutate, as_image method to use new shape to fit the image.

What's more

The speed of python to processing image is poor, use pypy if you want quicker fit.

LICENSE

MIT

Thanks

Special thanks to GA_engine.

About

use genetic algorithm to fit image with circle

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages