A PyTorch-based framework for deep-learning-based data compression research.
- All implementations of models and datasets are modularized and registered in a registry. The training and testing pipelines can be easily configured by YAML files. Please refer to the example configuration files in the
configfolder and see the details of available options incompresslab/utils/config.py. - Add
!includetag to include other YAML files, and!looptag to generate repeated structures in the configuration files. Please refer to the examples inconfigfolder. - For the vae-based image compression models
compresslab/nn/lossy_image_compression, training with several rate-distortion points simultaneously is supported in one run. - The framework is built on PyTorch Lightning, which makes it easy to run in DDP mode and adjust the precision. Moreover, it supports logging via TensorBoard, and resume from the checkpoint automatically.
- A general metrics computation module is provided, and you can easily obtain the final results in the
outputfolder after testing.
conda create -n compresslab python=3.9
conda activate compresslab
pip install -e .Run
python run.py --listto check all registered modules.
Run
python run.py --config config/your_config.yamlto train a model with the specified configuration file.
Run
tensorboard --logdir outputto monitor the training process.
download.py can be used to download and extract the datasets automatically. For example, to download the CLIC2020 Professional Validation dataset, run
python dataset/download.py --dataset CLIC2020_professional_valCurrent supported datasets:
- Vimeo90k
- CLIC2020
- DIV2K
- Tecnick
- UVG
- Kodak (Already included in the repository)
Run
python dataset/download.py --listto check all supported datasets.
- All models implemented in CompressAI:
- ChARM
- TCM
- MLIC
- Refactor the code of video compression models.
- Load video dataset directly from
.yuvfiles. - Try to implement finetining from checkpoints or two-stage training in one run.
- Support automatically padding the input image to the required size.
-
benchmark.pycan't give the correct bd-rate curve. Fix it later.