Coder Social home page Coder Social logo

sumerzhang / compressai Goto Github PK

View Code? Open in Web Editor NEW

This project forked from interdigitalinc/compressai

0.0 1.0 0.0 21.29 MB

A PyTorch library and evaluation platform for end-to-end compression research

Home Page: https://interdigitalinc.github.io/CompressAI/

License: Apache License 2.0

Python 91.43% C++ 8.57%

compressai's Introduction

CompressAI

CompressAI (compress-ay) is a PyTorch library and evaluation platform for end-to-end compression research.

CompressAI currently provides:

  • custom operations, layers and models for deep learning based data compression
  • a partial port of the official TensorFlow compression library
  • pre-trained end-to-end compression models for learned image compression
  • evaluation scripts to compare learned models against classical image/video compression codecs

Installation

CompressAI only supports python 3.6+ and PyTorch 1.4+. A C++17 compiler, a recent version of pip (19.0+), and common python packages (see setup.py for the full list) are also required.

To get started and install CompressAI, run the following commands in a virtual environment:

git clone https://github.com/InterDigitalInc/CompressAI compressai
cd compressai
pip install -U pip && pip install -e .

For a custom installation, you can also run one of the following commands:

  • pip install -e '.[dev]': install the packages required for development (testing, linting, docs)
  • pip install -e '.[tutorials]': install the packages required for the tutorials (notebooks)
  • pip install -e '.[all]': install all the optional packages

This is the currently recommended installation method. Docker images and PyPI packages will be released in the future. Conda environments are not officially supported.

Documentation

Usage

Examples

Script and notebook examples can be found in the examples/ directory.

To encode/decode images with the provided pre-trained models, run the codec.py example:

python3 examples/codec.py --help

An examplary training script with a rate-distortion loss is provided in examples/train.py. You can replace the model used in the training script with your own model implemented within CompressAI, and then run the script for a simple training pipeline:

python3 examples/train.py -d /path/to/my/image/dataset/ --epochs 300 -lr 1e-4 --batch-size 16 --cuda --save

Note: the training example uses a custom ImageFolder structure.

A jupyter notebook illustrating the usage of a pre-trained model for learned image compression is also provided in the examples directory:

pip install -U ipython jupyter ipywidgets matplotlib
jupyter notebook examples/

Evaluation

To evaluate a pre-trained model on your own dataset, CompressAI provides an evaluation script:

python3 -m compressai.utils.eval_model MODEL_NAME /path/to/images/folder/

To evaluate published classical or machine-learning based image/video codec solutions:

python3 -m compressai.utils.bench --help
python3 -m compressai.utils.bench bpg --help
python3 -m compressai.utils.bench vtm --help

License

CompressAI is licensed under the Apache License, Version 2.0

Contributing

We welcome feedback and contributions. Please open a GitHub issue to report bugs, request enhancements or if you have any questions.

Before contributing, please read the CONTRIBUTING.md file.

Authors

  • Jean Bégaint, Fabien Racapé, Simon Feltman and Akshay Pushparaja, from the InterDigital AI Lab.
  • Contact: [email protected]

Citation

If you use this project, please cite the relevant publications for the original models and datasets, and cite this project as:

@misc{CompressAI,
	title = {{CompressAI}: A PyTorch library and evaluation platform for end-to-end compression research},
	author = "{Jean Bégaint, Fabien Racapé, Simon Feltman, Akshay Pushparaja}",
	howpublished = {\url{https://github.com/InterDigitalInc/CompressAI}},
	url = "https://github.com/InterDigitalInc/CompressAI",
	year = 2020,
	note = "[Online; accessed 24-June-2020]"
}

Related links

compressai's People

Contributors

jbegaint avatar fracape avatar

Watchers

James Cloos 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.