Coder Social home page Coder Social logo

plat's Introduction

plat (v): plan out or make a map of

Utilities for exploring generative latent spaces as described in the Sampling Generative Networks paper.

Quickstart

Install this library, code supporting a model type, and go.

$ pip install plat
$ pip install git+https://github.com/dribnet/discgen.git \
  -r https://raw.githubusercontent.com/dribnet/discgen/master/requirements.txt
$ plat sample --model celeba_64.discgen
Model celeba_64.discgen will be downloaded. Continue? [Y/n] y
Saving image file plat_20161006_celeba_64_discgen_01.png

output image

Sampling Examples

By default, plat does a random sampling. The output file will be automatically generated, or can be given explicitly. To make the results repeatable, you can also specify a random seed.

$ plat sample \
  --model celeba_64.discgen \
  --seed 1 \
  --outfile examples/random_sample.jpg

output image

The number of rows and columns can be specified. Interpolation is done by specifying the spacing between samples.

$ plat sample \
  --model celeba_64.discgen \
  --seed 1 \
  --rows 1 --cols 7 \
  --spacing 6 \
  --outfile examples/random_interpolation.jpg

output image

Interpolation can be done across multiple points in two dimensions to create a mine grid (details in paper).

$ plat sample \
  --model celeba_64.discgen \
  --seed 1 \
  --rows 3 --cols 7 \
  --spacing 3 \
  --outfile examples/random_mine_grid.jpg

output image

There are many more options to explore. When experimenting, it can be useful to use a templated output filename.

$ plat sample \
  --model celeba_64.discgen \
  --seed 17 \
  --tight \
  --rows 3 --cols 7 \
  --spacing 2 \
  --outfile examples/%DATE%_experiment_s%SEED%_%SEQ%.jpg

output image

Model types

plat comes with access to a growing list of models and model types in its model zoo. Each model type will have separate dependencies.

It's also possible to run plat on new types of models by providing a simple plat interface. There are a few examples and a template to get started. Here's an example of how to use plat sample with a manually specified model interface to generate a (random) mine grid from an iGAN model:

PYTHONPATH=. plat sample \
  --model-interface plat.interface.igan.IganModel \
  --model-file models/shoes_64.dcgan_theano \
  --uniform \
  --rows 4 --cols 10 \
  --tight --spacing 3 \
  --image-size 64 \
  --seed 1

output image

plat's People

Contributors

dribnet avatar

Watchers

Noon van der Silk avatar James Cloos 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.