L3C-PyTorch  by fab-jul

PyTorch implementation for learned lossless image compression (CVPR'19 paper)

Created 6 years ago
404 stars

Top 71.9% on SourcePulse

GitHubView on GitHub
Project Summary

This repository provides a PyTorch implementation of the L3C system for learned lossless image compression, achieving state-of-the-art results that outperform traditional codecs like PNG and WebP. It is targeted at researchers and engineers in computer vision and image processing interested in efficient lossless compression techniques.

How It Works

L3C employs a fully parallelizable hierarchical probabilistic model for adaptive entropy coding. Unlike autoregressive models that operate solely in RGB space, L3C jointly models the image distribution with learned auxiliary representations. This approach requires only three forward passes for all pixel probabilities, offering a significant speedup (over two orders of magnitude) compared to methods like PixelCNN. The learned auxiliary representations are crucial for performance, outperforming predefined ones.

Quick Start & Requirements

  • Install: Clone the repo, create a conda environment (conda create --name l3c_env python=3.7 pip), activate it (conda activate l3c_env), and install dependencies (conda install pytorch=1.1 torchvision cudatoolkit=10.0 -c pytorch, pip install -r pip_requirements.txt). Install torchac separately as described in the README for entropy coding.
  • Prerequisites: Python 3.7, PyTorch 1.1 (PyTorch 1.2 is not supported), CUDA, GCC (tested with 5.5), NVCC (tested with 9.0). scikit-image and awscli are needed for data preprocessing.
  • Setup: Training data preparation for Open Images can take hours and requires ~300 GB of disk space.
  • Links: Paper, FAQ, torchac repo

Highlighted Details

  • Outperforms PNG, WebP, and JPEG 2000 in lossless compression.
  • Achieves over 2x speedup in sampling compared to PixelCNN variants.
  • Offers released trained models for Open Images and ImageNet datasets.
  • Includes a custom C++ extension (torchac) for fast arithmetic coding with optional CUDA support.

Maintenance & Community

The project is associated with ETH Zurich. The README mentions an update to the repo (issue #14) and provides contact information via email (in the paper) or GitHub issues for questions.

Licensing & Compatibility

The repository does not explicitly state a license in the README. However, the nature of the project and its academic origin suggest it is likely intended for research purposes. Commercial use would require clarification of licensing terms.

Limitations & Caveats

PyTorch 1.2 is not supported. The code does not natively support multi-GPU training, requiring modifications for nn.DataParallel. The torchac module's CUDA compilation can be sensitive to specific GCC and NVCC versions. Data preprocessing for Open Images is resource-intensive.

Health Check
Last Commit

2 years ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
1 stars in the last 30 days

Explore Similar Projects

Starred by Alex Yu Alex Yu(Research Scientist at OpenAI; Former Cofounder of Luma AI) and Phil Wang Phil Wang(Prolific Research Paper Implementer).

Cosmos-Tokenizer by NVIDIA

0.1%
2k
Suite of neural tokenizers for image and video processing
Created 10 months ago
Updated 7 months ago
Starred by Alex Yu Alex Yu(Research Scientist at OpenAI; Former Cofounder of Luma AI), Lianmin Zheng Lianmin Zheng(Coauthor of SGLang, vLLM), and
2 more.

HunyuanVideo by Tencent-Hunyuan

0.2%
11k
PyTorch code for video generation research
Created 9 months ago
Updated 3 weeks ago
Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Jiayi Pan Jiayi Pan(Author of SWE-Gym; MTS at xAI), and
15 more.

taming-transformers by CompVis

0.1%
6k
Image synthesis research paper using transformers
Created 4 years ago
Updated 1 year ago
Feedback? Help us improve.