Skip to main content

A production-ready No-Reference Image Quality Assessment (NR-IQA) library.

Project description

DIQA: No-Reference Image Quality Assessment Library

PyPI version License: MIT

DIQA is a library for No-Reference Image Quality Assessment (NR-IQA). It provides a unified interface for predicting image quality using multiple state-of-the-art methods and includes a routing mechanism to select the best method for a given image.

Features

  • Unified Inference: Simple API to get MOS (Mean Opinion Score) estimates.
  • Smart Routing: Uses an XGBoost-based router to dynamically select the most accurate IQA method for each image.
  • Training Support: Built-in DIQATrainer to train the router and mapping coefficients on your own datasets.
  • Extensible: Easily integrates with pyiqa for underlying feature extraction.

Installation

pip install diqa

Usage

1. Basic Inference

Predict the quality score of an image:

from diqa import DIQA

# Initialize the engine
diqa = DIQA()

# Predict
result = diqa.predict("path/to/image.jpg")

print(f"MOS Estimate: {result['MOS_estimate']}")
print(f"Method Used: {result['selected_method']}")

2. Training on Custom Data

Train the routing model on your own dataset (requires a CSV with image_name and MOS columns):

from diqa import DIQATrainer

trainer = DIQATrainer(
    image_dir="path/to/images",
    mos_csv="path/to/scores.csv",
    output_dir="my_custom_models"
)

# Prepare data (extract features and compute base scores)
trainer.prepare_data()

# Train the router
trainer.train()

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

diqa-0.1.4.tar.gz (74.1 kB view details)

Uploaded Source

Built Distribution

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

diqa-0.1.4-py3-none-any.whl (74.5 kB view details)

Uploaded Python 3

File details

Details for the file diqa-0.1.4.tar.gz.

File metadata

  • Download URL: diqa-0.1.4.tar.gz
  • Upload date:
  • Size: 74.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for diqa-0.1.4.tar.gz
Algorithm Hash digest
SHA256 6bad65fb30020159a8dba9f10c34f333ae2dcdc1accfb76627769d49a4b13d63
MD5 9457ce46fe9d567bc9991b8c43c88755
BLAKE2b-256 e8949fc6191a823587a78db7948321d17c68f53522595205910cc3d79a0c8155

See more details on using hashes here.

File details

Details for the file diqa-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: diqa-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 74.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for diqa-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2dac2bb491e7a04781625317f3d34ff28a548051ab10a082b6a20ffec5e5d835
MD5 734f4a409efa6a98f13214c49da73f76
BLAKE2b-256 80b13581bf226ba00bb3c8c7dca0fd41d2bdf27efaffcc002c1aa6525326e48f

See more details on using hashes here.

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