Repository navigation
hog block normalization fix - #1345
PuppySaturation wants to merge 2 commits into
Conversation
|
@scikit-image/core Can anyone who uses HoG's verify this fix? |
|
@stefanv it seems indeed right to use the L2 norm of |
|
@PuppySaturation Thanks very much for this fix; could you please add a test, then I will merge. |
|
Gave the test some though, didn't come up with anything that would be useful. |
|
Gave the test some though, didn't come up with anything that would be useful. The current test for HoG don't seem to cover general value accuracy, so I'm not sure quite how to go about this. Given that is it such a small fix, if there was no test before, how does it warrant one now? |
|
@PuppySaturation - Generally speaking, if the tests are bad at actually evaluating the function feel completely free to improve them. Trivial tests are easy to write, but aren't good long-term. In this case, HoG wasn't well tested. Sometimes it's appropriate to test if a function works given proper inputs, or doesn't work in specific ways. However, the fact that this change - which meaningfully changed the quantitative results - didn't make the test suite throw a fit is a bug, just not one a typical user sees. As for why an improvement is needed, we have to make sure this change will not regress in future versions. You found a real bug (thanks!) but that change also exposed an insufficiency in the testsuite, which we need to shore up. I'm completely fine with hardcoded values, if there is a known valid example available or if one can hand-calculate the expected results. This type of test is very powerful, even if seemingly rather simple. Note that for this type of test, |
|
Yet for a complex operation such as HoG the only practical way of obtaining the values of a non-trivial transformation is to run the algorithm. That would mean they are in affect testing whether the implementation fits itself. This might be useful to some extent, but It would also mean that the tests themselves would have to be subject to bug fixes of the algorithm. Which would make future corrections complicated. If my change were from: and the function normalize was properly tested, would HoG still needed a new test? |
|
@JDWarner would you be "satisfied enough" to merge this PR if the function will be tested against random input matrix with fixed seed? |
|
Yes, that would work. Ideally we would have an independently verified result to compare against, though. |
|
I suppose, that's not the easiest thing to get for a HoG descriptor. UPD: Ah, sorry. We could verify against MATLAB. |
|
@JDWarner Ok, well, a comparison had been added in c095daa#diff-f7fbb052903c8ca5aab7b798019b73b3R23 . |
|
Perhaps @sdsingh has some thoughts, since he was looking at comparing with the Matlab results. |
|
Thank you @soupault for picking this up. I completely forgot about it. |
|
Superseded by #2040. |
Was reviewing and comparing with my own HoG implementation, noticed that the normalization was done wrong. I fixed it assuming an L-2 normalization.