Artistic Style Transfer for Videos is a Python application that applies the style transfer technique to both images and videos. This technique reimagines your photos or videos in the style of another image, such as a famous artwork, using neural network algorithms.
Unofficial implementation in PyTorch of an "Artistic style transfer for videos" [arXiv].
- Model-agnostic. Fast EfficientNet-B0 is used as a feature extractor. RAFT is used as an optical flow estimator.
- High-order statistics of feature grid are used to estimate the style, thus eliminating dependency from content/style image shape.
- Not a real-time application.
- Remove hardcoded paths.
- Add long-term temporal consistency.
- Implement multi-pass algorithm.
- Copy audio from the original video.
- Python 3.7+
- pip
- Git LFS (optional)
- Clone the repository with Git LFS support.
- Verify that example files are downloaded with:
git lfs pull
- Install dependencies with:
python -m pip install -U -r requirements.txt
Apply style transfer to video files, transforming each frame to carry the artistic style of your choice.
First, prepare your video for style transfer:
python main_video_prepare.py
Next, apply the style transfer to the video:
python main_video.py
Finally, join the processed frames back into a video:
python main_video_join.py
Arguments and filepaths need to be hardcoded in main_video_prepare.py
, main_video.py
, and main_video_join.py
.
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE-2.0 or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
This project is inspired by the pioneering work in neural style transfer. Special thanks to the authors of the original research papers and the open-source community for making their code available.