gitmyhub

latwalk

Python ★ 7 updated 2mo ago

A Python tool that orders a folder of images into a visually smooth sequence and renders it as an MP4, optionally synced to a music track's beat.

PythonPyTorchCLIPDINOffmpegFILMsetup: moderatecomplexity 4/5

Latent Walker is a Python command line tool that turns a folder of images into a video. It looks at each image, extracts visual features using methods like CLIP, DINO, color histograms, or a weighted combination of these, then arranges the images in an order where similar looking pictures sit next to each other. The result is rendered as an MP4 video, so instead of a random slideshow you get a smooth path through the image set that feels visually connected from frame to frame.

If you add a music file, the tool can also time image changes and visual effects to the song. It can follow the main beat, react to bursts of fast percussive hits, or respond to the overall pulse of the track. Effects available include crossfades between images, brightness pulses, color shifts, brief negative flashes, glitch bands, and added noise. These are meant to be used as accents rather than constant effects, and the README notes that some of them can feel overwhelming if overused.

The project also includes a downloader for the National Gallery of Art's public domain image collection, useful for testing the tool without needing your own images, and an optional post processing step using FILM frame interpolation to make transitions smoother by generating extra in between frames.

To get started, you need Python 3.10 or newer and ffmpeg installed on your system. A CUDA capable GPU or Apple Silicon is recommended for speed but not required, since the tool can fall back to simpler, faster feature extraction methods like color histograms if the heavier neural network options are not available. Setup involves creating a virtual environment and installing the listed Python dependencies, then running the main script with an input folder and a chosen method and ordering strategy.

The project keeps a cache of extracted image features so that repeated experiments with effects or timing do not require recomputing them from scratch, which speeds up iteration when tuning a video's look and feel.

Where it fits