How lengstrom/fast-style-transfer works
This repository trains fast artistic style-transfer networks and applies saved checkpoints to images or video. The main workflow is to train a transformation network from a style image and content-image collection, then use the checkpoint to stylize image files or video frames. VGG19 supplies perceptual features during training; image utilities handle loading and saving. The video entry point delegates frame processing to evaluation code. Relationships reflect the excerpts and README; unsampled details are not inferred.
Main entry points: evaluate.py Image and frame evaluation · optimize.py Loss optimization · style.py Training command · utils.py Image utilities
Components 12
Network training
- Training command
style.py - Loss optimization
src/optimize.py - Model checkpoint
Stylization
- Image and frame evaluation
evaluate.py - Video command
transform_video.py
Model internals
- Image utilities
src/utils.py - VGG19 features
src/vgg.py - Transform network
src/transform.py
Other components
- User
- Content images
- Style image
- Stylized output
Connections 17
- User → Training command: trains via
README.md - Training command → Loss optimization: calls
style.py - Training command → Image utilities: loads inputs
style.py - Loss optimization → Image utilities: loads content
src/optimize.py - Loss optimization → VGG19 features: extracts features
src/optimize.py - Loss optimization → Transform network: builds network
src/optimize.py - Loss optimization → Model checkpoint: saves
src/optimize.py - Content images → Training command: provides content
README.md - Style image → Training command: provides style
README.md - User → Image and frame evaluation: runs inference
README.md - Image and frame evaluation → Transform network: builds predictions
evaluate.py - Image and frame evaluation → Image utilities: loads and saves
evaluate.py - Model checkpoint → Image and frame evaluation: restores
evaluate.py - Image and frame evaluation → Stylized output: writes
evaluate.py - User → Video command: runs video styling
README.md - Video command → Image and frame evaluation: delegates frames
transform_video.py - Image and frame evaluation → Stylized output: writes video frames
evaluate.py