# Neural Style Transfer Transition Video Processing
By Brycen Westgarth and Tristan Jogminas
## Description
This code extends the [neural style transfer](https://www.tensorflow.org/tutorials/generative/style_transfer)
image processing technique to video
by generating smooth transitions between a sequence of
reference style images across video frames. The generated output
video is a highly altered, artistic representation of the input
video consisting of constantly changing abstract patterns and colors
that emulate the original content of the video. The user's choice
of style reference images, style sequence order, and style sequence
length allow for infinite user experimentation and the creation of
an endless range of artistically interesting videos.
## System Requirements
This algorithm is computationally intensive so I highly
recommend optimizing its performance by installing drivers for
[Tensorflow GPU support](https://www.tensorflow.org/install/gpu)
if you have access to a CUDA compatible GPU. Alternatively, you can
take advantage of the free GPU resources available through Google Colab Notebooks.
Even with GPU acceleration, the program may take several minutes to render a video.
[Colab Notebook Version](https://colab.research.google.com/drive/1ZjSvUv0Wqib6khaiqcBvRrI5GeSjFcOV?usp=sharing)
## Configuration
All configuration of the video properties and input/output file
locations can be set by the user in config.py
Configurable Variable in config.py | Description
------------------------|------------
ROOT_PATH | Path to input/output directory
FRAME_HEIGHT | Sets height dimension in pixels to resize the output video to. Video width will be calculated automatically to preserve aspect ratio. Low values will speed up processing time but reduce output video quality
INPUT_FPS | Defines the rate at which frames are captured from the input video
INPUT_VIDEO_NAME | Filename of input video
STYLE_SEQUENCE | List that contains the indices corresponding to the image files in the 'style_ref' folder. Defines the reference style image transition sequence. Can be arbitrary length, the rate at which the video transitions between styles will be adjusted to fit the video
OUTPUT_FPS | Defines the frame rate of the output video
OUTPUT_VIDEO_NAME | Filename of output video to be created
GHOST_FRAME_TRANSPARENCY | Proportional feedback constant for frame generation. Should be a value between 0 and 1. Affects the amount change that can occur between frames and the smoothness of the transitions.
CLEAR_INPUT_FRAME_CACHE | If True the program clears the captured input frames each run. If False, you can run multiple style sequences without having to recapture video frames
PRESERVE_COLORS | If True the output video will preserve the colors of the input video. If False the program will perform standard style transfer
**The user must find and place their own style reference images in the `style_ref` directory.
Style reference images can be
arbitrary size. For best results, try to use style reference images with similar dimensions
and aspect ratios. Three example style reference images are given.**<br/>
<br/>
Minor video time effects can be created by setting INPUT_FPS and OUTPUT_FPS to different relative values<br/>
- INPUT_FPS > OUTPUT_FPS creates a slowed time effect
- INPUT_FPS = OUTPUT_FPS creates no time effect
- INPUT_FPS < OUTPUT_FPS creates a timelapse effect
## Usage
```
$ python3 -m venv env
$ source env/bin/activate
$ pip3 install -r requirements.txt
$ python3 style_frames.py
```
## Examples
### Input Video
![file](/examples/reference.gif)
### Example 1
##### Reference Style Image Transition Sequence
![file](/examples/example1_style_sequence.png)
##### Output Video
![file](/examples/example1.gif)
##### Output Video with Preserved Colors
![file](/examples/example3.gif)
### Example 2
##### Reference Style Image Transition Sequence
![file](/examples/example2_style_sequence.png)
##### Output Video
![file](/examples/example2.gif)
##### [Example Video made using this program](https://youtu.be/vgl83UTciD8)
没有合适的资源?快使用搜索试试~ 我知道了~
此代码通过在多个参考风格图像之间生成平滑过渡,将神经风格传输图像处理技术扩展到视频_Python_下载.zip
共20个文件
gitignore:5个
png:5个
gif:4个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 125 浏览量
2023-04-26
11:15:03
上传
评论
收藏 44.9MB ZIP 举报
温馨提示
此代码通过在多个参考风格图像之间生成平滑过渡,将神经风格传输图像处理技术扩展到视频_Python_下载.zip
资源推荐
资源详情
资源评论
收起资源包目录
此代码通过在多个参考风格图像之间生成平滑过渡,将神经风格传输图像处理技术扩展到视频_Python_下载.zip (20个子文件)
style-transfer-video-processor-main
style_ref
02.png 340KB
00.png 312KB
01.png 169KB
.gitignore 30B
style_frames.py 10KB
output_frames
.gitignore 13B
LICENSE 18KB
examples
example1.gif 11.85MB
example2.gif 9.77MB
reference.gif 4.85MB
example2_style_sequence.png 222KB
example3.gif 10.18MB
example1_style_sequence.png 281KB
input_vid.mov 6.99MB
tensorflow_cache
.gitignore 14B
requirements.txt 966B
.gitignore 61B
README.md 4KB
input_frames
.gitignore 13B
config.py 1KB
共 20 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功