Giter Site home page Giter Site logo

fantasyzhai / autoencoder_based_image_compression Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thierrydumas/autoencoder_based_image_compression

0.0 1.0 0.0 566.85 MB

Autoencoder based image compression: can the learning be quantization independent? https://arxiv.org/abs/1802.09371

CSS 0.79% HTML 5.64% Makefile 0.68% C 0.95% TeX 2.19% C++ 70.52% Shell 0.65% Python 17.66% JavaScript 0.90% CMake 0.01%

autoencoder_based_image_compression's Introduction

Autoencoder based image compression: can the learning be quantization independent?

This repository is a Tensorflow implementation of the paper "Autoencoder based image compression: can the learning be quantization independent?", ICASSP, 2018.

ICASSP 2018 paper | Project page with visualizations

The code is tested on Linux and Windows.

Prerequisites

  • Python (the code was tested using Python 2.7.9 and Python 3.6.3)
  • numpy (version >= 1.11.0)
  • tensorflow (optional GPU support), see TensorflowInstallationWebPage (for Python 2.7.9, the code was tested using Tensorflow 0.11.0; for Python 3.6.3, the code was tested using Tensorflow 1.4.0; the code must thus work using any Tensorflow 0.x or 1.x, x being the subversion index)
  • cython
  • matplotlib
  • pillow
  • scipy
  • six
  • glymur, see GlymurWebPage
  • ImageMagick, see ImageMagickWebPage

Cloning the code

Clone this repository into the current folder.

git clone https://github.com/thierrydumas/autoencoder_based_image_compression.git
cd autoencoder_based_image_compression/kodak_tensorflow/

Compilation

  1. Compilation of the C++ lossless coder via Cython.
    cd lossless
    python setup.py build_ext --inplace
    cd ../
  2. Compilation of HEVC/H.265.
    • For Linux,
      cd hevc/HM-16.15/build/linux/
      make
      cd ../../../../
    • For Windows, use Visual Studio 2015 and the solution file at "hevc/HM-16.15/build/HM_vc2015.sln". For more information, see HEVCSoftwareWebPage.

Quick start: reproducing the main results of the paper

  1. Creation of the Kodak test set containing 24 luminance images.
    python creating_kodak.py
  2. Comparison of several trained autoencoders, JPEG2000, and H.265 in terms of rate-distortion on the Kodak test set.
    python reconstructing_eae_kodak.py
    After running Step 2, the reconstructions of the luminance images in the Kodak test set and the rates and the PSNRs associated to the compression of the luminance images via the trained autoencoders, JPEG2000, and H.265 are stored in the folder "eae/visualization/test/checking_reconstructing/kodak/".

Quick start: training an autoencoder

  1. First of all, ImageNet images must be downloaded. In our case, it is sufficient to download the ILSVRC2012 validation images, "ILSVRC2012_img_val.tar" (6.3 GB), see ImageNetDownloadWebPage. Let's say that, in your computer, the path to "ILSVRC2012_img_val.tar" is "path/to/folder_0/ILSVRC2012_img_val.tar" and you want the unpacked images to be put into the folder "path/to/folder_1/" before the script "creating_imagenet.py" preprocesses them. The creation of the ImageNet training and validaton sets of luminance images is then done via
    python creating_imagenet.py path/to/folder_1/ --path_to_tar=path/to/folder_0/ILSVRC2012_img_val.tar
  2. The training of an autoencoder on the ImageNet training set is done via the command below. 1.0 is the value of the quantization bin widths at the beginning of the training. 14000.0 is the value of the coefficient weighting the distortion term and the rate term in the objective function to be minimized over the parameters of the autoencoder. The script "training_eae_imagenet.py" enables to split the entire autoencoder training into several successive parts. The last argument 0 means that "training_eae_imagenet.py" runs the first part of the entire training. For each successive part, the last argument is incremented by 1.
    python training_eae_imagenet.py 1.0 14000.0 0

Full functionality

The documentation "documentation_kodak/documentation_code.html" describes all the functionalities of the code of the paper.

A simple example

Another piece of code is a simple example for introducing the code of the paper. This piece of code is stored in the folder "svhn". Its documentation is in the file "documentation_svhn/documentation_code.html". If you feel comfortable with autoencoders, this piece of code can be skipped. Its purpose is to clarify the training of a rate-distortion optimized autoencoder. That is why a simple rate-distortion optimized autoencoder with very few hidden units is trained on tiny images (32x32 SVHN digits).

Citing

@InProceedings{autoencoder_based_icassp2018,
  author = {Dumas, Thierry and Roumy, Aline and Guillemot, Christine},
  title = {Autoencoder based image compression: can the learning be quantization independent?},
  booktitle = {ICASSP},
  year = {2018}
}

autoencoder_based_image_compression's People

Contributors

thierrydumas avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.