This repository is based on CompressAI and ryg_rans with minor modifications to make ANS easier to use for PyTorch models.
- The C++ function accepts NumPy inputs (instead of Python lists)
- Supports CompressAI models with minimal changes
- Faster than CompressAI's
encode_with_indexes()
anddecode_with_indexes()
mkdir build
cd build
# Build the C++ extension
cmake ..
make
Then test-compressai.ipynb
should work.
- Image size: 512x768
- Speed averaged over 24 images
- GPU (neural networks forward): Nvidia RTX 4090
- CPU (entropy coding, using a single thread): Intel 10700k