{"id":15034763,"url":"https://github.com/interdigitalinc/compressai","last_synced_at":"2025-05-14T20:09:59.798Z","repository":{"id":37073143,"uuid":"274269285","full_name":"InterDigitalInc/CompressAI","owner":"InterDigitalInc","description":"A PyTorch library and evaluation platform for end-to-end compression research","archived":false,"fork":false,"pushed_at":"2025-04-14T10:10:05.000Z","size":47731,"stargazers_count":1318,"open_issues_count":64,"forks_count":242,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-05-03T17:43:41.488Z","etag":null,"topics":["compression","deep-learning","deep-neural-networks","machine-learning","neural-network","python","pytorch"],"latest_commit_sha":null,"homepage":"https://interdigitalinc.github.io/CompressAI/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause-clear","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/InterDigitalInc.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-23T00:13:59.000Z","updated_at":"2025-05-01T14:55:31.000Z","dependencies_parsed_at":"2022-07-12T16:13:41.811Z","dependency_job_id":"98366357-e972-432b-89ed-97e91d153b23","html_url":"https://github.com/InterDigitalInc/CompressAI","commit_stats":{"total_commits":661,"total_committers":16,"mean_commits":41.3125,"dds":0.508320726172466,"last_synced_commit":"ee91d536bd934fc1f8b1532f78db4c94072ae26d"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InterDigitalInc%2FCompressAI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InterDigitalInc%2FCompressAI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InterDigitalInc%2FCompressAI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InterDigitalInc%2FCompressAI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/InterDigitalInc","download_url":"https://codeload.github.com/InterDigitalInc/CompressAI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254219374,"owners_count":22034397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compression","deep-learning","deep-neural-networks","machine-learning","neural-network","python","pytorch"],"created_at":"2024-09-24T20:26:15.242Z","updated_at":"2025-05-14T20:09:59.771Z","avatar_url":"https://github.com/InterDigitalInc.png","language":"Python","readme":"\u003c!-- ![ID-CompressAI-logo](assets/ID-compressAI-logo-750x140.svg =750x140) --\u003e\n\u003ca href=\"url\"\u003e\u003cimg src=\"docs/source/_static/logo.svg\" align=\"center\"\u003e\u003c/a\u003e\n\n[![License](https://img.shields.io/github/license/InterDigitalInc/CompressAI?color=blue)](https://github.com/InterDigitalInc/CompressAI/blob/master/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/compressai?color=brightgreen)](https://pypi.org/project/compressai/)\n[![Downloads](https://pepy.tech/badge/compressai)](https://pypi.org/project/compressai/#files)\n\nCompressAI (_compress-ay_) is a PyTorch library and evaluation platform for\nend-to-end compression research.\n\nCompressAI currently provides:\n\n* custom operations, layers and models for deep learning based data compression\n* a partial port of the official [TensorFlow compression](https://github.com/tensorflow/compression) library\n* pre-trained end-to-end compression models for learned image compression\n* evaluation scripts to compare learned models against classical image/video\n  compression codecs\n\n![PSNR performances plot on Kodak](assets/kodak-psnr.png)\n\n\n\u003e **Note**: Multi-GPU support is now experimental.\n\n## Installation\n\nCompressAI supports python 3.8+ and PyTorch 1.7+.\n\n**pip**:\n\n```bash\npip install compressai\n```\n\n\u003e **Note**: wheels are available for Linux and MacOS.\n\n**From source**:\n\nA C++17 compiler, a recent version of pip (19.0+), and common python packages\nare also required (see `setup.py` for the full list).\n\nTo get started locally and install the development version of CompressAI, run\nthe following commands in a [virtual environment](https://docs.python.org/3.6/library/venv.html):\n\n```bash\ngit clone https://github.com/InterDigitalInc/CompressAI compressai\ncd compressai\npip install -U pip \u0026\u0026 pip install -e .\n```\n\nFor a custom installation, you can also run one of the following commands:\n* `pip install -e '.[dev]'`: install the packages required for development (testing, linting, docs)\n* `pip install -e '.[tutorials]'`: install the packages required for the tutorials (notebooks)\n* `pip install -e '.[all]'`: install all the optional packages\n\n\u003e **Note**: Docker images will be released in the future. Conda environments are not\nofficially supported.\n\n## Documentation\n\n* [Installation](https://interdigitalinc.github.io/CompressAI/installation.html)\n* [CompressAI API](https://interdigitalinc.github.io/CompressAI/)\n* [Training your own model](https://interdigitalinc.github.io/CompressAI/tutorials/tutorial_train.html)\n* [List of available models (model zoo)](https://interdigitalinc.github.io/CompressAI/zoo.html)\n\n## Usage\n\n### Examples\n\nScript and notebook examples can be found in the `examples/` directory.\n\nTo encode/decode images with the provided pre-trained models, run the\n`codec.py` example:\n\n```bash\npython3 examples/codec.py --help\n```\n\nAn examplary training script with a rate-distortion loss is provided in\n`examples/train.py`. You can replace the model used in the training script\nwith your own model implemented within CompressAI, and then run the script for a\nsimple training pipeline:\n\n```bash\npython3 examples/train.py -d /path/to/my/image/dataset/ --epochs 300 -lr 1e-4 --batch-size 16 --cuda --save\n```\n\u003e **Note:** the training example uses a custom [ImageFolder](https://interdigitalinc.github.io/CompressAI/datasets.html#imagefolder) structure.\n\nA jupyter notebook illustrating the usage of a pre-trained model for learned image\ncompression is also provided in the `examples` directory:\n\n```bash\npip install -U ipython jupyter ipywidgets matplotlib\njupyter notebook examples/\n```\n\n### Evaluation\n\nTo evaluate a trained model on your own dataset, CompressAI provides an\nevaluation script:\n\n```bash\npython3 -m compressai.utils.eval_model checkpoint /path/to/images/folder/ -a $ARCH -p $MODEL_CHECKPOINT...\n```\n\nTo evaluate provided pre-trained models:\n\n```bash\npython3 -m compressai.utils.eval_model pretrained /path/to/images/folder/ -a $ARCH -q $QUALITY_LEVELS...\n```\n\nTo plot results from bench/eval_model simulations (requires matplotlib by default):\n\n```bash\npython3 -m compressai.utils.plot --help\n```\n\nTo evaluate traditional codecs:\n\n```bash\npython3 -m compressai.utils.bench --help\npython3 -m compressai.utils.bench bpg --help\npython3 -m compressai.utils.bench vtm --help\n```\n\nFor video, similar tests can be run, CompressAI only includes ssf2020 for now:\n\n```bash\npython3 -m compressai.utils.video.eval_model checkpoint /path/to/video/folder/ -a ssf2020 -p $MODEL_CHECKPOINT...\npython3 -m compressai.utils.video.eval_model pretrained /path/to/video/folder/ -a ssf2020 -q $QUALITY_LEVELS...\npython3 -m compressai.utils.video.bench x265 --help\npython3 -m compressai.utils.video.bench VTM --help\npython3 -m compressai.utils.video.plot --help\n```\n\n## Tests\n\nRun tests with `pytest`:\n\n```bash\npytest -sx --cov=compressai --cov-append --cov-report term-missing tests\n```\n\nSlow tests can be skipped with the `-m \"not slow\"` option.\n\n\n## License\n\nCompressAI is licensed under the BSD 3-Clause Clear License\n\n## Contributing\n\nWe welcome feedback and contributions. Please open a GitHub issue to report\nbugs, request enhancements or if you have any questions.\n\nBefore contributing, please read the CONTRIBUTING.md file.\n\n## Authors\n\n* Jean Bégaint, Fabien Racapé, Simon Feltman and Hyomin Choi, InterDigital AI Lab.\n\n## Citation\n\nIf you use this project, please cite the relevant original publications for the\nmodels and datasets, and cite this project as:\n\n```\n@article{begaint2020compressai,\n\ttitle={CompressAI: a PyTorch library and evaluation platform for end-to-end compression research},\n\tauthor={B{\\'e}gaint, Jean and Racap{\\'e}, Fabien and Feltman, Simon and Pushparaja, Akshay},\n\tyear={2020},\n\tjournal={arXiv preprint arXiv:2011.03029},\n}\n```\n\nFor any work related to the variable bitrate models, please cite\n```\n@article{kamisli2024dcc_vbrlic,\n\ttitle={Variable-Rate Learned Image Compression with Multi-Objective Optimization and Quantization-Reconstruction Offsets},\n\tauthor={Kamisli, Fatih and Racap{\\'e}, Fabien and Choi, Hyomin},\n\tyear={2024},\n\tbooktitle={2024 Data Compression Conference (DCC)},\n\teprint={2402.18930},\n}\n```\n\n## Related links\n * Tensorflow compression library by _Ballé et al._: https://github.com/tensorflow/compression\n * Range Asymmetric Numeral System code from _Fabian 'ryg' Giesen_: https://github.com/rygorous/ryg_rans\n * BPG image format by _Fabrice Bellard_: https://bellard.org/bpg\n * HEVC HM reference software: https://hevc.hhi.fraunhofer.de\n * VVC VTM reference software: https://vcgit.hhi.fraunhofer.de/jvet/VVCSoftware_VTM\n * AOM AV1 reference software: https://aomedia.googlesource.com/aom\n * Z. Cheng et al. 2020: https://github.com/ZhengxueCheng/Learned-Image-Compression-with-GMM-and-Attention\n * Kodak image dataset: http://r0k.us/graphics/kodak/\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterdigitalinc%2Fcompressai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finterdigitalinc%2Fcompressai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterdigitalinc%2Fcompressai/lists"}