Visual-Information-Fidelity---Python icon indicating copy to clipboard operation
Visual-Information-Fidelity---Python copied to clipboard

change dependency to pyrtools?

Open maitra opened this issue 2 years ago • 7 comments

According to the link https://github.com/LabForComputationalVision/pyPyrTools pyPyrTools is unsupported and replaced by pyrtools? Should the dependency and code be modified to reflect that?

maitra avatar Oct 08 '23 17:10 maitra

I wonder what the answer of the test.py is? I get: 0.19145732 as the answer in the test example. Is that the correct answer?

maitra avatar Oct 08 '23 23:10 maitra

I wonder what the answer of the test.py is? I get: 0.19145732 as the answer in the test example. Is that the correct answer?

The gold standard way to check the correctness is to use the code provided by the authors available here. As long as the code does not throw any error the answer you're getting should be correct I believe.

According to the link https://github.com/LabForComputationalVision/pyPyrTools pyPyrTools is unsupported and replaced by pyrtools? Should the dependency and code be modified to reflect that?

I need to look into this. If you have a working code can you submit a pull request? I will verify and merge into the repo. Thanks!

pavancm avatar Oct 09 '23 00:10 pavancm

I wonder what the answer of the test.py is? I get: 0.19145732 as the answer in the test example. Is that the correct answer?

The gold standard way to check the correctness is to use the code provided by the authors available here. As long as the code does not throw any error the answer you're getting should be correct I believe.

I do not have Matlab so can not run the "gold standard code." However, I note that if I convert the bmp images to png, I get a different answer. Is this correct? Do all files only need to be .bmp?

According to the link https://github.com/LabForComputationalVision/pyPyrTools pyPyrTools is unsupported and replaced by pyrtools? Should the dependency and code be modified to reflect that?

I need to look into this. If you have a working code can you submit a pull request? I will verify and merge into the repo. Thanks!

I have redone your code to be in python3, however, it is now slightly different and no longer depends on any of these two libraries (since I only modified those parts that are called by the code, and dropped the rest). So, not sure how useful it will be to you.

maitra avatar Oct 09 '23 00:10 maitra

However, I note that if I convert the bmp images to png, I get a different answer. Is this correct? Do all files only need to be .bmp?

How big is the difference? Technically it should not change significantly unless the conversion is causing significant changes in the pixel values. Try checking whether the pixel values present in .bmp and .png formats are very different.

pavancm avatar Oct 09 '23 00:10 pavancm

However, I note that if I convert the bmp images to png, I get a different answer. Is this correct? Do all files only need to be .bmp?

How big is the difference? Technically it should not change significantly unless the conversion is causing significant changes in the pixel values. Try checking whether the pixel values present in .bmp and .png formats are very different.

Massive.

0.1914 vs. 0.07.

The bmp and png figures look the same. conveting back the png to bmp brings it back to 0.1914. I do not understand this. Do you also get 0.1914 on the example that you have above?

Assuming that there are no errors in the code, that is why I was wondering if your answer matched the one that you would get using the Matlab code.

It would be helpful to have an example with the answer, otherwise the implementation is a bit uncertain as to whether it compiled correctly..

maitra avatar Oct 09 '23 00:10 maitra

i cleaned up the C code (convolve.c) a bit to bring it on par with ansi pedantic (and get no warnings, boy this is 1987 code!) and get the same answer now, but very low. I get 0.07073818 as VIF. Is that what the python2 and matlab codes also give you?

The above is with M=3 in vifvec.py. Increasing M to 32 (which is the highest before I start getting a singular matrix) gives me a value of 0.08415761.

I hope the code is doing the right thing.

I have now forked and put the Python3 code up in case you wanted to check it out.

maitra avatar Oct 09 '23 12:10 maitra

I am currently out of town. I will verify these observations once I am back. Thanks for pointing this!

pavancm avatar Oct 09 '23 16:10 pavancm