Giter Club home page Giter Club logo

imcmc's Introduction

imcmc

It probably makes art.

imcmc (im-sea-em-sea) is a small library for turning 2d images into probability distributions and then sampling from them to create images and gifs. Right now it is best at logos and shape based images.

Installation

This is actually pip installable from git!

pip install git+https://github.com/ColCarroll/imcmc

Quickstart

See imcmc.ipynb for a few working examples as well.

import imcmc


image = imcmc.load_image('python.png', 'L')

# This call is random -- rerun adjusting parameters until the image looks good
trace = imcmc.sample_grayscale(image, samples=1000, tune=500, nchains=6)

# Lots of plotting options!
imcmc.plot_multitrace(trace, image, marker='o', markersize=10,
                      colors=['#0000FF', '#FFFF00'], alpha=0.9);

# Save as a gif, with the same arguments as above, plus some more
imcmc.make_gif(trace, image, dpi=40, marker='o', markersize=10,
               colors=['#0000FF', '#FFFF00'], alpha=0.9, 
               filename='example.gif')

Built with

Pillow does not have a logo, but the other tools do!

PyMC3

matplotlib

scipy

Python

Here's a tricky one whose support I appreciate

I get to do lots of open source work for The Center for Civic Media at MIT. Even better, they have a super multi-modal logo that I needed to use 98 chains to sample from!

Center for Civic Media

Further work

There are some functions in there to sample from the RGB channels of real images, but the reconstructed images just look blurry, and the gifs just look like they are awkward fades. Still working on it!

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.