Skip to main content

PIL × DAT - Pillow extension for AI-based image upscaling.

Project description

iLoveData

PIL × DAT - Pillow extension for AI-based image upscaling.

License


Installation

For PyPI:

pip install pillow-dat

Get started

from PIL.Image import open

from PIL_DAT.Image import upscale

lumine_image = open(".github/lumine.png")
lumine_image = upscale(lumine_image, 2)

Remark: We strongly advocate for the utilization of DAT light models owing to their streamlined design and outstanding speed performance. However, should you opt for alternative models, please note that *.pth model weights can be accessed via Google Drive.

Example

Input (lumine.png) DAT light (x2) Bicubic (x2)
Input (lumine.png) DAT light (x2) Bicubic (x2)

Benchmarks

Speed

Performance benchmarks have been conducted on a computing system equipped with an Intel(R) CORE(TM) i7-9750H CPU @ 2.60GHz processor, accompanied by a 2 × 8 Go at 2667MHz RAM configuration. Below are the recorded results:

In seconds 320 × 320 640 × 640 960 × 960 1280 × 1280
DAT light (x2) 13.7 54.9 127.2 299.3
DAT light (x3) 13.2 56.5 - -
DAT light (x4) 12.8 56.6 - -

The results were compared against the renowned OpenCV library, utilizing its EDSR model known for delivering superior image quality.

In seconds 320 × 320 640 × 640 960 × 960 1280 × 1280
EDSR (x2) 25.6 112.9 264.1 472.8
EDSR (x3) 24.3 112.5 - -
EDSR (x4) 23.6 111.2 - -

Remark: All speed benchmark results presented here are reproducible. For detailed implementation, please refer to the following files: benchmark_speed_dat_light.py and benchmark_speed_edsr.py.

Quality

DAT light (x2) EDSR (x2)
DAT light (x2) EDSR (x2)

Remark: All quality benchmark results presented here are reproducible. For detailed implementation, please refer to the following files: example.py and benchmark_quality_edsr.py.

Contribution

Please install Miniconda.

Please install VSCode extensions:

  • Black Formatter
  • isort
  • Python
  • Pylance

To create or update the pillow-dat Python environment:

conda env create --file environment.yml
conda env update --file environment.yml --prune

To install dependencies:

poetry install

To run unit tests:

pytest

Acknowledgement

This library is founded upon the pioneering research paper, "Dual Aggregation Transformer for Image Super-Resolution".

@inproceedings{chen2023dual,
    title={Dual Aggregation Transformer for Image Super-Resolution},
    author={Chen, Zheng and Zhang, Yulun and Gu, Jinjin and Kong, Linghe and Yang, Xiaokang and Yu, Fisher},
    booktitle={ICCV},
    year={2023}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pillow_dat-0.1.7.tar.gz (7.6 MB view details)

Uploaded Source

Built Distribution

pillow_dat-0.1.7-py3-none-any.whl (7.7 MB view details)

Uploaded Python 3

File details

Details for the file pillow_dat-0.1.7.tar.gz.

File metadata

  • Download URL: pillow_dat-0.1.7.tar.gz
  • Upload date:
  • Size: 7.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Windows/11

File hashes

Hashes for pillow_dat-0.1.7.tar.gz
Algorithm Hash digest
SHA256 6b27c42a7fe163214e5cd13b3fe8191027c34b9260ec2f9694a4a7898eb66cba
MD5 8dd7219dc27fc1f4551151b1107c532f
BLAKE2b-256 eb7a1b76e895597971a363e1a9df7c8a511b8ce90f299d2709fa02f215aa8d25

See more details on using hashes here.

File details

Details for the file pillow_dat-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: pillow_dat-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 7.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Windows/11

File hashes

Hashes for pillow_dat-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 6f424e222a3cf3617046d7c660a780961a6c34350c5c93ed9a8ed8bca4635f6a
MD5 d6858d8b37187b7fdb8668e8de8174e9
BLAKE2b-256 e8e2d81d706980b5645fc692e8cd42a75667fba8c128efb0323de0e76f9b99fa

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