zwx8981/LIQE

How to reduce the evaluation time.

Closed this issue · 2 comments

Hi, I tested the quality evaluation of a single image using the demo2. py, and it took more than 5 seconds. How to reduce the evaluation time. I only need the quality score.

@Mapzzone Hi, thanks for your question. Did you run the code in CPU or GPU mode ? In addition, what's the resolution of your test image? In general, the most straightforward way to reduce inference time is reduce the number of patch (L10 in demo2.py). By default, we randomly crop 15 patches with a size of 224 x 224 during inference. Empirically, I think 5 patches would also be good.

@Mapzzone Hi, I just think of that if you directly count the running time of executing the entire demo2.py, most the of the time is actucally used for importing modules, loading weights, and initializing the GPU, corresponding to Line 1 to Line 20 of demo2.py. If you want to test multiple images, it's better to write a loop on top of the image reading and model inference, corresponding to Line 22 to Line 36 of demo2.py.

Hope this answers your question well, feel free to contact me if you have futher question :)