Skip to main content

Minimal BRISQUE no-reference image quality scorer (numpy + Pillow).

Project description

pyteenybrisque

PyPI version Python versions CI

Tiny BRISQUE no-reference image quality scorer. One function, two runtime dependencies (numpy and Pillow), ~250 KB of vendored model weights.

import pyteenybrisque

score = pyteenybrisque.score(image="photo.jpg")
print(score)  # lower is better; ~0-100 scale

score() accepts a path, a PIL.Image.Image, or a numpy array (HxW grayscale or HxWx{3,4} RGB / RGBA, uint8 or float in [0, 1]).

Installation

pip install pyteenybrisque

What it computes

BRISQUE (Mittal, Moorthy, Bovik 2012) is a no-reference image quality metric. It extracts 36 natural-scene-statistics features from the luma channel at two scales and runs them through an RBF SVR trained on LIVE IQA. Lower scores mean higher perceived quality.

The implementation matches pyiqa's BRISQUE within ~0.1 BRISQUE points on natural images.

How it compares

Each metric in the table below was scored on the Kodak True Color test set (8 lossless 768×512 PNGs) under six degradation sweeps. Per source and metric, scores are min-max normalised across the sweep so 0 = best in run, 1 = worst; the line is the median across sources, the shaded band is the inter-quartile range.

JPEG quality sweep WebP quality sweep Gaussian blur sweep
Gaussian noise sweep Blocky upscale sweep Blurry upscale sweep

BRISQUE is competitive with the deep-learning metrics on every degradation. The benchmark script lives at tools/benchmark_metrics.py and is reproducible end-to-end.

Why "teeny"

pyiqa is the right tool if you want every IQA metric in one place. It pulls in PyTorch and ~2 GB of dependencies. This package does one metric, on top of just numpy and Pillow, in ~250 KB. Use it when BRISQUE is all you need.

License

MIT

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

pyteenybrisque-0.1.1.tar.gz (182.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyteenybrisque-0.1.1-py3-none-any.whl (182.8 kB view details)

Uploaded Python 3

File details

Details for the file pyteenybrisque-0.1.1.tar.gz.

File metadata

  • Download URL: pyteenybrisque-0.1.1.tar.gz
  • Upload date:
  • Size: 182.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyteenybrisque-0.1.1.tar.gz
Algorithm Hash digest
SHA256 eb804b121146056ec6b6d08581f6f19983b565df11e746af0ebe802575c5e56e
MD5 733a48836f15888332ddb9fd2aba0c18
BLAKE2b-256 8143294f291398c93ed695ef208333857394763e50581da3fcef4a3aded3228f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyteenybrisque-0.1.1.tar.gz:

Publisher: publish.yml on oliverhaas/pyteenybrisque

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyteenybrisque-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pyteenybrisque-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 182.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyteenybrisque-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d3437290463c62c8479300fad0ab579e1357ce5bfc967e299a4916e24877a426
MD5 6d8731afe53a66c40a2c67a8aa0930b5
BLAKE2b-256 75e640048a4eb960ee9fc48f7cade4d98274dac591ecc733beacfb3babacf703

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyteenybrisque-0.1.1-py3-none-any.whl:

Publisher: publish.yml on oliverhaas/pyteenybrisque

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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