PyTorch reimplemetation for the paper:
DVC: An End-to-end Deep Video Compression Framework, Guo Lu, Wanli Ouyang, Dong Xu, Xiaoyun Zhang, Chunlei Cai, Zhiyong Gao, CVPR 2019 (Oral). [arXiv]
- Python==3.6
- PyTorch==1.2
-
Download Vimeo-90k dataset: original training + test set (82GB)
-
Unzip the dataset into
./data/
. -
Remember to put the file
test.txt
in./data/vimeo_septuplet/
to the root of your vimeo dataset if you edit the path of vimeo.
This method only provide P-frame compression, so we first need to generate I frames by H.265. We take UVG dataset as an example.
- Download UVG dataset(1080p/8bit/YUV/RAW) to
data/UVG/videos/
. - Crop Videos from 1920x1080 to 1920x1024.
cd data/UVG/ ffmpeg -pix_fmt yuv420p -s 1920x1080 -i ./videos/xxxx.yuv -vf crop=1920:1024:0:0 ./videos_crop/xxxx.yuv
- Convert YUV files to images.
python convert.py
- Create I frames. We need to create I frames by H.265 with $crf of 20,23,26,29.
After finished the generating of I frames of each crf, you need to use bpps of each video in
cd CreateI sh h265.sh $crf 1920 1024
result.txt
to fill the bpps in Class UVGdataset indataset.py
.
cd examples/example
sh cp.sh
sh run.sh
If you want models with more λ, you can edit config.json
If you want to use tensorboard:
cd examples
sh tf.sh xxxx
Our pretrained model with λ=2048,1024,512,256 is provided on Google Drive. You can put it to snapshot/
and run test.sh
:
sh test.sh
If you find this paper useful, please cite:
@article{lu2018dvc,
title={DVC: An End-to-end Deep Video Compression Framework},
author={Lu, Guo and Ouyang, Wanli and Xu, Dong and Zhang, Xiaoyun and Cai, Chunlei and Gao, Zhiyong},
journal={arXiv preprint arXiv:1812.00101},
year={2018}
}