canonical / checkbox

Checkbox
https://checkbox.readthedocs.io
GNU General Public License v3.0
30 stars 44 forks source link

Support PSNR algorithm in checkbox-support (New) #1221

Open baconYao opened 2 months ago

baconYao commented 2 months ago

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

baconYao commented 2 months ago

Hi @kissiel and @fernando79513, I noticed that unittest cannot find the module numpy, may I know how can I solve it?

==================================== 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'
fernando79513 commented 2 months ago

Hi @kissiel and @fernando79513, I noticed that unittest cannot find the module numpy, may I know how can I solve it?

==================================== 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 tox.ini files.

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

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 43.50%. Comparing base (ec16636) to head (92f27db). Report is 27 commits behind head on main.

Additional details and impacted files ```diff @@ 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 ``` | [Flag](https://app.codecov.io/gh/canonical/checkbox/pull/1221/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=canonical) | Coverage Δ | | |---|---|---| | [checkbox-support](https://app.codecov.io/gh/canonical/checkbox/pull/1221/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=canonical) | `53.05% <100.00%> (+0.82%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=canonical#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.