Git Product home page Git Product logo

depth2time's Introduction

Do silhouettes dream?

Code for reproducing our interactive art installation "Do silhouettes dream?".

It was exhibited at the ArtScience Museum in Singapore as part of the Microbites of Innovation Showcase in conjuction with the ACM Creativity & Cognition 2017 conference.

Requirements

MacOS Sierra tested recipe:

Running the demo

In general, to run the demo you need to first connect the kinect to your laptop and then run the main script:

python silhouettes.py

While having the python window selected, you can exit the demo at any time by pressing the ESC key.

Before running the demo for the first time, you will need to specify the input and output parameters and perhaps adjust the min-max depth values for each specific location.

Download sample input tensor

A sample tensor of a deep dream starting from a black image can be downloaded directly from here. The file should be placed in the tensors/ folder for the main script to work without changes.

Better, one may use the download script provided:

cd tensors && sh download_sample_tensor.sh

Adjusting input and output parameters

Open silhouettes.py with your favorite editor and adjust the following (self-explanatory) parameters:

# input/output parameters

# input tensor
input_fn = 'tensors/black.pkl'

# output window size
FINAL_OUTPUT_WIDTH = 1440
FINAL_OUTPUT_HEIGHT = 900

Adjusting min/max depth and debuging kinect input

You may wat to adjust the min-max depth values for each specific location you run the demo. These parameters would be very different if eg you want to run this in a big warehouse vs your cluttered bedroom. In general the depth values for kinect v2 are between 500 and 4500.

To debug depth, first turn set parameter:

show_depth = True

This will only display the depth map (the input from the kinect). Then, while having the python window selected/in focus, you can change the min/max depth values using some keyboard shortcuts:

  • keys "a" and "z" control the minimun depth cliping
  • keys "s" and "x" control the maximum depth cliping There are debug messages shown on the terminal, to let you pick the proper values that work for your space. After you decide, you set the following two variables to the selected depths. Eg parameters:
MIN_DEPTH = 500.0
MAX_DEPTH = 2000.0 

will clip faraway objects and work better for smaller spaces.

Don't forget to turn the debug depth parameter off to start running the demo:

show_depth = False

Creating your own input tensors

Deep Dreaming

We provide a modified version of the tensorflow deepdream script that outputs gifs and the proper numpy input tensor needed by the main script. See folder:

deepdream/

Video input

Day-to-night timelapse videos are ideal for this. We provide an iPython Notebook script that gets a video and creates the proper tensor needed from the main script:

video2input.ipynb

it requires the youtube_dl package that you can install with:

sudo pip install --upgrade youtube_dl

depth2time's People

Contributors

skamalas avatar pumpikano avatar

Stargazers

 avatar Yunpeng avatar

Watchers

 avatar Shannon Chan avatar  avatar

Forkers

av-processing-1

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.