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

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.0.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.0-py3-none-any.whl (182.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyteenybrisque-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 926dee20086caad39c6648a68126e8d1b10f4a1c54efa62acd2907fda184d4b1
MD5 863bc2ac8251487ff98d2757bdfadaf6
BLAKE2b-256 da994d3d27afa43a624bd25207fa63d3625a24de03cdc038851d6675969f9cc0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyteenybrisque-0.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: pyteenybrisque-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb45aa605afed2319dbd558d079ff6857c1a36aa5cb051d60459cec9ca54af9d
MD5 a6df60be3e2cd600b1642a0774753dd3
BLAKE2b-256 3ad7a86c0a299fbc7c689d7373be22084608a0cc8a6ed89c18d121f19b1b66aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyteenybrisque-0.1.0-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