Support PSNR algorithm in checkbox-support (New)#1221
Conversation
Implement the PSNR algorithm in Checkbox Support by reference the OpenCV official document. - https://docs.opencv.org/3.4/d5/dc4/tutorial_video_input_psnr_ssim.html
|
Hi @kissiel and @fernando79513, I noticed that unittest cannot find the module ==================================== ERRORS ====================================
_____________ ERROR collecting checkbox_support/tests/test_psnr.py _____________
ImportError while importing test module '/home/runner/work/checkbox/checkbox/checkbox-support/checkbox_support/tests/test_psnr.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
checkbox_support/tests/test_psnr.py:2: in <module>
import numpy as np
E ModuleNotFoundError: No module named 'numpy' |
At the moment the numpy module is not installed for checkbox support tests. On the base provider, we are installing opencv in the github runners. This can be done including the dependency on the Regarding if we should include numpy in checkbox-support, its a great point to be made. As @kissiel mentioned, numpy is quite a big library. It takes about 100MB of space, so maybe we should try to avoid including it in checkbox-support |
1e639fe to
d251037
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1221 +/- ##
==========================================
+ Coverage 43.38% 43.50% +0.11%
==========================================
Files 357 358 +1
Lines 38686 38744 +58
Branches 6561 6567 +6
==========================================
+ Hits 16784 16855 +71
+ Misses 21238 21225 -13
Partials 664 664
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
fernando79513
left a comment
There was a problem hiding this comment.
Sorry for the late review. I didn't see any big issues, just some small improvements.
The only thing that we should take into account is that usually, a low PSNR means bad quality.
If we are assigning 0 to the case when there is no loss, we should also add a check for 0 when we assign the threshold on the final test.
Co-authored-by: Fernando Bravo <39527354+fernando79513@users.noreply.github.com>
Co-authored-by: Fernando Bravo <39527354+fernando79513@users.noreply.github.com>
Co-authored-by: Fernando Bravo <39527354+fernando79513@users.noreply.github.com>
Co-authored-by: Fernando Bravo <39527354+fernando79513@users.noreply.github.com>
Co-authored-by: Fernando Bravo <39527354+fernando79513@users.noreply.github.com>
Co-authored-by: Fernando Bravo <39527354+fernando79513@users.noreply.github.com>
Co-authored-by: Fernando Bravo <39527354+fernando79513@users.noreply.github.com>
Co-authored-by: Fernando Bravo <39527354+fernando79513@users.noreply.github.com>
901fa81 to
605e50d
Compare
Co-authored-by: Fernando Bravo <39527354+fernando79513@users.noreply.github.com>
* Support PSNR algorithm in checkbox-support Implement the PSNR algorithm in Checkbox Support by reference the OpenCV official document. - https://docs.opencv.org/3.4/d5/dc4/tutorial_video_input_psnr_ssim.html * Added opencv_python to checkbox support tox.ini * Update the unittest of PSNR * Handle the divide zero case and improve unittest * Update checkbox-support/checkbox_support/scripts/psnr.py Co-authored-by: Fernando Bravo <39527354+fernando79513@users.noreply.github.com> * Update checkbox-support/checkbox_support/scripts/psnr.py Co-authored-by: Fernando Bravo <39527354+fernando79513@users.noreply.github.com> * Update checkbox-support/checkbox_support/scripts/psnr.py Co-authored-by: Fernando Bravo <39527354+fernando79513@users.noreply.github.com> * Update checkbox-support/checkbox_support/tests/test_psnr.py Co-authored-by: Fernando Bravo <39527354+fernando79513@users.noreply.github.com> * Update checkbox-support/checkbox_support/tests/test_psnr.py Co-authored-by: Fernando Bravo <39527354+fernando79513@users.noreply.github.com> * Update checkbox-support/checkbox_support/tests/test_psnr.py Co-authored-by: Fernando Bravo <39527354+fernando79513@users.noreply.github.com> * Update checkbox-support/checkbox_support/tests/test_psnr.py Co-authored-by: Fernando Bravo <39527354+fernando79513@users.noreply.github.com> * Update checkbox-support/checkbox_support/tests/test_psnr.py Co-authored-by: Fernando Bravo <39527354+fernando79513@users.noreply.github.com> * Remove psnr from toml file * Refactor * Patch sys.argv to mock args * Fixed numpy version in python 10 * Fixed extension of files in test * Add test_similar_images case Co-authored-by: Fernando Bravo <39527354+fernando79513@users.noreply.github.com> * Fix black issue --------- Co-authored-by: ferbraher <fernando.bravo.hernandez@canonical.com> Co-authored-by: Fernando Bravo <39527354+fernando79513@users.noreply.github.com>
Description
Implement the PSNR algorithm in Checkbox Support by reference the OpenCV official document.
Why I propose this PR?
Resolved issues
N/A
Documentation
OpenCV official document:
Tests