Giter Site home page Giter Site logo

thinkingmachines / christmais Goto Github PK

View Code? Open in Web Editor NEW
90.0 90.0 24.0 7.4 MB

Text to abstract art generation for the holidays!

Home Page: https://stories.thinkingmachin.es/ai-art-holiday-cards/

License: GNU General Public License v2.0

Python 80.39% Makefile 6.17% Dockerfile 1.86% Shell 11.58%
abstract-art fasttext-embeddings machine-learning perception xmas

christmais's People

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

Watchers

 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

christmais's Issues

Write shell script

Write shell script for:

  • Parsing (christmais.scripts.parse)
  • Style Transfer (christmais.scripts.style_transfer)

Use them for usage instructions as required in #55

Add Dockerfile

We might be using GCP to speed up processing (not yet sure). Easier to set everything up via Dockerfile

Implement Trainer

Hi @ibtingzon , I'll just write the workflow here so you can have a basis too (for easier syncs):

How to get the objective function

  1. Initialize n number of Artists, store them in a list called artists (lol)
  2. All of them should generate an image (of type PIL.Image) using draw(). We can use a list comprehension here
  3. One PIL.Image has a shape of (224, 224, 3). If you initialized n number of Artists, we should stack them into a tensor of shape (n, 224, 224, 3). (Optional since predict() can use PIL.Image directly)
  4. Initialize a Predictor class and call predict() on this tensor. Not sure if the current implementation does batch compute, if not, fix Predictor. If successful, it should return a list of shape (n,).
  5. The elements of the list are the "fitness" of each Artist. Optimize using the techniques that we have.

Optimization Step

  1. In the list artists, we can get the gene by calling get_gene(). This should give you a matrix for each artist (as far as I remember its shape (10, 26). Reshape them if necessary (np.ravel(), etc. etc.).
  2. Once we get the "new genes", call draw_from_gene() for each Artist again in the list artists.
  3. Repeat step 2 of "How to get the objective function"

Sample

# Generate 10 artists
artists = [Artist(seed, (224,224)) for i in range(10)]
# Draw an image for each artist
imgs = [artist.draw() for artist in artists]
# Compute fitness
target = 'iron'
fitness = [p.predict(img, target=target)[0] for img in imgs]

Fix make dev

Add apt-get installation for make dev and make build.

Remove JS dependency in drawer

We're just sourcing these dependencies from a CDN, so there's really no need to implement that. You can remove those and just have a single drawer, similar to parser and styler instead.

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.