Skip to main content

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

Release files for diqa 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for diqa 0.1.5
File Size Uploaded
diqa-0.1.5.tar.gz 74.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for diqa 0.1.5
File Interpreter ABI Platform
diqa-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 148.3 kB

Release files / diqa-0.1.5.tar.gz

Download URL diqa-0.1.5.tar.gz
Size 74.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d7573de153becca9a1567824124b5482ec707ccb81c099a1f608b7d3ee2ec1f1
BLAKE2b-256 checksum
How to use checksums
fe08ca0fc3b94dbd2a4276ee4b34ec1f367d336dfd1c084848c45a80bb8a08e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / diqa-0.1.5-py3-none-any.whl

Download URL diqa-0.1.5-py3-none-any.whl
Size 74.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f221040b5c418948bb5733e2911e66e9ba0c7478591c5343f7b5414f38fa11e1
BLAKE2b-256 checksum
How to use checksums
55fd2fd265232a8bb2cb9761c38aeabfb9fb56eb097f668721328e3ed73736df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page