Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thiago4532/genalgo


https://github.com/thiago4532/genalgo

Last synced: 25 days ago
JSON representation

Awesome Lists containing this project

README

        

# GenAlgo

GenAlgo is a genetic algorithm-based image approximation project. This project utilizes semi-transparent triangles to approximate a target image and leverages GPU acceleration with CUDA for efficient computation of the fitness function.


Monalisa

## Dependencies

- SFML 2.6
- CUDA 12.5

Installing Dependencies

### Ubuntu

```
sudo apt update
sudo apt install libsfml-dev build-essential g++ nvidia-cuda-toolkit
```

### Arch Linux

```
sudo pacman -Syu
sudo pacman -S cmake g++ gcc cuda sfml
```

## Tested Hardware

- NVIDIA RTX 3060 Mobile
- NVIDIA GTX 1650 Mobile
- NVIDIA RTX 3060

## Compiler

- GCC 14.1.1

## Usage

To run GenAlgo, use the following command:

```
genalgo -i [options]
```

### Options

- `-i, --input `: Input image file.
- `-o, --output `: Output SVG file.
- `-gi, --gen-input `: Input file to continue from.
- `-go, --gen-output `: Output file to save the generation.
- `-s, --seed `: Seed for the random number generator (default = platform-specific random).
- `--period `: Number of generations between renders/logging (default = 50).
- `--no-render`: Disable rendering.
- `--no-breed`: Disable breeding.

### Renderer Keybindings

- `S`: Toggle showing the original image.
- `R`: Reset to the best individual and update the display.
- `N`: Show the next individual in the population.
- `P`: Show the previous individual in the population.
- `Up Arrow`: Increase render scale.
- `Down Arrow`: Decrease render scale.

## Building

To build GenAlgo, make sure you have all the dependencies installed and run the following commands:

```
mkdir build
cd build
cmake ..
make
```

## Running

After building, you can run GenAlgo with the desired input image and options:

```
./genalgo -i input_image.png --period 100 --output result.svg
```

## License

This project is licensed under the MIT License.