Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thiago4532/genalgo
https://github.com/thiago4532/genalgo
Last synced: 25 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/thiago4532/genalgo
- Owner: Thiago4532
- License: mit
- Created: 2022-08-19T15:27:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-11T12:16:44.000Z (29 days ago)
- Last Synced: 2024-12-11T12:23:00.044Z (29 days ago)
- Language: C++
- Size: 506 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.
## Dependencies
- SFML 2.6
- CUDA 12.5Installing 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.