Giter Site home page Giter Site logo

nixers-projects / urnn Goto Github PK

View Code? Open in Web Editor NEW
135.0 9.0 6.0 2.14 MB

A neural network to smartly create coherent terminal colorschemes based on an image.

C++ 2.57% Perl 22.56% Go 7.87% C 57.86% Shell 7.19% Makefile 1.02% Roff 0.93%
neural-network libfann xresources extract-colors ricing wallpaper

urnn's Introduction

urnn (unix ricing neural network)

A neural network to smartly create coherent terminal colorschemes based on an image.

Examples (Colors generated from wallpapers):

1 2
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

How do I use this?

This project depends on libfann and libpng. After you have those and clone:

./urnn colors <some file.png>
       \____/  \___________/
          |          |
          |          \- The wallpaper you want to have your terminal
          |             colors fit with.
          |
          \- The colors command will print to STDOUT, in an Xresources
             format the colors that resulted after passing through the
             neural network. If the colors are bad you can retrain the
             network (see the help for more commands)

Repo layout

Folder Contents
colors Programs for extracting colors from png images in different ways.
scripts Scripts for misc tasks(using the color extractors, parsing .Xresources files, ...)
network Folder containing the meat of this project, programs and scripts to train and use the neural network, as well as extract data and put it in the correct form to use.
inputs Git submodule that points to the urnnputs, containing images and resources file to extract data from to use to train the neural network.
dataset The extracted data from the inputs folder in a form suitable used to train urnn(explained below)

Dataset contents(color representation)

Colors are converted to a value that is between 0 and 1, for speed/use with fann.

for example, say we have a pixel with the rgb value of (255, 120, 70). to display this information in a format that the neural network can understand, we have to convert it to 3 floats. each consist of the color/255 (max value).

255/255 = 1.00000000
120/255 = 0.47058823
70/255  = 0.27450980

so there you have it. our pixel is represented by 1.00000000 0.47058823 0.27450980

TODO

  • Turn the input of the network between [-1, 1] so that the training is faster
  • Get more data for the training
  • Test multiple color extracters and parameters for the training
  • Easy wrappers for all the mini-tools written

How To Contribute

Have inputs(pairs of xresources and walls) that you want to add? If you just want to submit them for addition to the inputs, see https://github.com/nixers-projects/urnnputs#contributing

If you want to test one or more here to see what kind of effect you can have on the network:

$ urnn add /some/image.png /test/.Xresouces
$ urnn add /some/other/image.png /second/.Xresouces
$ urnn refresh
$ urnn retrain

You will then have a trained set including your inputs, and could test out the urnn colors command and see that kind of effect you had. If any of the outputs are desirable, consider submitting a pull request with them ;)

Related links

urnn's People

Contributors

lwilletts avatar neeasade avatar stark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

urnn's Issues

Please submit more example images

Hi there! I was wondering if you could submit more examples of colorscheme generation by your script, maybe using a "color" display script?

repo size

currently a fresh clone of this repo is ~10MB, and ~97% of that is from the .git folder. I'm thinking about doing another more aggressive run with BFG repo cleaner, but that would mean anyone with this repo cloned would need to re-clone. leaving this issue open for any comments, else will do that in a few days.

Error reading "cascade_min_out_epochs"

When I run ./urnn colors some_file.png, I get the following error:
FANN Error 4: Error reading "cascade_min_out_epochs" from configuration file "network/urnn.trained". Segmentation fault (core dumped) Use of uninitialized value $red in negation (-) at scripts/convert_val_to_xresources_colors_2.pl line 54, <stdin> line 1. Use of uninitialized value $green in negation (-) at scripts/convert_val_to_xresources_colors_2.pl line 55, <stdin> line 1. Use of uninitialized value $blue in negation (-) at scripts/convert_val_to_xresources_colors_2.pl line 56, <stdin> line 1. *background: #7f7f7f
libpng and libfann are both installed.

sin_colors extraction

Currently when colors are extracted, if ten aren't found, we fill in the gap up to ten with #000000. This results in a skewed association with dark colors

Contributing link is broken

I wanted to help with some data but the link to the contributing guideline takes you to a 404. Could you please post the guide elsewhere?

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.