• Stars
    star
    217
  • Rank 182,446 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created over 5 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

DiffJPEG: A PyTorch implementation

This is a pytorch implementation of differentiable jpeg compression algorithm. This work is based on the discussion in this paper. The work relies heavily on the tensorflow implementation in this repository

Requirements

  • Pytorch 1.0.0
  • numpy 1.15.4

Use

DiffJPEG functions as a standard pytorch module/layer. To use, first import the layer and then initialize with the desired parameters:

  • differentaible(bool): If true uses custom differentiable rounding function, if false uses standrard torch.round
  • quality(float): Quality factor for jpeg compression scheme.
from DiffJPEG import DiffJPEG
jpeg = DiffJPEG(hieght=224, width=224, differentiable=True, quality=80)

image