explaingit

lengstrom/fast-style-transfer

10,968PythonAudience · researcherComplexity · 4/5LicenseSetup · hard

TLDR

Python tool that applies the visual style of a painting to any photo or video using a pre-trained neural network, producing results in about 100 milliseconds on a GPU.

Mindmap

mindmap
  root((fast-style-transfer))
    What it does
      Photo stylization
      Video stylization
      Painting style copy
    How it works
      Neural network
      Pre-trained models
      100ms per image
    Tech stack
      Python
      TensorFlow
      FFmpeg
      Anaconda
    Audience
      Researchers
      Academic use
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Transfer the brushwork of an impressionist painting onto a cityscape photo for an academic paper or art project.

USE CASE 2

Process a video file frame-by-frame to produce a stylized version that looks painted in a specific artistic style.

USE CASE 3

Train a new style network on a painting you choose, then apply it to any image in under a second.

Tech stack

PythonTensorFlowFFmpegAnaconda

Getting it running

Difficulty · hard Time to first run · 1h+

Requires a GPU, TensorFlow with specific version pinning, Anaconda environment setup, and FFmpeg for video, training takes 4-6 hours.

Academic research use only, commercial use requires separate written permission from the author.

In plain English

This project applies the visual style of a painting to a photograph, producing a new image that combines the content of your photo with the colors and brushwork of the artwork. For example, you can take a cityscape photo and make it look like it was painted in the style of a specific impressionist painting. The same technique works on video, processing each frame and reassembling the result. The approach works by training a neural network on a particular painting style. Once training is complete, applying that style to a new image takes about 100 milliseconds on a capable graphics card. Training takes 4 to 6 hours and requires a GPU. The project includes several pre-trained style models so you can use it without training from scratch. On the technical side, the library is written in Python and depends on TensorFlow, an open source machine learning framework. It also requires specific versions of Python libraries for image processing, and FFmpeg if you want to stylize video. Setup instructions cover both Windows and Linux using a tool called Anaconda to manage the Python environment and its dependencies. Three command-line scripts handle the main tasks: one for training a new style network, one for applying an existing style to images, and one for processing video. Each script accepts a set of parameters you pass from the terminal. The license restricts use to academic research. Commercial use requires separate permission from the author. If you use this in a paper, the README includes a citation block to reference the project.

Copy-paste prompts

Prompt 1
Using fast-style-transfer, help me apply the style of Starry Night to a photo of my city, what command do I run?
Prompt 2
Walk me through the fast-style-transfer training process: what dataset do I need, what GPU memory is required, and how long will it take?
Prompt 3
Help me set up the Anaconda environment for fast-style-transfer on Linux including TensorFlow and FFmpeg for video stylization.
Prompt 4
I want to stylize a 30-second MP4 video with fast-style-transfer, write me the complete shell commands from start to finish.
Open on GitHub → Explain another repo

← lengstrom on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.