Coder Social home page Coder Social logo

stylize's Introduction

stylize

Regressor based image stylization.

Inspired by the various projects implementing polygonal stylization of images via blends of genetic algorithms and hill climbing and Andrej Karpathy's rephrasing of the problem in a machine learning framework.

Whereas genetic algorithm and hill climbing approaches can take hours, stylize runs in seconds with much greater flexibility and higher fidelity when desired.

Usage (example.py has more detail):

from stylize import render
from scipy.misc import imread

image = imread('resources/iggy_small.jpg')
defaults = render(image)
Our Test Subject, my cat Iggy Default stylization render(image)
Iggy Iggy
Abstract render(image,depth=4) Smooth render(image,iterations=25)
Iggy Iggy
More Detail render(image,ratio=0.00005) Less Detail render(image,ratio=0.001)
Iggy Iggy
Visualizing how it works Why
Iggy stylize is currently based off of regression trees and an ensembled version of that model, the random forest regressor. Regression trees work by recursively partitoning ("splitting") their input feature space and assigning associations to those partitions (such as colors). At each frame the model splits every partition in half again until hitting its minimum partition size, click the gif to see a larger version!

stylize's People

Contributors

newmu avatar

Watchers

 avatar  avatar

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.