项目作者: ahmedkhalf

项目描述 :
Evolutionary Art Using Circles in Python
高级语言: Python
项目地址: git://github.com/ahmedkhalf/Circle-Evolution.git
创建时间: 2020-05-14T09:55:33Z
项目社区:https://github.com/ahmedkhalf/Circle-Evolution

开源协议:GNU General Public License v3.0

下载









Contributions - Welcome


GitHub stars


GitHub forks


License


Evolutionary Art Using Circles

Getting Started

Installation

You can download the latest release using pip.

  1. pip install circle-evolution

Usage

Command Line

You can easily start training an image by calling circle_evolution from your terminal

Example:

  1. circle_evolution "Mona Lisa 64.jpg" --size 1 --genes 256 --max-generations 50000
Parameter Description
—size Image size {1: (64, 64), 2: (128, 128), 3: (256, 256)}. Default: 2
—genes Number of circle to fit. Default: 256
—max-generations Number of generations to run. Default: 500,000

Python Example Script

  1. from circle_evolution import evolution
  2. from circle_evolution import helpers
  3. import numpy as np
  4. import cv2
  5. target = helpers.load_target_image("Mona Lisa 64.jpg", size=(64, 64))
  6. e = evolution.Evolution(target, genes=256)
  7. e.evolve(max_generation=50000)
  8. helpers.show_image(e.specie.phenotype)
  9. np.savetxt("Checkpoint.txt", e.specie.genotype)
  10. cv2.imwrite("OuputImage.jpg", e.specie.phenotype)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Contributors

Ahmed Khalf
ahmedkhalf

Guilherme de Amorim
guimorg