DiffJPEG implemented in JAX
Project description
DiffJPEG: A Jax Implementation
This is a Jax implementation of the differentiable JPEG compression algorithm, based on the PyTorch implementation.
Requirements
- JAX
Installation
Can be installed with pip:
pip install diffjpeg_jax
Usage
Unlike the PyTorch version, this is ML library agnostic, so it simply is implemented as a function.
from diffjpeg_jax import diff_jpeg
img = ... # (H, W, C)
jpeg = diff_jpeg(img, quality=75)
Note: The implementation is not wrapped in JIT, so make sure to do that if you want to. For batch processing just use vmap.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
diffjpeg_jax-0.1.0.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for diffjpeg_jax-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e7b8caf6c71e3835b85e6929659847c2454dd26b3a3351e42611acdd349c24d |
|
MD5 | 7c9e68d75721edb5f99b9925e94c6e09 |
|
BLAKE2b-256 | 1a118f21f28d4442674fbdb815f59eadc24d65f50e118ac277c72f7979651e10 |