This fixes the size of the score array which will later be interpolated to create the final saliency map. #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The original calculation of the size of the scores array used "int(80/d)+1".
This works correctly for d with 80 % d != 0.
However, if 80 % d = 0, this creates an additional row and column which will never be reached by the loop "for i in range(0,80,d)".
For example, if the d=1, then the scores array would have size 81x81 instead of the intended 80x80(one value for each pixel).
d=5 hast the same problem, such that the last row and column are never reached by the loop and will always be 0.
When the saliency map is resized to 80x80 later, this results in saliency maps that are shifted to the top left and never have meaningful values in the last rows and columns.
I propose to use "int(79/d)+1" for the size of the scores array instead.
This keeps the functionality for d with 80 % d != 0 which just removing the +1 and using "int(80/d)" would not do.
In addition, "int(79/d)+1" results in exactly one less column and row for d with 80 % d = 0.
For example for d=1, "int(79/d)+1" correctly results in a scores array of size 80x80.