Skip to content

samuel-rl/Python-genetic-algorithm_Rectangle-art-portrait

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8a5f785 Β· Nov 10, 2020

History

6 Commits
Nov 7, 2020
Nov 10, 2020
Nov 10, 2020
Nov 10, 2020
Nov 10, 2020

Repository files navigation

Welcome to this Genetic algorithm πŸ‘‹

We will try to recreate an image with rectangles.

The resulting images will be created in the folder bestIndividus.

Example

generation 0 :

demo

generation 100 :

demo

generation 600 :

demo

Installation

# 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

Documentation

Use args to change defaults settings

  • --N_RECTS = int

    default = 50

  • --CANVAS_SIZE = int

    default = 100

  • --POP_SIZE = int

    default = 100

  • --PROB_RECT_RESET = float

    default = 0.01

  • --INPUT_FILE = string

    default = "original.jpg"

Example

python3 imageGenetic.py --N_RECTS 20 --INPUT_FILE myFile.jpg
python3 imageGenetic.py --CANVAS_SIZE 150 --INPUT_FILE myFile.jpg --POP_SIZE 150

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages