Giter Site home page Giter Site logo

pktiuk / evolutionary-painter Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 2.59 MB

Simple genetic Python C++ app recreating image by drawing multiple rectangles

License: GNU General Public License v3.0

Python 0.33% CMake 1.73% Shell 0.01% C++ 2.93% Jupyter Notebook 95.00%

evolutionary-painter's Introduction

Rectangles Fitting image

Application recreating image by drawing multiple rectangles. To achieve it we are using genetic algorithm.

It provides simple Python library with binds to C++ SFML.

Original

Output

Video Example

evolutionary painter evolutionary painter

Preparing

Install dependencies

Packages

Required to build main executable.

sudo apt-get install cmake libboost-python-dev libsfml-dev  python3 python3-pip jupyter-notebook

Python packages

(python part is optional, but it is recommended for analyzing algorithm)

pip3 install numpy matplotlib notebook

Download and build

git clone https://gitlab.com/pktiuk/evolutionary-painter.git
cd evolutionary-painter
mkdir build
cd build
cmake ..
cmake --build .

Using app

There are two ways of running this app:

  • C++-based - it is used to generate output image using simple C++ executable.
Usage:    evolving-rectangles [OPTIONS]
          -i  input file (if not described program will show selection window)
          -p  population size (default 30)
          -g  gene pool, maximum number of rectangles on picture (default 1000)
          -c  end simulation after given amount of generations (empty or 0, no restriction)
          -t  run in terminal mode only (without drawing window)
          -h  print help
  • Python-based - it is recommended for more research and test-focused usage. It uses C++ to python bindings.
    It can be launched imported from file BindWrapper.py (you can just run this file and after importing everything you will be left in the interactive mode). You can also use Jupyter Notebook for easy tests. Example notebook - it can be launched via jupyter notebook ./notebook.ipynb

evolutionary-painter's People

Contributors

pktiuk avatar tiskus333 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.