Cubist Mirror

Gene Kogan · 2015

A real-time interactive installation by Gene Kogan: an LCD "mirror" with a side-mounted webcam runs an openFrameworks app that continuously applies neural style transfer (Cubist / Picasso painting styles) to the live video feed, so the viewer sees themselves repainted in real time. Built on a feed-forward convolutional style-transfer network (not a GAN); open-sourced.

How it works

A "mirror" that repaints you live in a Cubist style: an openFrameworks app grabs the webcam, hands each frame to a pre-trained feed-forward style-transfer network that restyles it in a single pass, and shows the result full-screen — several worker threads overlapping so the loop reaches a few frames a second.

Grounded in the CubistMirror source (`ofApp.cpp`) and the repo README, not inferred from the video. The C++ openFrameworks app selects a style with `styleModel = ofToDataPath("cubist.model")` and sets up four style workers (`worker1…worker4`), each given that model via `setStyleModel`. `ofApp::update` pulls the live webcam (`grab.update()`); a worker writes the current frame to disk and shells out to the **chainer-fast-neuralstyle** Python script, which runs the image through a pre-trained feed-forward transform network in a single forward pass and writes the restyled image back; `ofApp::draw` then blits the returned `chainer_img` to fill the screen. The four threads are staggered (wait ≈ generate-time / thread-count) so their ~0.7 s calls overlap into roughly 2 fps. This feed-forward network is the Johnson–Alahi–Li (2016) "Perceptual Losses" method — trained once per style against a VGG perceptual loss on ~80k MS-COCO images — which is ~1000× faster than the iterative Gatys et al. (2015) optimisation and so can run near-live, at slightly reduced quality. The stored `cubist.model` (a Cubist painting) is the fixed style; swapping the model file (e.g. `hokusai.model`) changes what the mirror paints you as. There is no GAN here — the network is a deterministic image-to-image transform.

Details

Tools
openFrameworks
Medium
Installation

Sources

Last updated 2026-07-16