Pre-processing: Encoding the video frames into compressed videos.
March 10, 2023 · View on GitHub
Installation
- Install ffmpeg.
sudo apt install ffmpeg - Build the x265 library for encoding.
cd ./x265/build cmake ../source make -j - Build the libde265 library for decoding .
cd ./libde265 mkdir build cd ./build cmake .. make -j
Pre-processing
CamVid
- Download the CamVid dataset: here
- Download the original video sequences: here
- After downloading the files above, your directories should look like:
camvid_root ┣ test ┣ test_labels ┣ train ┣ train_labels ┣ val ┣ val_labels ┗ class_dict.csv camvid_sequence_root ┣ 01TP_extract.avi ┣ 0005VD.MXF ┣ 0006R0.MXF ┣ 0016E5.zip.001 ┗ 0016E5.zip.002 - Set ignored labels for CamVid dataset
cp ./camvid-pre-process.py /path/to/camvid_root/ cd /path/to/camvid_root/ python ./camvid-pre-process.py - Decode the original videos into video frames.
cp ./camvid_decode.sh /path/to/camvid_sequence_root/ cd /path/to/camvid_sequence_root/ bash ./camvid_decode.sh - Replace the
camvid_rootandcamvid_sequence_rootvariables in./generate_compressed_dataset_camvid.py. Run:python ./generate_compressed_dataset_camvid.py - After pre-processing, the directory of CamVid should be:
camvid_sequence_root ┣ 3M-GOP12 ┣ ┣ decoded_GOP12_dist_0 ┣ ... ┣ ┣ frames ┣ ┣ MVmap_GOP12_dist_0 ┣ ... ┣ ┗ MVmap_GOP12_dist_11 ┣ frames ┣ ┣ 0001TP ┣ ┣ 0006R0 ┣ ┣ 0016E5 ┣ ┗ Seq05VD ┣ 01TP_extract.avi ┣ 0005VD.MXF ┣ 0006R0.MXF ┣ 0016E5.zip.001 ┗ 0016E5.zip.002
Cityscapes
- Download the Cityscapes dataset: GTFine and leftImg8bit
- Download the original video sequences: leftImg8bit_sequence
- After downloading the files above, your directories should look like:
cityscapes_root ┣ GTFine ┣ ┣ test ┣ ┣ train ┣ ┗ val ┣ leftImg8bit ┣ ┣ test ┣ ┣ train ┣ ┗ val ┗ leftImg8bit_sequence ┣ test ┣ train ┗ val - Replace the
cityscapes_rootin./generate_compressed_dataset_cityscapes.py. Run:python ./generate_compressed_dataset_cityscapes.py - After pre-processing, the directory of Cityscapes should be:
cityscapes_root ┣ ... ┗ leftImg8bit_sequence ┣ 5M-GOP12 ┣ ┣ decoded_GOP12_dist_0 ┣ ... ┣ ┣ frames ┣ ┣ MVmap_GOP12_dist_0 ┣ ... ┣ ┗ MVmap_GOP12_dist_11 ┣ test ┣ train ┗ val