NIQE is an abbreviation of “Natural Image Quality Evaluator”. This non-reference (blind) method was described in the paper “Making a ‘Completely Blind’ Image Quality Analyzer“, by Anish Mittal, Rajiv Soundararajan and Alan C. Bovik.
The original python code of NIQE method is located here . I modified an interface of the code to get video sequences in different formats: yuv, mp4, h264, h265 and store NIQE scores in a separate csv-file (score per frame), at the end the average score and 95-percentile are printed.
Why 95-percentile is output? The higher NIQE scores the poorer video.
To run NIQE metric you need download niqe_score.py and data-file niqe_image_params.mat . The data-file should be located at the same folder where niqe_score.py is placed. If you apply NIQE method on mp4, h264, h265 files then you need ffmpeg in the system PATH in order to decode streams (notice that decoded raw data is stored as temporary file). In addition your python should be equipped with scipy, numpy and pillar packages.
Usage of niqe_score.py:
-i input yuv-file (yuv420p) or mp4-file or h264 file or h265 file
-o output csv file to store NIQE scores each frame
–width width, irrelevant for mp4, h264 and h265, default 1920
–height height, , irrelevant for mp4, h264 and h265, default 1080
-n number of frames to process, if 0 then the whole stream, default 0
-v print NIQE score for each frame, (default false)
Example [first 100 frames from bitstream of 10Mbps (the higher NIQE scores the poorer video)]:
python niqe_scores.py -i swbf_hp_cbr16_10M.h264 -o swbf_hp_cbr16_10M.csv -n 100 -v
….
Frame 0, NIQE score: 15.360
Frame 1, NIQE score: 14.474
Frame 2, NIQE score: 13.995
Frame 3, NIQE score: 13.847
Frame 4, NIQE score: 13.159
Frame 5, NIQE score: 12.749
Frame 6, NIQE score: 12.364
Frame 7, NIQE score: 11.967
Frame 8, NIQE score: 12.267
Frame 9, NIQE score: 12.022
Frame 10, NIQE score: 11.954
Frame 11, NIQE score: 12.378
Frame 12, NIQE score: 12.106
Frame 13, NIQE score: 12.060
Frame 14, NIQE score: 11.681
Frame 15, NIQE score: 11.391
Frame 16, NIQE score: 11.222
Frame 17, NIQE score: 11.341
Frame 18, NIQE score: 11.302
Frame 19, NIQE score: 11.344
Frame 20, NIQE score: 11.175
Frame 21, NIQE score: 11.149
Frame 22, NIQE score: 11.009
Frame 23, NIQE score: 11.398
Frame 24, NIQE score: 11.460
Frame 25, NIQE score: 11.247
…
Frame 97, NIQE score: 11.579
Frame 98, NIQE score: 11.546
Frame 99, NIQE score: 11.446
mean NIQE scores: 11.074669
95-percentile NIQE scores: 12.769623
Example [first 100 frames from bitstream of 20Mbps from the same video content as in the previous example]:
python niqe_scores.py -i swbf_hp_cbr16_20M.h264 -o swbf_hp_cbr16_20M.csv -n 100 -v
….
Frame 0, NIQE score: 13.965
Frame 1, NIQE score: 12.777
Frame 2, NIQE score: 11.755
Frame 3, NIQE score: 12.220
Frame 4, NIQE score: 11.869
Frame 5, NIQE score: 12.059
Frame 6, NIQE score: 11.420
Frame 7, NIQE score: 11.093
Frame 8, NIQE score: 11.110
Frame 9, NIQE score: 11.325
Frame 10, NIQE score: 11.219
Frame 11, NIQE score: 11.725
Frame 12, NIQE score: 11.212
Frame 13, NIQE score: 11.318
Frame 14, NIQE score: 10.984
Frame 15, NIQE score: 10.936
Frame 16, NIQE score: 10.719
Frame 17, NIQE score: 10.806
Frame 18, NIQE score: 10.881
Frame 19, NIQE score: 10.846
Frame 20, NIQE score: 10.619
Frame 21, NIQE score: 10.571
Frame 22, NIQE score: 10.510
Frame 23, NIQE score: 10.733
Frame 24, NIQE score: 10.879
Frame 25, NIQE score: 10.827
Frame 26, NIQE score: 10.778
Frame 27, NIQE score: 10.654
Frame 28, NIQE score: 10.718
Frame 29, NIQE score: 10.684
Frame 30, NIQE score: 10.718
Frame 31, NIQE score: 10.546
Frame 32, NIQE score: 10.468
Frame 33, NIQE score: 10.456
Frame 34, NIQE score: 10.490
Frame 35, NIQE score: 10.444
Frame 36, NIQE score: 10.437
Frame 37, NIQE score: 10.584
Frame 38, NIQE score: 10.500
Frame 39, NIQE score: 10.415
Frame 40, NIQE score: 10.449
Frame 41, NIQE score: 10.459
Frame 42, NIQE score: 10.449
Frame 43, NIQE score: 10.441
Frame 44, NIQE score: 10.414
Frame 45, NIQE score: 10.425
Frame 46, NIQE score: 10.400
Frame 47, NIQE score: 10.342
Frame 48, NIQE score: 10.276
Frame 49, NIQE score: 10.331
Frame 50, NIQE score: 10.235
Frame 51, NIQE score: 10.286
Frame 52, NIQE score: 10.234
Frame 53, NIQE score: 10.299
Frame 54, NIQE score: 10.348
Frame 55, NIQE score: 10.330
Frame 56, NIQE score: 10.264
Frame 57, NIQE score: 10.271
Frame 58, NIQE score: 10.278
Frame 59, NIQE score: 10.241
Frame 60, NIQE score: 10.116
Frame 61, NIQE score: 10.207
Frame 62, NIQE score: 10.208
Frame 63, NIQE score: 10.236
Frame 64, NIQE score: 10.191
Frame 65, NIQE score: 10.110
Frame 66, NIQE score: 10.120
Frame 67, NIQE score: 10.235
Frame 68, NIQE score: 10.185
Frame 69, NIQE score: 10.197
Frame 70, NIQE score: 10.221
Frame 71, NIQE score: 10.188
Frame 72, NIQE score: 10.072
Frame 73, NIQE score: 10.278
Frame 74, NIQE score: 10.213
Frame 75, NIQE score: 10.192
Frame 76, NIQE score: 10.455
Frame 77, NIQE score: 10.175
Frame 78, NIQE score: 10.313
Frame 79, NIQE score: 10.315
Frame 80, NIQE score: 10.136
Frame 81, NIQE score: 10.172
Frame 82, NIQE score: 10.132
Frame 83, NIQE score: 10.138
Frame 84, NIQE score: 10.143
Frame 85, NIQE score: 10.807
Frame 86, NIQE score: 10.565
Frame 87, NIQE score: 10.570
Frame 88, NIQE score: 10.469
Frame 89, NIQE score: 10.767
Frame 90, NIQE score: 10.711
Frame 91, NIQE score: 10.445
Frame 92, NIQE score: 10.369
Frame 93, NIQE score: 11.062
Frame 94, NIQE score: 10.686
Frame 95, NIQE score: 10.982
Frame 96, NIQE score: 11.666
Frame 97, NIQE score: 11.614
Frame 98, NIQE score: 11.745
Frame 99, NIQE score: 11.456
mean NIQE scores: 10.679050
95-percentile NIQE scores: 11.761007
Bear in mind the higher NIQE scores the poorer video. Therefore NIQE scores of bitrate 20Mbps are lower than those of 10Mbps.
In the paper “Blind Prediction of Natural Video Quality”, Michele A. Saad, Alan C. Bovik et al. two most popular non-reference (blind) visual metrics NIQE and BLIINDS were compared to MOS (Mean Opinion Scores):
Here
LCC – linear correlation coefficient (or Pearson coefficient)
SROCC – the Spearman rank order correlation coefficient
23+ years’ programming and theoretical experience in the computer science fields such as video compression, media streaming and artificial intelligence (co-author of several papers and patents).
the author is looking for new job, my resume