Git Product home page Git Product logo

coin's Introduction

COIN ๐ŸŒŸ

This repo contains a Pytorch implementation of COIN: COmpression with Implicit Neural representations, including code to reproduce all experiments and plots in the paper.

Requirements

We ran our experiments with python 3.8.7 using torch 1.7.0 and torchvision 0.8.0 but the code is likely to work with earlier versions too. All requirements can be installed with

pip install -r requirements.txt

Usage

Compression

To compress the image kodak-dataset/kodim15.png, run

python main.py -ld logs_dir

This will save the COIN model and the reconstruction of the image (as well as logs of the losses and PSNR) to the logs_dir directory. To run on a specific image in the Kodak dataset, add the -iid flag. For example, to compress image 3, run

python main.py -ld logs_dir -iid 3

To compress the entire Kodak dataset, run

python main.py -ld logs_dir -fd

NOTE: The half precision version of torch.sin is only implemented in CUDA, so the half precision models can only be run on GPU, you need that to reproduce the results from the paper.

To reproduce the results from the paper, run the architectures listed in Appendix A

python main.py -ld logs_dir -fd --num_layers 5 --layer_size 20
python main.py -ld logs_dir -fd --num_layers 5 --layer_size 30
python main.py -ld logs_dir -fd --num_layers 10 --layer_size 28
python main.py -ld logs_dir -fd --num_layers 10 --layer_size 40
python main.py -ld logs_dir -fd --num_layers 13 --layer_size 49

Plots

To recreate plots from the paper, run

python plots.py

See the plots.py file to customize plots.

Acknowledgements

Our benchmarks and plots are based on the CompressAI library. Our SIREN implementation is based on lucidrains' implementation.

License

MIT

coin's People

Contributors

emiliendupont 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.