qualisr-lab 0.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. qualisr_lab-0.1.4/LICENSE +28 -0
  2. qualisr_lab-0.1.4/MANIFEST.in +25 -0
  3. qualisr_lab-0.1.4/PKG-INFO +418 -0
  4. qualisr_lab-0.1.4/README.md +341 -0
  5. qualisr_lab-0.1.4/THIRD_PARTY_NOTICES.md +32 -0
  6. qualisr_lab-0.1.4/dataset/readme.md +87 -0
  7. qualisr_lab-0.1.4/environment.yml +8 -0
  8. qualisr_lab-0.1.4/features/readme.md +81 -0
  9. qualisr_lab-0.1.4/logo.png +0 -0
  10. qualisr_lab-0.1.4/pipeline.png +0 -0
  11. qualisr_lab-0.1.4/pyproject.toml +98 -0
  12. qualisr_lab-0.1.4/qualisr/__init__.py +34 -0
  13. qualisr_lab-0.1.4/qualisr/__main__.py +8 -0
  14. qualisr_lab-0.1.4/qualisr/api.py +114 -0
  15. qualisr_lab-0.1.4/qualisr/cli.py +121 -0
  16. qualisr_lab-0.1.4/qualisr/configs/__init__.py +0 -0
  17. qualisr_lab-0.1.4/qualisr/configs/default.json +233 -0
  18. qualisr_lab-0.1.4/qualisr/configs/pipeline.json +403 -0
  19. qualisr_lab-0.1.4/qualisr/features.py +1106 -0
  20. qualisr_lab-0.1.4/qualisr/pca.py +422 -0
  21. qualisr_lab-0.1.4/qualisr/pipeline.py +444 -0
  22. qualisr_lab-0.1.4/qualisr/profiling.py +504 -0
  23. qualisr_lab-0.1.4/qualisr/references.py +464 -0
  24. qualisr_lab-0.1.4/qualisr/regressors.py +2348 -0
  25. qualisr_lab-0.1.4/qualisr/sample_data/__init__.py +1 -0
  26. qualisr_lab-0.1.4/qualisr/sample_data/features/__init__.py +1 -0
  27. qualisr_lab-0.1.4/qualisr/sample_data/features/fr.csv +121 -0
  28. qualisr_lab-0.1.4/qualisr/sample_data/features/nr.csv +121 -0
  29. qualisr_lab-0.1.4/qualisr/sample_data/features/pca/__init__.py +1 -0
  30. qualisr_lab-0.1.4/qualisr/sample_data/features/pca/resnet_pca5.csv +121 -0
  31. qualisr_lab-0.1.4/qualisr/sample_data/features/pca/vgg_pca5.csv +121 -0
  32. qualisr_lab-0.1.4/qualisr/sample_data/scores/__init__.py +1 -0
  33. qualisr_lab-0.1.4/qualisr/sample_data/scores/labels.csv +121 -0
  34. qualisr_lab-0.1.4/qualisr/statistics.py +371 -0
  35. qualisr_lab-0.1.4/qualisr_lab.egg-info/PKG-INFO +418 -0
  36. qualisr_lab-0.1.4/qualisr_lab.egg-info/SOURCES.txt +41 -0
  37. qualisr_lab-0.1.4/qualisr_lab.egg-info/dependency_links.txt +1 -0
  38. qualisr_lab-0.1.4/qualisr_lab.egg-info/entry_points.txt +8 -0
  39. qualisr_lab-0.1.4/qualisr_lab.egg-info/requires.txt +32 -0
  40. qualisr_lab-0.1.4/qualisr_lab.egg-info/top_level.txt +1 -0
  41. qualisr_lab-0.1.4/reproduce_pipeline.sh +386 -0
  42. qualisr_lab-0.1.4/setup.cfg +4 -0
  43. qualisr_lab-0.1.4/tests/test_package_smoke.py +94 -0
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2026, MSU Graphics & Media Lab
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,25 @@
1
+ include LICENSE
2
+ include README.md
3
+ include THIRD_PARTY_NOTICES.md
4
+ include environment.yml
5
+ include logo.png
6
+ include pipeline.png
7
+ include reproduce_pipeline.sh
8
+ recursive-include qualisr/configs *.json
9
+ recursive-include qualisr/sample_data *.csv
10
+
11
+ prune .agents
12
+ prune .codex
13
+ prune .git
14
+ prune .ruff_cache
15
+ prune catboost_info
16
+ prune dataset
17
+ prune features
18
+ prune plots
19
+ prune realtime_sr
20
+ prune scores
21
+ prune venv
22
+ include dataset/readme.md
23
+ include features/readme.md
24
+ global-exclude __pycache__/*
25
+ global-exclude *.py[cod]
@@ -0,0 +1,418 @@
1
+ Metadata-Version: 2.4
2
+ Name: qualisr-lab
3
+ Version: 0.1.4
4
+ Summary: A toolkit for extracting IQA features, training regressors, and analyzing super-resolution image quality against human scores.
5
+ Author-email: Oleg Ryabinin <oleg.ryabinin@graphics.cs.msu.ru>, Evgeney Bogatyrev <evgeney.bogatyrev@graphics.cs.msu.ru>, Khaled Abud <khaled.abud@graphics.cs.msu.ru>, Dmitriy Vatolin <dmitriy@graphics.cs.msu.ru>
6
+ License: BSD 3-Clause License
7
+
8
+ Copyright (c) 2026, MSU Graphics & Media Lab
9
+
10
+ Redistribution and use in source and binary forms, with or without
11
+ modification, are permitted provided that the following conditions are met:
12
+
13
+ 1. Redistributions of source code must retain the above copyright notice, this
14
+ list of conditions and the following disclaimer.
15
+
16
+ 2. Redistributions in binary form must reproduce the above copyright notice,
17
+ this list of conditions and the following disclaimer in the documentation
18
+ and/or other materials provided with the distribution.
19
+
20
+ 3. Neither the name of the copyright holder nor the names of its
21
+ contributors may be used to endorse or promote products derived from
22
+ this software without specific prior written permission.
23
+
24
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
+
35
+ Project-URL: Homepage, https://github.com/sangwyn/QualiSR-Lab
36
+ Project-URL: Repository, https://github.com/sangwyn/QualiSR-Lab
37
+ Keywords: image-quality-assessment,super-resolution,reduced-reference,multimedia
38
+ Classifier: Development Status :: 3 - Alpha
39
+ Classifier: Intended Audience :: Science/Research
40
+ Classifier: Programming Language :: Python :: 3
41
+ Classifier: Programming Language :: Python :: 3.10
42
+ Classifier: Programming Language :: Python :: 3.11
43
+ Classifier: Programming Language :: Python :: 3.12
44
+ Classifier: Topic :: Scientific/Engineering :: Image Processing
45
+ Requires-Python: >=3.10
46
+ Description-Content-Type: text/markdown
47
+ License-File: LICENSE
48
+ Requires-Dist: matplotlib>=3.8
49
+ Requires-Dist: numpy>=1.24
50
+ Requires-Dist: pandas>=2.0
51
+ Requires-Dist: pillow>=10.0
52
+ Requires-Dist: scikit-learn>=1.3
53
+ Requires-Dist: scipy>=1.10
54
+ Requires-Dist: tqdm>=4.66
55
+ Requires-Dist: huggingface-hub[cli]>=0.23
56
+ Provides-Extra: regressors
57
+ Requires-Dist: catboost>=1.2; extra == "regressors"
58
+ Requires-Dist: lightgbm>=4.0; extra == "regressors"
59
+ Requires-Dist: shap>=0.45; extra == "regressors"
60
+ Requires-Dist: xgboost>=2.0; extra == "regressors"
61
+ Provides-Extra: features
62
+ Requires-Dist: pyiqa>=0.1.15; extra == "features"
63
+ Requires-Dist: timm>=1.0; extra == "features"
64
+ Requires-Dist: torch>=2.2; extra == "features"
65
+ Requires-Dist: torchvision>=0.17; extra == "features"
66
+ Requires-Dist: transformers>=4.40; extra == "features"
67
+ Provides-Extra: notebook
68
+ Requires-Dist: ipykernel>=6.0; extra == "notebook"
69
+ Requires-Dist: jupyter>=1.0; extra == "notebook"
70
+ Provides-Extra: dev
71
+ Requires-Dist: build>=1.2; extra == "dev"
72
+ Requires-Dist: check-manifest>=0.49; extra == "dev"
73
+ Requires-Dist: pytest>=8.0; extra == "dev"
74
+ Requires-Dist: ruff>=0.6; extra == "dev"
75
+ Requires-Dist: twine>=5.0; extra == "dev"
76
+ Dynamic: license-file
77
+
78
+ <div align=center class="logo">
79
+ <img src="logo.png" style="width:640px">
80
+ </a>
81
+ </div>
82
+
83
+ # QualiSR-Lab: Reduced-Reference IQA for SR
84
+
85
+ [Oleg Ryabinin](https://orcid.org/0009-0008-3153-4183)<sup>1,2</sup> | [Evgeney Bogatyrev](https://orcid.org/0000-0002-6173-3561)<sup>1,2,3</sup> | [Abud Khaled](https://orcid.org/0009-0009-7131-5839)<sup>1,2,3</sup> | [Dmitriy Vatolin](https://orcid.org/0000-0002-8893-9340)<sup>1,2,3</sup>
86
+
87
+ <sup>1</sup>Lomonosov Moscow State University, 119991, Moscow, Russia
88
+
89
+ <sup>2</sup>AI Center, Lomonosov Moscow State University
90
+
91
+ <sup>3</sup>MSU Institute for Artificial Intelligence, Lomonosov Moscow State University
92
+
93
+ 🚩 *Submitted to [ACM MM 2026 Open Source Software](https://2026.acmmm.org/site/call-open-source.html).*
94
+
95
+ ## 🔎 Overview
96
+
97
+ This project studies which features extracted from Low-Resolution (LR) and Super-Resolution (SR) images are most informative for Image Quality Assessment (IQA). Its purpose is to assist researchers in studying the best features for their upscaled image quality metrics by providing a pipeline to extract the features and build a comprehensive graphical summary on their contribution to IQA and correlation of the resulting metric with human scores.
98
+
99
+ The proposed pipeline is:
100
+
101
+ 1. **Prepare labels and features**
102
+ Compute image features and attach normalized quality labels.
103
+
104
+ 2. **Train regressors**
105
+ Fit regression models on the resulting tabular data to obtain a simple Reduced-Reference (RR) quality metric.
106
+
107
+ 3. **Analyze feature importance and correlation**
108
+ Evaluate feature importance and compute PLCC/SRCC to identify the most informative features for SR quality assessment.
109
+
110
+ The sections below describe the required data format and the workflow.
111
+
112
+ ![Pipeline overview](pipeline.png)
113
+ ---
114
+
115
+ ## 🐌 Quickstart With Bundled Sample Data
116
+
117
+ The fastest smoke test uses the small score/feature CSV sample bundled inside
118
+ the Python package, so it works after pip installation without downloading the
119
+ full dataset.
120
+
121
+ ```bash
122
+ python -m pip install -e ".[regressors]"
123
+ qualisr-run-regressors
124
+ ```
125
+
126
+ From a cloned repository, you can also run against the editable root
127
+ `configs/`, `scores/`, and `features/` files explicitly:
128
+
129
+ ```bash
130
+ qualisr-run-regressors --config configs/default.json
131
+ ```
132
+
133
+ Or build Docker image:
134
+
135
+ ```bash
136
+ docker build -t qualisr-lab .
137
+ docker run --rm qualisr-lab
138
+ ```
139
+
140
+ You can run any of the following commands inside the Docker container:
141
+
142
+ ```bash
143
+ docker run --rm -it --mount type=bind,source="${PWD}",target=/workspace qualisr-lab bash
144
+ qualisr --help
145
+ qualisr-run-regressors --config configs/default.json
146
+
147
+ ```
148
+
149
+ The image installs the package under `/app`. The optional bind mount above makes
150
+ your local checkout available at `/workspace` without replacing the installed
151
+ package inside the image.
152
+
153
+ ---
154
+
155
+ ## 🛠️ Installation Options
156
+
157
+ From PyPI after release:
158
+
159
+ ```bash
160
+ python -m pip install "qualisr-lab[regressors]"
161
+ ```
162
+
163
+ For the regression pipeline only:
164
+
165
+ ```bash
166
+ python -m pip install -e ".[regressors]"
167
+ ```
168
+
169
+ For full feature extraction on CPU:
170
+
171
+ ```bash
172
+ python -m pip install -e ".[features,regressors]"
173
+ ```
174
+
175
+ The legacy fully pinned environment is kept in `requirements.txt`.
176
+
177
+ See [dataset/readme.md](dataset/readme.md) for dataset download notes.
178
+
179
+ ---
180
+
181
+ ## 🧩 Python API
182
+
183
+ The CLI remains the recommended way to run full experiments, but installed
184
+ packages also expose a small stable API:
185
+
186
+ ```python
187
+ from qualisr import load_regressor_config, run_regressor_experiment
188
+
189
+ cfg = load_regressor_config()
190
+ result = run_regressor_experiment(cfg, make_plots=False)
191
+ print(result["results"])
192
+ ```
193
+
194
+ For the unified pipeline:
195
+
196
+ ```python
197
+ from qualisr import PipelineOptions, load_pipeline_config, run_pipeline
198
+
199
+ cfg = load_pipeline_config()
200
+ run_pipeline(cfg, options=PipelineOptions(only_section=["regressors"], no_plots=True))
201
+ ```
202
+
203
+ Implementation modules such as `qualisr.regressors`, `qualisr.features`, and
204
+ `qualisr.pipeline` remain importable for advanced use.
205
+
206
+ ---
207
+
208
+ ## ♻️ Full Reproducibility Run
209
+
210
+ To download the dataset and run feature extraction, PCA, artifact statistics, and regressor analysis end to end:
211
+
212
+ ```bash
213
+ python -m pip install -e ".[features,regressors]"
214
+ qualisr-run-pipeline --config configs/pipeline.json
215
+ ```
216
+
217
+ You can also use BASH script:
218
+
219
+ ```bash
220
+ bash reproduce_pipeline.sh
221
+ ```
222
+
223
+ The script writes feature-group CSVs such as `features/fr.csv`, `features/nr.csv`, and `features/vgg.csv`, PCA outputs to `features/pca/`, and plots/results to `plots/`.
224
+
225
+ ---
226
+
227
+ ## 🚀 Workflow
228
+
229
+ You may either launch the whole pipeline in a single command with your JSON config as in previous section or do each step separately:
230
+
231
+ ### Step 0 (optional): Prepare reference images
232
+
233
+ Produce [RLFN](https://github.com/bytedance/RLFN) / [SPAN](https://github.com/zononhzy/SPAN) / bicubic images for LR + SR pairs (used to compute FR metrics).
234
+ The bundled `realtime_sr/` directory is a clone-only convenience asset; pip
235
+ installs do not include these scripts/checkpoints, so pass your own paths for
236
+ RLFN/SPAN when running outside the repository.
237
+
238
+ ```bash
239
+ qualisr-make-reference \
240
+ --lr-dir dataset/lr \
241
+ --sr-dirs PASD=dataset/sr/PASD SUPIR=dataset/sr/SUPIR RealESRGAN=dataset/sr/RealESRGAN \
242
+ --out-root dataset/ref \
243
+ --refs bicubic rlfn span \
244
+ --scale 4 \
245
+ --rlfn-script realtime_sr/RLFN/inference-RLFN.py \
246
+ --rlfn-ckpt realtime_sr/RLFN/rlfn-tuned-4x.pth \
247
+ --span-script realtime_sr/SPAN/inference-SPAN.py \
248
+ --span-ckpt realtime_sr/SPAN/span-tuned-4x.pth
249
+ ```
250
+
251
+
252
+ ### Step 1: Compute image features
253
+
254
+ Compute FR / NR / [VGG](https://arxiv.org/abs/1409.1556) / [ResNet](https://arxiv.org/abs/1512.03385) / [SigLIP](https://arxiv.org/abs/2303.15343) features for SR images and save them into a single CSV file.
255
+
256
+ SR methods are passed as `METHOD=DIR`.
257
+ Reference image filenames are expected in the format:
258
+
259
+ ```text
260
+ <sr_stem>@<sr_method>@<ref_name>.<ext>
261
+ ```
262
+
263
+ ```bash
264
+ qualisr-extract-features \
265
+ --sr-dirs PASD=dataset/sr/PASD SUPIR=dataset/sr/SUPIR RealESRGAN=dataset/sr/RealESRGAN \
266
+ --gt-dir dataset/hr \
267
+ --lr-dir dataset/lr \
268
+ --ref-dirs bicubic=dataset/ref/bicubic rlfn=dataset/ref/rlfn span=dataset/ref/span \
269
+ --features fr,nr,vgg,resnet,siglip \
270
+ --output features/image_features.csv \
271
+ --device cuda
272
+ ```
273
+
274
+ Add `--profile` to save `<output_stem>_profile.csv` with mean runtime per feature. Add `--profile-flops` to also estimate PyTorch model FLOPs for features such as VGG, ResNet, SigLIP, and PyIQA metrics; this implies profiling and reruns model calls, so it is slower.
275
+
276
+ ---
277
+
278
+ ### Step 2: Apply PCA to high-dimensional features
279
+
280
+ Apply Principal Component Analysis (PCA) to high-dimensional feature blocks such as `vgg_*` and `resnet_*` in CSV files produced in Step 1.
281
+
282
+ ```bash
283
+ qualisr-apply-pca \
284
+ --input features/image_features.csv \
285
+ --blocks vgg=vgg_ resnet=resnet_ \
286
+ --n-components 5 10 25 50 75 \
287
+ --test-size 0.2 \
288
+ --split-seed 42 \
289
+ --output-dir features/pca
290
+ ```
291
+
292
+ ---
293
+
294
+ ### Step 3: Compute artifact-mask statistics
295
+
296
+ Compute summary statistics for heatmaps stored as `.npy`, `.npy.gz`, or compatible compressed files.
297
+ Input directories can be passed as `PREFIX=DIR` to ensure stable sample naming.
298
+
299
+ ```bash
300
+ qualisr-compute-stats \
301
+ --heatmap-dirs PASD=dataset/heatmaps/PASD SUPIR=dataset/heatmaps/SUPIR RealESRGAN=dataset/heatmaps/RealESRGAN \
302
+ --output features/stats.csv \
303
+ --percentiles 5 95 \
304
+ --area-thresholds 0 0.5 0.75
305
+ ```
306
+
307
+ Add `--profile` to save `<output_stem>_profile.csv` with mean runtime and simple operation-count estimates for artifact statistics.
308
+
309
+ ---
310
+
311
+ ### Step 4: Fit regressors and analyze results
312
+
313
+ Train regressors and produce summary on feature importances and correlations. The correlation plot can also include direct NR/FR metric baselines from feature CSV files.
314
+
315
+ ```bash
316
+ qualisr-run-regressors --config configs/default.json
317
+ ```
318
+
319
+ Add `--profile` to save `regressor_profile.csv` with train/predict runtime and estimated prediction FLOPs for tree regressors. If feature profile CSVs are available, pass them with `--feature-profile-files` or configure `profiling.feature_profile_files`; the pipeline also saves `regressor_total_profile.csv` with summed feature + regressor runtime/FLOPs.
320
+
321
+ You can also use `regressors.ipynb` notebook for experiments. It trains regressors, evaluates them, and visualizes:
322
+
323
+ - feature importances,
324
+ - PLCC/SRCC correlations,
325
+ - feature cross-correlation matrix,
326
+ - MOS/prediction scatter plot,
327
+ - comparisons across feature groups and model settings.
328
+
329
+ The first notebook cell describes the workflow for running experiments individually or in batches.
330
+
331
+ Example outputs:
332
+
333
+ ![Feature importances](plots/example@pca5/importances/all_models_importances.png)
334
+ ![Correlations](plots/example@pca5/correlations/correlations.png)
335
+
336
+ ---
337
+
338
+ ## 🔬 Feature Types
339
+
340
+ This section summarizes the feature groups used in the pipeline. For references and guidelines to adding custom features, address [features/readme.md](features/readme.md).
341
+
342
+ ### No-Reference (NR) metrics
343
+
344
+ NR metrics are widely used in SR-IQA because they do not require a perfect high-resolution reference image. Their main limitation is that they ignore information available in the input LR image, which may cause them to miss or even reward artifacts introduced by SR models.
345
+
346
+ Recommended NR metrics in this project, based on results from the [SR Metrics Benchmark](https://videoprocessing.ai/benchmarks/super-resolution-metrics.html):
347
+
348
+ - [Q-Align](https://github.com/Q-Future/Q-Align)
349
+ - [MUSIQ](https://github.com/anse3832/MUSIQ)
350
+ - [ARNIQA](https://github.com/miccunifi/ARNIQA)
351
+ - [UNIQUE](https://github.com/zwx8981/UNIQUE)
352
+ - [PaQ2PiQ](https://github.com/baidut/paq2piq)
353
+
354
+ These metrics are computed through the [PyIQA](https://github.com/chaofengc/IQA-PyTorch) interface, so the list can be changed easily.
355
+
356
+ ---
357
+
358
+ ### Full-Reference (FR) metrics
359
+
360
+ FR metrics are not always ideal for SR-IQA because they assume access to a perfect reference image. Still, they provide useful information about fidelity.
361
+
362
+ When true GT images are unavailable, the project uses **pseudo-GT** references: images obtained by upscaling the LR input with methods that are faithful to the LR image and do not introduce strong hallucinated content.
363
+
364
+ Reference upscaling methods used here:
365
+
366
+ - bicubic interpolation
367
+ - [SPAN](https://github.com/zononhzy/SPAN)
368
+ - [RLFN](https://github.com/bytedance/RLFN)
369
+
370
+ Recommended FR metrics in this project, based on results from the [SR Metrics Benchmark](https://videoprocessing.ai/benchmarks/super-resolution-metrics.html):
371
+
372
+ - [LPIPS-VGG](https://github.com/richzhang/perceptualsimilarity)
373
+ - [STLPIPS-VGG](https://github.com/abhijay9/ShiftTolerant-LPIPS)
374
+ - [PieAPP](https://github.com/prashnani/PerceptualImageError)
375
+ - [AHIQ](https://github.com/IIGROUP/AHIQ)
376
+ - [PSNR](https://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio)
377
+ - [SSIM](https://ece.uwaterloo.ca/~z70wang/publications/ssim.html)
378
+
379
+ These metrics are also computed through [PyIQA](https://github.com/chaofengc/IQA-PyTorch).
380
+
381
+ ---
382
+
383
+ ### Pretrained encoder features (+ PCA)
384
+
385
+ Feature embeddings from pretrained encoders can capture semantic and perceptual information not covered by classical IQA metrics.
386
+
387
+ This project uses features extracted from:
388
+
389
+ - [VGG](https://arxiv.org/abs/1409.1556)
390
+ - [ResNet](https://arxiv.org/abs/1512.03385)
391
+ - [SigLIP](https://arxiv.org/abs/2303.15343)
392
+ - any encoders from [timm](https://github.com/huggingface/pytorch-image-models)
393
+
394
+ Because these embeddings are often high-dimensional, Principal Component Analysis (PCA) can be applied before training regressors.
395
+
396
+ ---
397
+
398
+ ### Artifact-mask statistics
399
+
400
+ Artifacts are common in modern deep-learning-based SR models. The working hypothesis of this project is:
401
+
402
+ > Artifact-related information provides useful signals for assessing generated image quality.
403
+
404
+ An artifact mask is a single-channel tensor with values in the range `[0, 1]`.
405
+ Masks for SR images must be computed beforehand with a suitable method such as [Prominence-Aware Artifact Detection metric](https://arxiv.org/abs/2510.16752).
406
+
407
+ The project extracts the following summary statistics from artifact masks:
408
+
409
+ - min
410
+ - max
411
+ - mean
412
+ - median
413
+ - std
414
+ - percentiles
415
+ - thresholded artifact area
416
+
417
+ ## 🎫 License
418
+ This project is released under the [BSD-3-Clause license](LICENSE).