https://github.com/ahmedkhalf/circle-evolution
Evolutionary Art Using Circles in Python
https://github.com/ahmedkhalf/circle-evolution
art circles evolutionary-algorithms evolutionary-art genetic-algorithm
Last synced: about 2 months ago
JSON representation
Evolutionary Art Using Circles in Python
- Host: GitHub
- URL: https://github.com/ahmedkhalf/circle-evolution
- Owner: ahmedkhalf
- License: gpl-3.0
- Created: 2020-05-14T09:55:33.000Z (about 5 years ago)
- Default Branch: develop
- Last Pushed: 2023-09-30T20:25:38.000Z (over 1 year ago)
- Last Synced: 2025-03-29T02:08:28.765Z (about 2 months ago)
- Topics: art, circles, evolutionary-algorithms, evolutionary-art, genetic-algorithm
- Language: Python
- Homepage: https://ahmedkhalf.github.io/Circle-Evolution/index.html
- Size: 493 KB
- Stars: 357
- Watchers: 10
- Forks: 46
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
![]()
Evolutionary Art Using Circles# Getting Started
## InstallationYou can download the latest release using pip.
```bash
pip install circle-evolution
```## Usage
### Command LineYou can easily start training an image by calling circle_evolution from your terminal
**Example:**
```bash
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
```python
from circle_evolution import evolution
from circle_evolution import helpers
import numpy as np
import cv2target = helpers.load_target_image("Mona Lisa 64.jpg", size=(64, 64))
e = evolution.Evolution(target, genes=256)e.evolve(max_generation=50000)
helpers.show_image(e.specie.phenotype)
np.savetxt("Checkpoint.txt", e.specie.genotype)
cv2.imwrite("OuputImage.jpg", e.specie.phenotype)
```
# ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
## Contributors
Ahmed Khalf
[ahmedkhalf](http://github.com/ahmedkhalf)Guilherme de Amorim
[guimorg](http://github.com/guimorg)