chaofengc / IQA-PyTorch

👁️ 🖼️ 🔥PyTorch Toolbox for Image Quality Assessment, including LPIPS, FID, NIQE, NRQM(Ma), MUSIQ, TOPIQ, NIMA, DBCNN, BRISQUE, PI and more...
https://iqa-pytorch.readthedocs.io/
Other
1.99k stars 174 forks source link

niqe/ilniqe returns values outside of range #83

Closed hdrmadness closed 1 year ago

hdrmadness commented 1 year ago

Hello

I am getting large niqe and ilniqe scores, so I put some print statements

def forward(self, X: torch.Tensor) -> torch.Tensor: r"""Computation of NIQE metric. Args: X: An input tensor. Shape :math:(N, C, H, W). Returns: Value of niqe metric in [0, 1] range. """ print(X.size()) score = calculate_niqe(X, self.crop_border, self.test_y_channel, self.pretrained_model_path, self.color_space) print("niqe score should be 0 to 1, and we got {}".format(score)) return score

and I get:

torch.Size([1, 3, 512, 344]) | 1/10 [00:01<00:15, 1.78s/it] niqe score should be 0 to 1, and we got 5.133647061808286

chaofengc commented 1 year ago

Sorry that the document is not correct. The output value of niqe/ilniqe is a positive real value, without explicit upper bound limitation.

hdrmadness commented 1 year ago

Thanks for looking into this. Is there a reference in your documentation where the bounds of each metric can be found? I am finding it difficult to correlate scores of different metrics to each other. I attached a list that I am looking at.

NR-IQA bounds.txt

chaofengc commented 1 year ago

Thanks for your information. I have added it to the ModelCard

There are several points about the metric bound: