Skip to main content

Utilities for JPEG data access and manipulation in pytorch

Project description

TorchJPEG

pipeline status coverage report PyPI License

This package contains a C++ extension for pytorch that interfaces with libjpeg to allow for manipulation of low-level JPEG data. By using libjpeg, quantization results are guaranteed to be consistent with other applications, like image viewers or MATLAB, which use libjpeg to compress and decompress images. This is useful because JPEG images can be effected by round-off errors or slight differences in the decompression procedure. Besides this, this library can be used to read and write DCT coefficients, functionality which is not available from other python interfaces.

Besides this, the library includes many utilities related to JPEG compression, many of which are written using native pytorch code meaning they can be differentiated or GPU accelerated. The library currently includes packages related to the DCT, quantization, metrics, and dataset transformations.

LIBJPEG

Currently builds against: libjpeg-9d. libjpeg is statically linked during the build process. See http://www.ijg.org/files/ for libjpeg source. The full libjpeg source is included with the torchjpeg source code and will be built during the install process (for a source or sdist install).

Install

Packages are hosted on pypi. Install using pip, note that only Linux builds are supported at the moment.

pip install torchjpeg

If there is demand for builds on other platforms it may happen in the future. Also note that the wheel is intended to be compatible with manylinux2014 which means it should work on modern Linux systems, however, because of they way pytorch works, we can't actually build it using all of the manylinux2014 tools. So compliance is not guaranteed and YMMV.

torchjpeg is currently in pre-beta development and consists mostly of converted research code. The public facing API, including any and all names of
parameters and functions, is subject to change at any time. We follow semver for versioning and will adhere to that before making and breaking
changes.

Citation

If you use our code in a publication, we ask that you cite the following paper (bibtex):

Max Ehrlich, Larry Davis, Ser-Nam Lim, and Abhinav Shrivastava. "Quantization Guided JPEG Artifact Correction." In Proceedings of the European Conference on Computer Vision, 2020

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

torchjpeg-0.9.31.dev1.tar.gz (1.1 MB view details)

Uploaded Source

Built Distributions

File details

Details for the file torchjpeg-0.9.31.dev1.tar.gz.

File metadata

  • Download URL: torchjpeg-0.9.31.dev1.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.4 Linux/5.4.109+

File hashes

Hashes for torchjpeg-0.9.31.dev1.tar.gz
Algorithm Hash digest
SHA256 47eca3e5dc2adec3ce2bbd6f8bc91a5bf12eadbae44f2b5aca5f3595d3b3a2f3
MD5 6db910340f3163d295f690be76b39590
BLAKE2b-256 652ab25184bd0f18420656c095f553ed544b22ebe4576bc3d2959b346b87ea76

See more details on using hashes here.

File details

Details for the file torchjpeg-0.9.31.dev1-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for torchjpeg-0.9.31.dev1-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d65afb3eaaed8b45d3fb8706c95c5e7ab456d2982113f01b9575cee59965d9c2
MD5 fac9153862f384ff23069702358002a2
BLAKE2b-256 3f3dc85b78605c03ee6329c29a16271c3041f62ff79d4b8becba657e6e2fe8e6

See more details on using hashes here.

File details

Details for the file torchjpeg-0.9.31.dev1-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for torchjpeg-0.9.31.dev1-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 de2cafaa07cc80503de4542da38c3a027cc1f08cb0b139f80ea0fa17de336d76
MD5 ad687316ffcae3c93c1516b83ceeb0a8
BLAKE2b-256 f91ad5c51d36403986be50ac60dfd5cb4c1663d6737b17ad4c241a1b49bed41e

See more details on using hashes here.

File details

Details for the file torchjpeg-0.9.31.dev1-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for torchjpeg-0.9.31.dev1-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7e273a67e7a1fbc5cbbdde95235c1dceed367f9a9f18c1111e0c593c535a201d
MD5 c4b9c4d5446b71503df5c0da29b43935
BLAKE2b-256 01a82a3b4522d8ac97b32b4bab44e7c567449b0f745e55b5ba89eb64a3480668

See more details on using hashes here.

File details

Details for the file torchjpeg-0.9.31.dev1-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for torchjpeg-0.9.31.dev1-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e5656eb8ed4e22dde8b6105e1a76f5be2e2c14d09b4041e7e3c3db4a6d17294f
MD5 b393e7d0336771cd07fe328ecdef1be4
BLAKE2b-256 617f9252157af882e79032be359b49ae5792d1fb90260078e04bacaf3f25d1c3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page