Skip to content

A personal reimplementation with TensorFlow of NIPS2018 paper: Joint Autoregressive and Hierarchical Priors for Learned Image Compression

Notifications You must be signed in to change notification settings

mengab/Joint-Autoregressive-and-Hierarchical-Priors-for-Learned-Image-Compression

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 

Repository files navigation

Joint-Autoregressive-and-Hierarchical-Priors-for-Learned-Image-Compression

This is a personal reimplementation of NIPS2018 paper: D. Minnen et al. "Joint Autoregressive and Hierarchical Priors for Learned Image Compression". We achieved almost the same results as in the paper.

Paper [ArXiv] | [NIPS2018]

Installation

  • Anaconda

This creates an Anaconda environment with Python 3.6 and CUDA libraries, and then installs TensorFlow and tensorflow-compression with GPU support:

conda create --name py36 python=3.6 cudatoolkit=10.0 cudnn
conda activate py36
pip install tensorflow-gpu==1.15 tensorflow-compression

Usage

Importing the library from your Python code as follows:

import tensorflow as tf
import tensorflow_compression as tfc

Using a pre-trained model to compress an image

Download the file and run:

python tfci.py -h

This will give you a list of options. Briefly, the command

python tfci.py compress <model> <PNG file>

will compress an image using a pre-trained model and write a file ending in .tfci. Execute python tfci.py models to give you a list of supported pre-trained models. The command

python tfci.py decompress <TFCI file>

will decompress a TFCI file and write a PNG file. By default, an output file will be named like the input file, only with the appropriate file extension appended (any existing extensions will not be removed).

Training your own model

To train the models, you need to supply it with a dataset of RGB training images. They should be provided in PNG format. Training can be as simple as the following command:

python joint_NIPS2018.py --verbose train --train_glob="images/*.png"

About

A personal reimplementation with TensorFlow of NIPS2018 paper: Joint Autoregressive and Hierarchical Priors for Learned Image Compression

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published