Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FSIM and FSIMc #109

Merged
merged 13 commits into from
Jul 7, 2020
Merged

Add FSIM and FSIMc #109

merged 13 commits into from
Jul 7, 2020

Conversation

zakajd
Copy link
Collaborator

@zakajd zakajd commented Jun 22, 2020

Closes #104

Proposed Changes

  • PyTorch implementation of FSIM and FSIMc
    • 99% accuracy with original MATLAB results
    • Batch computations support
    • Gradient optimisation support (with small hack, because PyTorch will add support for complex tensors grads only in version 1.6.0)

Not ready yet. Tests are still in progress

@snk4tr snk4tr added the feature New feature or request label Jun 23, 2020
@zakajd zakajd changed the title Feature/fsim Add FSIM and FSIMc Jul 1, 2020
@codecov
Copy link

codecov bot commented Jul 1, 2020

Codecov Report

Merging #109 into master will increase coverage by 0.96%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #109      +/-   ##
==========================================
+ Coverage   88.81%   89.78%   +0.96%     
==========================================
  Files          17       18       +1     
  Lines        1421     1546     +125     
==========================================
+ Hits         1262     1388     +126     
+ Misses        159      158       -1     
Flag Coverage Δ
#unittests 89.78% <100.00%> (+0.96%) ⬆️
Impacted Files Coverage Δ
piq/fsim.py 100.00% <100.00%> (ø)
piq/gmsd.py 93.81% <100.00%> (-0.48%) ⬇️
piq/functional.py 96.22% <0.00%> (+1.88%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 43f8c76...e960675. Read the comment docs.

@zakajd zakajd marked this pull request as ready for review July 2, 2020 06:16
@zakajd
Copy link
Collaborator Author

zakajd commented Jul 2, 2020

@denproc @snk4tr ready for review

Copy link
Contributor

@snk4tr snk4tr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR! From my point of view the quality of your code increased dramatically during the last several months. There are just a few small corrections but overall is seems to be ready unless @denproc has some comments.


I see that you added lots of comments in this PR. In general, it is a very good thing. For the educational purposes I want to point out the following thing.

People always forget to change comments/docs when they change code just because it does not effect functionality and thing work fine, tests pass. At the same time, unchanged comment may be extremely confusing for a newcomer trying to understand your implementation. It is often to better have a code without any comments than with some wrong ones.

So the general rule of thumb is to write your code in a way that it is self-explanatory and understandable without any comments. It is absolutely clear that sometimes things are complicated by their nature and if you explain it you are doing a great job. From the other hand, you should always write comments with caution. Great majority of times when you write a comment it just means that you just failed to create a descriptive variable/class/function name or your fancy one-liner does too much stuff. If the code was less dense it would be easier to understand even without any comments.

No particular actions are required here. Just keep it in mind when you implement some new stuff 😉

piq/fsim.py Outdated Show resolved Hide resolved
piq/fsim.py Outdated Show resolved Hide resolved
piq/fsim.py Outdated Show resolved Hide resolved
piq/fsim.py Show resolved Hide resolved
piq/fsim.py Outdated Show resolved Hide resolved
piq/functional.py Outdated Show resolved Hide resolved
piq/functional.py Outdated Show resolved Hide resolved
piq/functional.py Outdated Show resolved Hide resolved
piq/functional.py Outdated Show resolved Hide resolved
tests/test_fsim.py Show resolved Hide resolved
@snk4tr snk4tr self-assigned this Jul 3, 2020
Copy link
Collaborator

@denproc denproc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, a lot of new insights.

README.md Outdated Show resolved Hide resolved
piq/fsim.py Outdated Show resolved Hide resolved
piq/fsim.py Show resolved Hide resolved
piq/fsim.py Outdated Show resolved Hide resolved
piq/fsim.py Show resolved Hide resolved
piq/fsim.py Outdated Show resolved Hide resolved
piq/fsim.py Outdated Show resolved Hide resolved
piq/fsim.py Outdated Show resolved Hide resolved
piq/functional.py Outdated Show resolved Hide resolved
denproc added a commit that referenced this pull request Jul 4, 2020
- added functional.py from #109
- added new colour spaces to convert images
- debugging
- updated tests
zakajd pushed a commit that referenced this pull request Jul 6, 2020
* feature(vsi): Added VSI measure and supporting tests

* Update vsi.py

* feature(vsi): Changes proposed by @zakajd and @snk4tr
- added functional.py from #109
- added new colour spaces to convert images
- debugging
- updated tests

* assets(vsi): Images to run tests
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 6, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@snk4tr snk4tr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job @zakajd !

Copy link
Collaborator

@denproc denproc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, merging

@denproc denproc merged commit 8fca017 into master Jul 7, 2020
@denproc denproc deleted the feature/fsim branch July 7, 2020 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add FSIM and FSIMc measure
4 participants