We will try to recreate an image with rectangles.
The resulting images will be created in the folder bestIndividus
.
generation 0 :
generation 100 :
generation 600 :
# Clone the project :
git clone https://github.com/samuel3105/Python-genetic-algorithm_Rectangle-art-portrait.git
cd ./Python-genetic-algorithm_Rectangle-art-portrait
python3 imageGenetic.py
Use args to change defaults settings
-
--N_RECTS
= intdefault = 50
-
--CANVAS_SIZE
= intdefault = 100
-
--POP_SIZE
= intdefault = 100
-
--PROB_RECT_RESET
= floatdefault = 0.01
-
--INPUT_FILE
= stringdefault = "original.jpg"
python3 imageGenetic.py --N_RECTS 20 --INPUT_FILE myFile.jpg
python3 imageGenetic.py --CANVAS_SIZE 150 --INPUT_FILE myFile.jpg --POP_SIZE 150