Skip to content

gracecovarrubias/stringart

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

String Art With AI

String Art With AI is a modified version of grvlbit's string-art generator with the goal of using reinforcement learning to train a model for creating string art.

Mona Lisa stringart

This project has been inspired by the magnificant works of Petros Vrellis.

Algorithm

The idea is to crop a picture to a given shape (e.g. circle) and then place a number of nails evenly spaced around that. Then based on a random nail the algorithm starts calculating the best route (that is the route with the highest darkness) to the next nail. This procedure is continued until a maximum number of iterations is reached or the simulated picture matches the input.

Demo Video

Youtube

Usage

To run the project, we recommend using the devcontainer.

To open the project in the devcontainer in vscode, use ctrl + shift + p to access the available commands and select reopen in devcontainer.

Notes

This is a relatively naive implementation. The problem scales with the number of nails, iterations as well as the resolution of the input.

  • Use cropped images roughly 300x300px
  • Works best with pictures with high contrast
  • Works best on portraits

About

A stringart generator written in Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 95.5%
  • Python 4.5%