Apply deep-style-transfer model onto video!
- Tensorflow (CPU version)
pip install tensorflow
- OpenCV
- Windows: with Python 3.5 (x64)
pip install opencv-python
- Mac:
- Install through
brew
- Install through
- Linux:
- Build by your own or use other pre-build
- Windows: with Python 3.5 (x64)
- Import
Video
andsave_video
from the correct module of packagestyler
- Find and set the input video
path
inLine#44
- Write a list comprehension to iterate through all frames, and make it be processed by Tensorflow.
- Pass the results as a argument into function
- Modify the class method
read_frames()
instyler/video.py
- Read video frames from
self.cap
and collect frames into list - Apply
resize()
on each frame before add it to list - Also assign frames to "self" object
- Return your results
- Read video frames from
If you can not save the output, you may try to change the codec used by changing the codec index in styler/utils.py
Line#36.
We use the trained model and code in deep-style-transfer.