Package: neuralcompression
NeuralCompressionWhat's NewAugust 2023 (image compression)-Released PyTorch implementation of MS-ILLMApril 2023 (video compression)-Released PyTorch implementation of VCTNovember 2022 (image compression)-Released Bits-Back coding with diffusion models!July 2021 (video compression)-Released implementation of DVCAboutNeuralCompression is a Python repository dedicated to research of neural
networks that compress data. The repository includes tools such as JAX-based
entropy coders, image compression models, video compression models, and metrics
for image and video evaluation.NeuralCompression is alpha software. The project is under active development.
The API will change as we make releases, potentially breaking backwards
compatibility.InstallationNeuralCompression is a project currently under development. You can install the
repository in development mode.PyPI InstallationFirst, install PyTorch according to the directions from thePyTorch website. Then, you should be able to runpipinstallneuralcompressionto get the latest version from PyPI.Development InstallationFirst, clone the repository and navigate to the NeuralCompression root
directory and install the package in development mode by running:pipinstall--editable".[tests]"If you are not interested in matching the test environment, then you can just
applypip install -e ..Repository StructureWe use a 2-tier repository structure. Theneuralcompressionpackage contains
a core set of tools for doing neural compression research. Code committed to
the core package requires stricter linting, high code quality, and rigorous
review. Theprojectsfolder contains code for reproducing papers and training
baselines. Code in this folder is not linted aggressively, we don't enforce
type annotations, and it's okay to omit unit tests.The 2-tier structure enables rapid iteration and reproduction via code inprojectsthat is built on a backbone of high-quality code inneuralcompression.neuralcompressionneuralcompression- base packagedata- PyTorch data loaders for various data setsdistributions- extensions of probability models for compressionfunctional- methods for image warping, information cost, flop counting, etc.layers- building blocks for compression modelsmetrics-torchmetricsclasses for assessing model performancemodels- complete compression modelsoptim- useful optimization utilitiesprojectsprojects- recipes and code for reproducing papersbits_back_diffusion- code for bits-back coding with diffusion modelsdeep_video_compressionDVC (Lu et al., 2019), might soon be deprecatedillmMS-ILLM (Muckley et al., 2023)jax_entropy_coders- implementations of arithmetic coding and ANS in JAXtorch_vctVCT (Mentzer, et al.,)Tutorial NotebooksThis repository also features interactive notebooks detailing different
parts of the package, which can be found in thetutorialsdirectory.
Existing tutorials are:Walkthrough of theneuralcompressionflop counter (view on Colab).Usingneuralcompression.metricsandtorchmetricsto calculate rate-distortion curves (view on Colab).ContributionsPlease read ourCONTRIBUTINGguide and ourCODE_OF_CONDUCTprior to submitting a pull
request.We test all pull requests. We rely on this for reviews, so please make sure any
new code is tested. Tests forneuralcompressiongo in thetestsfolder in
the root of the repository. Tests for individual projects go in those projects'
owntestsfolder.We useblackfor formatting,isortfor import sorting,flake8for
linting, andmypyfor type checking.LicenseNeuralCompression is MIT licensed, as found in theLICENSEfile.Model weights released with NeuralCompression are CC-BY-NC 4.0 licensed, as
found in theWEIGHTS_LICENSEfile.Some of the code may from other repositories and include other licenses.
Please read all code files carefully for details.CiteIf you use code for a paper reimplementation. If you would like to also cite
the repository, you can use:@misc{muckley2021neuralcompression,author={Matthew Muckley and Jordan Juravsky and Daniel Severo and Mannat Singh and Quentin Duval and Karen Ullrich},title={NeuralCompression},howpublished={\url{https://github.com/facebookresearch/NeuralCompression}},year={2021}}