Using Trainningdataset_Preprocessing.py to select the largest 8000 images from imageNet and 584 images from CLIC2020 and to preprocess the images as the training dataset.
Parameters
dataset: dir. “Directory of training and validation dataset.”
A higher bitrate corresponds to a larger factor value which is the reciprocal of quantization bin size.
Discrete/Continuous Variable Rate Results
Note
From public code and paper, the models of Cheng2020 only trained for the low and medium rate with lambda belonging to {0.0016, 0.0032, 0.0075, 0.015, 0.03, 0.045}.
We re-trained Cheng2020 on our training dataset following the original paper setting with lambda belonging to {0.0018, 0.0035, 0.0067, 0.0130, 0.0250, 0.0483, 0.0932, 0.1800} for a fair comparison.
Improvement of QVRF
Using the predefined Lagrange multiplier set {0.0018, 0.0035, 0.0067, 0.0130, 0.025, 0.0483, 0.0932, 0.18, 0.36, 0.72, 1.44} with can achieve better results in high bitrate.
You can download the checkpoint for testing the result with the predefined Lagrange multiplier set {0.0018, 0.0035, 0.0067, 0.0130, 0.025, 0.0483, 0.0932, 0.18, 0.36, 0.72, 1.44}.
RD Results
We used the 8 pretrained discrete models for Balle et al., Minnen et al. from compressai as the benchmark.
We re-trained 8 Cheng2020 models on our training dataset from low bitrate and high bitrate (all the models use channel numbers of 192 for comparison).
RD Curve On Kodak dataset with 24 images
Comparison of variable rate methods. The baseline is Balle and use 8 fix-rate models as anchor
Comparison of variable rate methods.The baseline is Minnen and use 8 fix-rate models as anchor
Comparison of variable rate methods.The baseline is Cheng2020 and use 8 fix-rate models as anchor
QVRF: A QUANTIZATION-ERROR-AWARE VARIABLE RATE FRAMEWORK FOR LEARNED IMAGE COMPRESSION
Official implementation of “QVRF: A QUANTIZATION-ERROR-AWARE VARIABLE RATE FRAMEWORK FOR LEARNED IMAGE COMPRESSION”
Table of Contents
Environment
Recommend using Miniconda.
Dataset
Download Collection of Kodak or Kodak for Testing.
Training
Using Trainningdataset_Preprocessing.py to select the largest 8000 images from imageNet and 584 images from CLIC2020 and to preprocess the images as the training dataset.
Parameters
dataset: dir. “Directory of training and validation dataset.”epochs: int, default1000“Number of epochs”learning-rate: float, default1e-4“Learning rate.”num-workers: int, default4“Dataloaders threads”batch-size: int, default16“Batch size”test-batch-size: int, default64“Test batch size”learning-rate: float, default1e-4“Learning rate.”patch-size: int, default256 256“Size of the patches to be cropped.”cuda: “Use cuda.”save: “Save model to disk.”seed: float, default1926“Set random seed for reproducibility”clip_max_norm: float, default1.0“Set random seed for reproducibility”checkpoint: str, “Checkpoint path.”stage: int, default1“Trainning stage.”ste: int, default0“Using ste round in the finetune stage”loadFromPretrainedSinglemodel: int, default0“Load fixed-rate model “refresh: int, default0“Refresh the setting of optimizer and epoch”training Stage1
training Stage2
Actually, you can load a fixed-rate model and finetune it with QVRF.
training Stage3
Update
Once the model is trained, we need to run update.py to fix the entropy model
name: str, “Exported model name”dir: str, “Exported model directory.”Inference
Download checkpoint variable rate model of Cheng2020 for Inference.
Parameters
dataset: str, “Test dataset path.”s: int, default2“Discrete bitrate index.”output_path: str, “The name of reconstructed dir.”p: str, “Checkpoint path.”patch: int, default64. “Padding size.”factormode: int, between[0, 1], default0. “Whether to choose continuous bitrate adaption.”factor: float between[0.5, 12], default1.5. “Reciprocal of continuous bitrate quantization bin size.”Inference code
Example of Inference.py
Discrete bitrate results
For all discrete bitrate results:
For discrete bitrate results at a assign Index: Index belongs in {0, 1, 2, 3, 4, 5, 6, 7}
Continuous bitrate results
For example continuous bitrate results:
Change arbitrary quantization bin size in the range of [0.5, 12] at a quantization bin size 1/QBS. (1/QBS in range of [0.5, 12])
Note
A higher bitrate corresponds to a larger factor value which is the reciprocal of quantization bin size.
Discrete/Continuous Variable Rate Results
Note
From public code and paper, the models of Cheng2020 only trained for the low and medium rate with lambda belonging to {0.0016, 0.0032, 0.0075, 0.015, 0.03, 0.045}.
We re-trained Cheng2020 on our training dataset following the original paper setting with lambda belonging to {0.0018, 0.0035, 0.0067, 0.0130, 0.0250, 0.0483, 0.0932, 0.1800} for a fair comparison.
Improvement of QVRF
Using the predefined Lagrange multiplier set {0.0018, 0.0035, 0.0067, 0.0130, 0.025, 0.0483, 0.0932, 0.18, 0.36, 0.72, 1.44} with can achieve better results in high bitrate.
You can download the checkpoint for testing the result with the predefined Lagrange multiplier set {0.0018, 0.0035, 0.0067, 0.0130, 0.025, 0.0483, 0.0932, 0.18, 0.36, 0.72, 1.44}.
RD Results
We used the 8 pretrained discrete models for Balle et al., Minnen et al. from compressai as the benchmark.
We re-trained 8 Cheng2020 models on our training dataset from low bitrate and high bitrate (all the models use channel numbers of 192 for comparison).
RD Curve On Kodak dataset with 24 images
Comparison of variable rate methods. The baseline is Balle and use 8 fix-rate models as anchor
Comparison of variable rate methods.The baseline is Minnen and use 8 fix-rate models as anchor
Comparison of variable rate methods.The baseline is Cheng2020 and use 8 fix-rate models as anchor