Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

484 B
Raw Blame
Codec
=====

.. currentmodule:: kornia.enhance

A differentiable JPEG codec, useful to simulate compression artifacts inside a training loop.
It accepts RGB ``(*, 3, H, W)`` tensors in ``[0, 1]`` and a quality tensor of
shape ``(1,)`` or ``(N,)``, one per flattened image. An integer image raises
:exc:`~kornia.core.exceptions.TypeCheckError`; convert 8-bit data with ``image.float() / 255`` first.

.. autofunction:: jpeg_codec_differentiable

.. autoclass:: JPEGCodecDifferentiable